🐛 Use lazy loading and fix completeopt in cmdline

This commit is contained in:
Ryan 2023-11-11 17:11:57 +08:00
parent 68f4a6595e
commit 49081f4dfb
Signed by: juan
GPG Key ID: 807ECD28A698D245
3 changed files with 27 additions and 14 deletions

View File

@ -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

View File

@ -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"

View File

@ -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' }
}, {