From 8e18eb89945ff7fb0253a34c340d389ec0c8492c Mon Sep 17 00:00:00 2001 From: Yigit Sever Date: Sun, 9 Jun 2024 03:55:24 +0300 Subject: nvim: replave neodev with lazydev --- .config/nvim/lua/plugins/cmp.lua | 18 ++++++++++++++---- .config/nvim/lua/plugins/lsp.lua | 8 ++++---- 2 files changed, 18 insertions(+), 8 deletions(-) (limited to '.config/nvim/lua') 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 { "L3MON4D3/LuaSnip", "saadparwaiz1/cmp_luasnip", }, + opts = function(_, opts) + opts.sources = opts.sources or {} + table.insert(opts.sources, { + name = "lazydev", + group_index = 0, -- set group index to 0 to skip loading LuaLS completions + }) + end, config = function() local cmp = require("cmp") local luasnip = require("luasnip") @@ -142,7 +149,7 @@ return { }, { 'mireq/luasnip-snippets', - dependencies = {'L3MON4D3/LuaSnip'}, + dependencies = { 'L3MON4D3/LuaSnip' }, init = function() require('luasnip_snippets.common.snip_utils').setup() end @@ -172,9 +179,12 @@ return { -- store_selection_keys = '', }) -- LuaSnip key bindings - vim.keymap.set({"i", "s"}, "", function() if ls.expand_or_jumpable() then ls.expand_or_jump() else vim.api.nvim_input('') end end, {silent = true}) - vim.keymap.set({"i", "s"}, "", function() ls.jump(-1) end, {silent = true}) - vim.keymap.set({"i", "s"}, "", function() if ls.choice_active() then ls.change_choice(1) end end, {silent = true}) + vim.keymap.set({ "i", "s" }, "", + function() if ls.expand_or_jumpable() then ls.expand_or_jump() else vim.api.nvim_input('') end end, + { silent = true }) + vim.keymap.set({ "i", "s" }, "", function() ls.jump(-1) end, { silent = true }) + vim.keymap.set({ "i", "s" }, "", function() if ls.choice_active() then ls.change_choice(1) end end, + { silent = true }) end }, 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 { "neovim/nvim-lspconfig", dependencies = { "j-hui/fidget.nvim", - "folke/neodev.nvim", "RRethy/vim-illuminate", "hrsh7th/cmp-nvim-lsp", }, @@ -14,9 +13,6 @@ return { map('n', '[d', vim.diagnostic.goto_prev, "lsp: goto previous diagnostic") map('n', ']d', vim.diagnostic.goto_next, "lsp: goto next diagnostic") - -- neodev setup before lsp config - require("neodev").setup() - -- set up cool signs for diagnostics local signs = { Error = " ", Warn = "", Hint = "", Info = "" } for type, icon in pairs(signs) do @@ -202,4 +198,8 @@ return { "simrat39/rust-tools.nvim", event = "LspAttach", }, + { + "folke/lazydev.nvim", + ft = "lua", -- only load on lua files + }, } -- cgit v1.2.3-70-g09d2