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