dots/modules/home-manager/files/nvim/lua/plugins/nvim-lspconfig.lua
Gene Liverman dfc94f8c69 Neovim setup
Can it be this easy to make nvim stuff just work? Do I really just need
to pull the files in with Home Manager? It seems so, so long as nvim
knows about gcc :)

There is also a related side of tmux here because it all ties together.
2023-12-28 16:00:46 -05:00

26 lines
1.1 KiB
Lua

return {
"neovim/nvim-lspconfig",
config = function ()
local on_attach = function(_, _)
vim.keymap.set('n', '<leader>rn', vim.lsp.buf.rename, {})
vim.keymap.set('n', '<leader>ca', vim.lsp.buf.code_action, {})
vim.keymap.set('n', 'gd', vim.lsp.buf.definition, {})
vim.keymap.set('n', 'gi', vim.lsp.buf.implementation, {})
vim.keymap.set('n', 'gr', require('telescope.builtin').lsp_references, {})
vim.keymap.set('n', 'K', vim.lsp.buf.hover, {})
end
local lspconfig = require("lspconfig")
lspconfig.lua_ls.setup {
on_attach = on_attach,
settings = { Lua = { diagnostics = { globals = {'vim'} } } },
}
lspconfig.nil_ls.setup { on_attach = on_attach }
local puppet_languageserver = vim.fn.expand("$HOME/.local/share/nvim/mason/packages/puppet-editor-services/libexec/puppet-languageserver")
lspconfig.puppet.setup {
on_attach = on_attach,
cmd = { puppet_languageserver }
}
lspconfig.ruff_lsp.setup { on_attach = on_attach }
end
}