diff options
Diffstat (limited to 'home-manager/neovim/lsp-zero-nvim.lua')
-rw-r--r-- | home-manager/neovim/lsp-zero-nvim.lua | 66 |
1 files changed, 0 insertions, 66 deletions
diff --git a/home-manager/neovim/lsp-zero-nvim.lua b/home-manager/neovim/lsp-zero-nvim.lua deleted file mode 100644 index 2abd191..0000000 --- a/home-manager/neovim/lsp-zero-nvim.lua +++ /dev/null @@ -1,66 +0,0 @@ -local lsp = require('lsp-zero').preset({ - manage_nvim_cmp = { - set_sources = 'recommended', - } -}) - -lsp.on_attach(function(client, bufnr) - local opts = {buffer = bufnr} - - lsp.default_keymaps(opts) - - vim.keymap.set('n', 'gd', '<cmd>Telescope lsp_definitions<cr>', opts) - vim.keymap.set('n', 'gi', '<cmd>Telescope lsp_implementations<cr>', opts) - vim.keymap.set('n', 'gr', '<cmd>Telescope lsp_references<cr>', opts) - vim.keymap.set('n', '<F5>', '<cmd>LspRestart<cr>', opts) -end) - --- When you don't have mason.nvim installed --- You'll need to list the servers installed in your system -lsp.setup_servers({'nixd', 'pyright', 'phpactor', 'gopls', 'lua_ls', 'ansiblels'}) - --- (Optional) Configure lua language server for neovim -local lspconfig = require('lspconfig') -lspconfig.lua_ls.setup { - settings = { - Lua = { - runtime = { - -- Tell the language server which version of Lua you're using (most likely LuaJIT in the case of Neovim) - version = 'LuaJIT', - }, - diagnostics = { - -- Get the language server to recognize the `vim` global - globals = {'vim'}, - }, - workspace = { - -- Make the server aware of Neovim runtime files - library = vim.api.nvim_get_runtime_file("", true), - checkThirdParty = false, - }, - -- Do not send telemetry data containing a randomized but unique identifier - telemetry = { - enable = false, - }, - }, - }, -} - -lsp.setup() - -local cmp = require('cmp') -local cmp_action = require('lsp-zero').cmp_action() - -cmp.setup({ - sources = { - {name = 'nvim_lsp'}, - {name = 'nvim_lua'}, - }, - mapping = { - ['<CR>'] = cmp.mapping.confirm({select = false}), - ['<C-f>'] = cmp_action.luasnip_jump_forward(), - ['<C-b>'] = cmp_action.luasnip_jump_backward(), - ['<Tab>'] = cmp_action.luasnip_supertab(), - ['<S-Tab>'] = cmp_action.luasnip_shift_supertab(), - }, -}) - |