-- Plugins -- LSP stuff local lsp_zero = require('lsp-zero') lsp_zero.on_attach(function(client, bufnr) lsp_zero.default_keymaps({buffer = bufnr}) end) require('lspconfig').gopls.setup({ settings = { gopls = { analyses = { unusedparams = true, }, staticcheck = true, gofumpt = true, } } }) -- Cmp local cmp = require('cmp') local cmp_action = lsp_zero.cmp_action() cmp.setup({ mapping = cmp.mapping.preset.insert({ -- Enter to confirm completion [''] = cmp.mapping.confirm({select = false}), -- Ctrl+Space to open completion menu [''] = cmp.mapping.complete(), -- Move between snippet placeholders [''] = cmp_action.luasnip_jump_forward(), [''] = cmp_action.luasnip_jump_backward(), -- Scroll in completion docs [''] = cmp.mapping.scroll_docs(-4), [''] = cmp.mapping.scroll_docs(4), }) }) -- Telescope require('telescope').setup({ extensions = { fzf = { fuzzy = true, override_generic_sorter = true, override_file_sorter = true, case_mode = "smart_case", } }, })