Mon, 13 Feb 2023 02:20:08 -0600
Ongoing nvim config
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) | |
9 | require("mason-lspconfig").setup_handlers({ | |
10 | function(server) | |
11 | require("lspconfig")[server].setup({}) | |
12 | end, | |
13 | }) | |
14 | end, | |
15 | }, | |
16 | ||
17 | { | |
18 | "hrsh7th/nvim-cmp", | |
19 | event = "InsertEnter", | |
20 | dependencies = { | |
21 | "hrsh7th/cmp-buffer", | |
22 | "hrsh7th/cmp-path", | |
23 | "hrsh7th/cmp-nvim-lsp", | |
24 | "hrsh7th/cmp-nvim-lsp-signature-help", | |
25 | }, | |
26 | opts = function() | |
27 | local cmp = require("cmp") | |
28 | return { | |
29 | completion = { | |
30 | completeopt = "menu,menuone,noinsert,noselect", | |
31 | }, | |
32 | mapping = cmp.mapping.preset.insert({ | |
33 | ["<C-b>"] = cmp.mapping.scroll_docs(-4), | |
34 | ["<C-f>"] = cmp.mapping.scroll_docs(4), | |
35 | ["<Tab>"] = cmp.mapping.select_next_item(), | |
36 | ["<S-Tab>"] = cmp.mapping.select_prev_item(), | |
37 | ["<C-g>"] = cmp.mapping.abort(), | |
1015 | 38 | -- FIXME: add extra space after in select case? |
1014 | 39 | ["<Space>"] = cmp.mapping.confirm({select = false}), |
40 | ["<Right>"] = cmp.mapping.confirm({select = true}), | |
41 | }), | |
1015 | 42 | sources = cmp.config.sources({ |
43 | { name = "nvim_lsp" }, | |
44 | { name = "nvim_lsp_signature_help" }, | |
45 | { name = "buffer" }, | |
46 | { name = "path" }, | |
47 | }), | |
48 | experimental = { | |
49 | ghost_text = { | |
50 | hl_group = "LspCodeLens", | |
51 | }, | |
52 | }, | |
1014 | 53 | } |
54 | end, | |
55 | }, | |
56 | } |