diff options
-rw-r--r-- | .config/nvim/lua/plugins/cmp.lua | 18 | ||||
-rw-r--r-- | .config/nvim/lua/plugins/lsp.lua | 8 |
2 files changed, 18 insertions, 8 deletions
diff --git a/.config/nvim/lua/plugins/cmp.lua b/.config/nvim/lua/plugins/cmp.lua index 2e8fade..677544c 100644 --- a/.config/nvim/lua/plugins/cmp.lua +++ b/.config/nvim/lua/plugins/cmp.lua | |||
@@ -11,6 +11,13 @@ return { | |||
11 | "L3MON4D3/LuaSnip", | 11 | "L3MON4D3/LuaSnip", |
12 | "saadparwaiz1/cmp_luasnip", | 12 | "saadparwaiz1/cmp_luasnip", |
13 | }, | 13 | }, |
14 | opts = function(_, opts) | ||
15 | opts.sources = opts.sources or {} | ||
16 | table.insert(opts.sources, { | ||
17 | name = "lazydev", | ||
18 | group_index = 0, -- set group index to 0 to skip loading LuaLS completions | ||
19 | }) | ||
20 | end, | ||
14 | config = function() | 21 | config = function() |
15 | local cmp = require("cmp") | 22 | local cmp = require("cmp") |
16 | local luasnip = require("luasnip") | 23 | local luasnip = require("luasnip") |
@@ -142,7 +149,7 @@ return { | |||
142 | }, | 149 | }, |
143 | { | 150 | { |
144 | 'mireq/luasnip-snippets', | 151 | 'mireq/luasnip-snippets', |
145 | dependencies = {'L3MON4D3/LuaSnip'}, | 152 | dependencies = { 'L3MON4D3/LuaSnip' }, |
146 | init = function() | 153 | init = function() |
147 | require('luasnip_snippets.common.snip_utils').setup() | 154 | require('luasnip_snippets.common.snip_utils').setup() |
148 | end | 155 | end |
@@ -172,9 +179,12 @@ return { | |||
172 | -- store_selection_keys = '<c-x>', | 179 | -- store_selection_keys = '<c-x>', |
173 | }) | 180 | }) |
174 | -- LuaSnip key bindings | 181 | -- LuaSnip key bindings |
175 | vim.keymap.set({"i", "s"}, "<C-l>", function() if ls.expand_or_jumpable() then ls.expand_or_jump() else vim.api.nvim_input('<C-l>') end end, {silent = true}) | 182 | vim.keymap.set({ "i", "s" }, "<C-l>", |
176 | vim.keymap.set({"i", "s"}, "<C-k>", function() ls.jump(-1) end, {silent = true}) | 183 | function() if ls.expand_or_jumpable() then ls.expand_or_jump() else vim.api.nvim_input('<C-l>') end end, |
177 | vim.keymap.set({"i", "s"}, "<C-E>", function() if ls.choice_active() then ls.change_choice(1) end end, {silent = true}) | 184 | { silent = true }) |
185 | vim.keymap.set({ "i", "s" }, "<C-k>", function() ls.jump(-1) end, { silent = true }) | ||
186 | vim.keymap.set({ "i", "s" }, "<C-E>", function() if ls.choice_active() then ls.change_choice(1) end end, | ||
187 | { silent = true }) | ||
178 | end | 188 | end |
179 | 189 | ||
180 | }, | 190 | }, |
diff --git a/.config/nvim/lua/plugins/lsp.lua b/.config/nvim/lua/plugins/lsp.lua index 029a0f1..a6d2f64 100644 --- a/.config/nvim/lua/plugins/lsp.lua +++ b/.config/nvim/lua/plugins/lsp.lua | |||
@@ -3,7 +3,6 @@ return { | |||
3 | "neovim/nvim-lspconfig", | 3 | "neovim/nvim-lspconfig", |
4 | dependencies = { | 4 | dependencies = { |
5 | "j-hui/fidget.nvim", | 5 | "j-hui/fidget.nvim", |
6 | "folke/neodev.nvim", | ||
7 | "RRethy/vim-illuminate", | 6 | "RRethy/vim-illuminate", |
8 | "hrsh7th/cmp-nvim-lsp", | 7 | "hrsh7th/cmp-nvim-lsp", |
9 | }, | 8 | }, |
@@ -14,9 +13,6 @@ return { | |||
14 | map('n', '[d', vim.diagnostic.goto_prev, "lsp: goto previous diagnostic") | 13 | map('n', '[d', vim.diagnostic.goto_prev, "lsp: goto previous diagnostic") |
15 | map('n', ']d', vim.diagnostic.goto_next, "lsp: goto next diagnostic") | 14 | map('n', ']d', vim.diagnostic.goto_next, "lsp: goto next diagnostic") |
16 | 15 | ||
17 | -- neodev setup before lsp config | ||
18 | require("neodev").setup() | ||
19 | |||
20 | -- set up cool signs for diagnostics | 16 | -- set up cool signs for diagnostics |
21 | local signs = { Error = " ", Warn = "", Hint = "", Info = "" } | 17 | local signs = { Error = " ", Warn = "", Hint = "", Info = "" } |
22 | for type, icon in pairs(signs) do | 18 | for type, icon in pairs(signs) do |
@@ -202,4 +198,8 @@ return { | |||
202 | "simrat39/rust-tools.nvim", | 198 | "simrat39/rust-tools.nvim", |
203 | event = "LspAttach", | 199 | event = "LspAttach", |
204 | }, | 200 | }, |
201 | { | ||
202 | "folke/lazydev.nvim", | ||
203 | ft = "lua", -- only load on lua files | ||
204 | }, | ||
205 | } | 205 | } |