82 lines
2.2 KiB
Lua
82 lines
2.2 KiB
Lua
vim.g.mapleader = " "
|
|
|
|
require("config.lazy")
|
|
|
|
require("mason").setup()
|
|
require("mason-lspconfig").setup({
|
|
ensure_installed = {
|
|
"pylsp",
|
|
"clangd",
|
|
"ols",
|
|
"ts_ls",
|
|
"vue_ls",
|
|
"phpactor",
|
|
},
|
|
})
|
|
require("mason-nvim-dap").setup({
|
|
ensure_installed = { "php" },
|
|
automatic_setup = true,
|
|
handlers = {},
|
|
})
|
|
|
|
-- My user settings:
|
|
vim.opt.number = true
|
|
vim.opt.relativenumber = true
|
|
vim.opt.shiftwidth = 4
|
|
vim.opt.tabstop = 4
|
|
vim.opt.expandtab = true
|
|
vim.opt.autoindent = true
|
|
vim.opt.foldmethod = "indent"
|
|
vim.opt.foldenable = false
|
|
vim.cmd([[colorscheme everforest]])
|
|
|
|
-- My custom keybinds
|
|
-- vim.keymap.set("n", "<space><space>x", "<cmd>source %<CR>") -- Can't do this with lazy.nvim apparently
|
|
vim.keymap.set("n", "<Leader>x", ":.lua<CR>")
|
|
vim.keymap.set("v", "<Leader>x", ":lua<CR>")
|
|
vim.api.nvim_set_keymap('t', '<ESC>', [[<C-\><C-n>]], {noremap = true})
|
|
-- vim.api.nvim_set_keymap('i', '<C-k>', [[<C-x><C-o>]], {noremap = true})
|
|
|
|
-- Harpoon Setup and Settings
|
|
local harpoon = require("harpoon")
|
|
harpoon:setup()
|
|
vim.keymap.set("n", "<Leader>n", function() harpoon:list():add() end)
|
|
vim.keymap.set("n", "<Leader>h", function() harpoon.ui:toggle_quick_menu(harpoon:list()) end)
|
|
vim.keymap.set("n", "<Leader>d", function() harpoon:list():remove() end)
|
|
vim.keymap.set("n", "<Leader>j", function() harpoon:list():select(1) end)
|
|
vim.keymap.set("n", "<Leader>k", function() harpoon:list():select(2) end)
|
|
vim.keymap.set("n", "<Leader>l", function() harpoon:list():select(3) end)
|
|
vim.keymap.set("n", "<Leader>;", function() harpoon:list():select(4) end)
|
|
|
|
|
|
--local lspconfig = require('lspconfig')
|
|
local lspconfig = vim.lsp.config
|
|
local lspenable = vim.lsp.enable
|
|
lspconfig("ts_ls", {
|
|
filetypes = {'javascript', 'typescript', 'vue', 'typescriptreact', 'javascriptreact'},
|
|
})
|
|
lspconfig("phpactor", {
|
|
cmd = {'phpactor', 'language-server'},
|
|
filetypes = {'php'},
|
|
})
|
|
lspenable("pylsp")
|
|
lspenable("clangd")
|
|
lspenable("ols")
|
|
lspenable("ts_ls")
|
|
lspenable("vue_ls")
|
|
lspenable("glsl_analyzer")
|
|
lspenable("phpactor")
|
|
|
|
|
|
local dap = require('dap')
|
|
dap.configurations.php = {
|
|
{
|
|
type = 'php',
|
|
request = 'launch',
|
|
name = 'Listen for Apache Prestashop',
|
|
port = 9003,
|
|
pathMappings = {
|
|
["/home/bnilsen/var/www/html/prestashop"] = vim.fn.getcwd()
|
|
}
|
|
}
|
|
}
|