diff options
| author | JP Appel <jeanpierre.appel01@gmail.com> | 2024-08-16 16:28:22 -0400 |
|---|---|---|
| committer | JP Appel <jeanpierre.appel01@gmail.com> | 2024-08-16 16:28:22 -0400 |
| commit | e184d7cee358abc277a51f040cacf236f1eaceab (patch) | |
| tree | bfc7ced143a04d6d79f955ca7c37b962a01773f3 /nvim/lua/plugins/lsp.lua | |
| parent | d3230ab29e56f97966f05cf2232a2e92d6a1302f (diff) | |
removed lspzero, updated keymaps
Diffstat (limited to 'nvim/lua/plugins/lsp.lua')
| -rw-r--r-- | nvim/lua/plugins/lsp.lua | 87 |
1 files changed, 87 insertions, 0 deletions
diff --git a/nvim/lua/plugins/lsp.lua b/nvim/lua/plugins/lsp.lua new file mode 100644 index 0000000..0089033 --- /dev/null +++ b/nvim/lua/plugins/lsp.lua @@ -0,0 +1,87 @@ +local lspconfig = { + 'neovim/nvim-lspconfig', + lazy = false, + dependencies = { + 'williamboman/mason.nvim', + 'williamboman/mason-lspconfig' + }, + keys = { + { + 'gd', + function() + vim.lsp.buf.definition() + end, + mode = 'n', + desc = "Go to definition" + }, + { + '<leader>r', + function () + vim.lsp.buf.rename() + end, + mode = 'n', + desc = "Rename symbol" + }, + { + '<leader>la', + function () + vim.lsp.buf.code_action() + end, + mode = {'n', 's'}, + desc = "Show code actions" + }, + { + '<leader>lr', + function () + vim.lsp.buf.references() + end, + mode = 'n', + desc = "Add symbol references to qf" + }, + { + '<C-h>', + function () + vim.lsp.buf.signature_help() + end, + mode = 'i', + desc = "Show signature help" + } + } +} + +local mason = { + 'williamboman/mason.nvim', + opts = {} +} + +local mason_lspconfig = { + 'williamboman/mason-lspconfig.nvim', + dependencies = { + 'williamboman/mason.nvim', + }, + opts = { + handlers = { + function(server_name) + require('lspconfig')[server_name].setup({}) + end + }, + ["lua_ls"] = function () + require('lspconfig').lua_ls.setup({ + settings = { + Lua = { + diagnostics = { + globals = { "vim" } + } + } + } + }) + end + } +} + + +return { + mason, + mason_lspconfig, + lspconfig, +} |
