Nvim: update plugins and restructure plugin configs a bit

This commit is contained in:
Marko Korhonen 2024-01-26 16:47:55 +02:00
parent 48f8b06521
commit 1cac49f5aa
4 changed files with 75 additions and 79 deletions

View file

@ -11,33 +11,19 @@ return {
"mfussenegger/nvim-jdtls",
-- Add support for LSP file operations
{ "antosha417/nvim-lsp-file-operations", config = true },
-- Neovim setup for init.lua and plugin development with full signature help, docs and completion for the nvim lua API.
{
"folke/neodev.nvim",
--- @type LuaDevOptions
opts = {
override = function(root_dir, library)
local dotfiles_path = tostring(vim.fn.expand("~/git/dotfiles"))
if string.find(root_dir, dotfiles_path, 1, true) then
library.enabled = true
library.plugins = true
end
end,
},
},
},
config = function()
require("mason").setup()
local mason_lsp = require("mason-lspconfig")
local mlspc = require("mason-lspconfig")
local lsp_utils = require("lsp_utils")
mason_lsp.setup()
mason_lsp.setup_handlers({
mlspc.setup()
mlspc.setup_handlers({
-- Default handler
function(server_name)
require("lspconfig")[server_name].setup({
on_attach = lsp_utils.on_attach,
on_attach = lsp_utils.map_keys,
capabilities = lsp_utils.get_capabilities(),
})
end,

View file

@ -0,0 +1,14 @@
-- Neovim setup for init.lua and plugin development with full signature help, docs and completion for the nvim lua API.
return {
"folke/neodev.nvim",
--- @type LuaDevOptions
opts = {
override = function(root_dir, library)
local dotfiles_path = tostring(vim.fn.expand("~/git/dotfiles"))
if string.find(root_dir, dotfiles_path, 1, true) then
library.enabled = true
library.plugins = true
end
end,
},
}