diff options
Diffstat (limited to '.config/nvim/lua/plugins/lsp.lua')
| -rw-r--r-- | .config/nvim/lua/plugins/lsp.lua | 62 |
1 files changed, 0 insertions, 62 deletions
diff --git a/.config/nvim/lua/plugins/lsp.lua b/.config/nvim/lua/plugins/lsp.lua deleted file mode 100644 index 0314c42..0000000 --- a/.config/nvim/lua/plugins/lsp.lua +++ /dev/null @@ -1,62 +0,0 @@ --- Language server for specified languages --- Hover with 'K' --- Goto definition with :Goto --- Open code action with :Codeact - -local servers = { - "lua_ls", "bashls", "clangd", "marksman", "pyright", "lemminx", -} - -return { - { - "williamboman/mason.nvim", - config = function() - require("mason").setup() - end - }, - - { - "williamboman/mason-lspconfig.nvim", - config = function() - require("mason-lspconfig").setup { - ensure_installed = servers, - automatic_installation = true, - } - end - }, - - { - "neovim/nvim-lspconfig", - config = function() - -- Advertise autocompletion to lsp - local capabilities = require('cmp_nvim_lsp').default_capabilities() - for _, server in ipairs(servers) do - vim.lsp.config(server, { - capabilities = capabilities, - }) - end - - -- Key mapping - -- Hover for definition - vim.keymap.set('n', 'K', vim.lsp.buf.hover, {}) - - -- Move to definition - vim.api.nvim_create_user_command( - "Goto", - function() - vim.lsp.buf.definition() - end, - {} - ) - - -- Code action - vim.api.nvim_create_user_command( - "Codeact", - function() - vim.lsp.buf.code_action() - end, - {} - ) - end - } -} |
