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', 'Telescope lsp_definitions', opts) vim.keymap.set('n', 'gi', 'Telescope lsp_implementations', opts) vim.keymap.set('n', 'gr', 'Telescope lsp_references', opts) vim.keymap.set('n', '', 'LspRestart', 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 = { [''] = cmp.mapping.confirm({select = false}), [''] = cmp_action.luasnip_jump_forward(), [''] = cmp_action.luasnip_jump_backward(), [''] = cmp_action.luasnip_supertab(), [''] = cmp_action.luasnip_shift_supertab(), }, })