Wed, 22 Feb 2023 12:41:04 -0600
Add tag and omni, fix tab again
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", | |
1043
e55463fb35e2
Add tag and omni, fix tab again
Meredith Howard <mhoward@roomag.org>
parents:
1035
diff
changeset
|
28 | "hrsh7th/cmp-calc", |
1014 | 29 | "hrsh7th/cmp-nvim-lsp", |
30 | "hrsh7th/cmp-nvim-lsp-signature-help", | |
1019 | 31 | "hrsh7th/cmp-nvim-lua", |
1043
e55463fb35e2
Add tag and omni, fix tab again
Meredith Howard <mhoward@roomag.org>
parents:
1035
diff
changeset
|
32 | "hrsh7th/cmp-omni", |
e55463fb35e2
Add tag and omni, fix tab again
Meredith Howard <mhoward@roomag.org>
parents:
1035
diff
changeset
|
33 | "hrsh7th/cmp-path", |
e55463fb35e2
Add tag and omni, fix tab again
Meredith Howard <mhoward@roomag.org>
parents:
1035
diff
changeset
|
34 | "quangnguyen30192/cmp-nvim-tags", |
1014 | 35 | }, |
36 | opts = function() | |
37 | local cmp = require("cmp") | |
38 | return { | |
39 | completion = { | |
40 | completeopt = "menu,menuone,noinsert,noselect", | |
41 | }, | |
42 | mapping = cmp.mapping.preset.insert({ | |
43 | ["<C-b>"] = cmp.mapping.scroll_docs(-4), | |
44 | ["<C-f>"] = cmp.mapping.scroll_docs(4), | |
1043
e55463fb35e2
Add tag and omni, fix tab again
Meredith Howard <mhoward@roomag.org>
parents:
1035
diff
changeset
|
45 | ["<Tab>"] = cmp.mapping.select_next_item(), |
1014 | 46 | ["<S-Tab>"] = cmp.mapping.select_prev_item(), |
47 | ["<C-g>"] = cmp.mapping.abort(), | |
48 | ["<Right>"] = cmp.mapping.confirm({select = true}), | |
1033 | 49 | ["<Space>"] = function(fallback) |
50 | if cmp.visible() then | |
1035 | 51 | cmp.confirm({select = false}, function() |
52 | vim.api.nvim_feedkeys(" ", "n", false) | |
53 | end) | |
1033 | 54 | end |
55 | fallback() | |
56 | end, | |
1014 | 57 | }), |
1015 | 58 | sources = cmp.config.sources({ |
59 | { name = "nvim_lsp" }, | |
60 | { name = "nvim_lsp_signature_help" }, | |
1019 | 61 | { name = "nvim_lua" }, |
1033 | 62 | }, { |
1043
e55463fb35e2
Add tag and omni, fix tab again
Meredith Howard <mhoward@roomag.org>
parents:
1035
diff
changeset
|
63 | { name = "calc" }, |
1015 | 64 | { name = "buffer" }, |
65 | { name = "path" }, | |
1043
e55463fb35e2
Add tag and omni, fix tab again
Meredith Howard <mhoward@roomag.org>
parents:
1035
diff
changeset
|
66 | }, { |
e55463fb35e2
Add tag and omni, fix tab again
Meredith Howard <mhoward@roomag.org>
parents:
1035
diff
changeset
|
67 | { name = "tags" }, |
e55463fb35e2
Add tag and omni, fix tab again
Meredith Howard <mhoward@roomag.org>
parents:
1035
diff
changeset
|
68 | { name = "omni" }, |
1015 | 69 | }), |
1014 | 70 | } |
71 | end, | |
72 | }, | |
73 | } |