local lsp = require("lsp-zero") lsp.preset("recommended") lsp.ensure_installed({ 'tsserver', 'eslint', 'sumneko_lua', 'rust_analyzer', 'pylsp', 'nimls', 'bashls', 'jsonls', }) local cmp = require('cmp') local cmp_select = {behavior = cmp.SelectBehavior.Select} local cmp_mappings = lsp.defaults.cmp_mappings({ [''] = cmp.mapping.select_prev_item(cmp_select), [''] = cmp.mapping.select_next_item(cmp_select), [''] = cmp.mapping.confirm({select =true}), [''] = cmp.mapping.complete(), }) lsp.set_preferences({ sign_icons = {} }) lsp.on_attach(function(client, bufnr) local opts = {buffer = bufnr, remap = false} vim.keymap.set("n", "K", function() vim.lsp.buf.hover() end, opts) vim.keymap.set("n", "gd", function() vim.lsp.buf.definition() end, opts) vim.keymap.set("n", "gt", function() vim.lsp.buf.type_definition() end, opts) vim.keymap.set("n", "gi", function() vim.lsp.buf.implementation() end, opts) vim.keymap.set("n", "r", function() vim.lsp.buf.rename() end, opts) end) lsp.setup()