diff --git a/lua/core.lua b/lua/core.lua index 010a15e..ef3a5af 100644 --- a/lua/core.lua +++ b/lua/core.lua @@ -11,7 +11,7 @@ o.showmode = false o.scrolloff = 10 -- controlling -vim.opt.completeopt = { 'menu', 'menuone', 'noinsert' } +vim.opt.completeopt = { 'menu', 'menuone', 'noselect' } o.ignorecase = true o.smartcase = true o.smartindent = true diff --git a/lua/lazy-plugins.lua b/lua/lazy-plugins.lua index edb5ac0..bffaf7e 100644 --- a/lua/lazy-plugins.lua +++ b/lua/lazy-plugins.lua @@ -49,6 +49,7 @@ local plugins = { }, { "nvim-treesitter/nvim-treesitter-context", + event = {"BufReadPre", "BufNewFile"}, dependencies = { "nvim-treesitter/nvim-treesitter", }, @@ -93,27 +94,33 @@ local plugins = { }, { "hrsh7th/cmp-nvim-lsp", + event = { "BufReadPre", "BufNewFile" }, dependencies = { "neovim/nvim-lspconfig", - dependencies = { - { - "williamboman/mason-lspconfig.nvim", - dependencies = { - "williamboman/mason.nvim", - } - }, - "null-ls.nvim" + }, + lazy = true + }, + { + "neovim/nvim-lspconfig", + event = { "BufReadPre", "BufNewFile" }, + dependencies = { + { + "williamboman/mason-lspconfig.nvim", + dependencies = { + "williamboman/mason.nvim", + } }, - config = function() - require("plugins.lsp") - end, - } + }, + config = function() + require("plugins.lsp") + end, }, { "jay-babu/mason-null-ls.nvim", config = function() require("plugins.null-ls") end, + event = { "BufReadPre", "BufNewFile" }, dependencies = { "williamboman/mason.nvim", "jose-elias-alvarez/null-ls.nvim" diff --git a/lua/plugins/cmp.lua b/lua/plugins/cmp.lua index 1d35d37..4e591e2 100644 --- a/lua/plugins/cmp.lua +++ b/lua/plugins/cmp.lua @@ -67,9 +67,12 @@ cmp.setup({ cmp.setup.cmdline({ '/', '?' }, { mapping = cmp.mapping.preset.cmdline(), + completion = { + completeopt = 'menu,menuone,noselect' + }, sources = { { name = 'buffer' } - } + }, }) -- Set configuration for specific filetype. @@ -85,6 +88,9 @@ cmp.setup.filetype('gitcommit', { -- `:` cmdline setup. cmp.setup.cmdline(':', { mapping = cmp.mapping.preset.cmdline(), + completion = { + completeopt = 'menu,menuone,noselect' + }, sources = cmp.config.sources({ { name = 'path' } }, {