Wed, 22 Feb 2023 12:40:24 -0600
add goneovim settings
1014 | 1 | return { |
2 | "neovim/nvim-lspconfig", | |
3 | {"williamboman/mason.nvim", config = true}, | |
4 | {"j-hui/fidget.nvim", config = true}, | |
5 | ||
6 | { | |
7 | "williamboman/mason-lspconfig.nvim", | |
8 | config = function(plugin, opts) | |
1019 | 9 | require("mason-lspconfig").setup() |
1014 | 10 | require("mason-lspconfig").setup_handlers({ |
11 | function(server) | |
12 | require("lspconfig")[server].setup({}) | |
13 | end, | |
1022 | 14 | gopls = function () |
15 | require("lspconfig").gopls.setup({ | |
16 | settings = { gopls = { gofumpt = true } } | |
17 | }) | |
18 | end | |
1014 | 19 | }) |
20 | end, | |
21 | }, | |
22 | ||
23 | { | |
24 | "hrsh7th/nvim-cmp", | |
25 | event = "InsertEnter", | |
26 | dependencies = { | |
27 | "hrsh7th/cmp-buffer", | |
28 | "hrsh7th/cmp-path", | |
29 | "hrsh7th/cmp-nvim-lsp", | |
30 | "hrsh7th/cmp-nvim-lsp-signature-help", | |
1019 | 31 | "hrsh7th/cmp-nvim-lua", |
1014 | 32 | }, |
33 | opts = function() | |
34 | local cmp = require("cmp") | |
35 | return { | |
36 | completion = { | |
37 | completeopt = "menu,menuone,noinsert,noselect", | |
38 | }, | |
39 | mapping = cmp.mapping.preset.insert({ | |
40 | ["<C-b>"] = cmp.mapping.scroll_docs(-4), | |
41 | ["<C-f>"] = cmp.mapping.scroll_docs(4), | |
1033 | 42 | ["<Tab>"] = function(fallback) |
43 | if cmp.visible() then | |
44 | cmp.select_next_item() | |
45 | else | |
46 | cmp.complete() | |
47 | end | |
48 | end, | |
1014 | 49 | ["<S-Tab>"] = cmp.mapping.select_prev_item(), |
50 | ["<C-g>"] = cmp.mapping.abort(), | |
51 | ["<Right>"] = cmp.mapping.confirm({select = true}), | |
1033 | 52 | ["<Space>"] = function(fallback) |
53 | if cmp.visible() then | |
1035 | 54 | cmp.confirm({select = false}, function() |
55 | vim.api.nvim_feedkeys(" ", "n", false) | |
56 | end) | |
1033 | 57 | end |
58 | fallback() | |
59 | end, | |
1014 | 60 | }), |
1015 | 61 | sources = cmp.config.sources({ |
62 | { name = "nvim_lsp" }, | |
63 | { name = "nvim_lsp_signature_help" }, | |
1019 | 64 | { name = "nvim_lua" }, |
1033 | 65 | }, { |
1015 | 66 | { name = "buffer" }, |
67 | { name = "path" }, | |
68 | }), | |
69 | experimental = { | |
70 | ghost_text = { | |
71 | hl_group = "LspCodeLens", | |
72 | }, | |
73 | }, | |
1014 | 74 | } |
75 | end, | |
76 | }, | |
77 | } |