1
0
mirror of https://github.com/jdhao/nvim-config.git synced 2025-06-08 14:14:33 +02:00

update cmp lazy load condition

If we use InsertEnter, cmp may not be activated the first time we go to
insert mode. I have to go to insert mode a second time to activate
auto-completion, which is annoying.
This commit is contained in:
jdhao 2021-10-19 01:14:21 +08:00
parent 7750a43e55
commit 498dcaef94

View File

@ -26,14 +26,15 @@ require("packer").startup({
function(use)
use({"wbthomason/packer.nvim", opt = true})
-- nvim-lsp configuration
use({ "neovim/nvim-lspconfig", after = "cmp-nvim-lsp", config = [[require('config.lsp')]] })
-- auto-completion engine
use {"hrsh7th/nvim-cmp", event = "InsertEnter", config = [[require('config.nvim-cmp')]]}
use {"hrsh7th/nvim-cmp", event = "BufEnter", config = [[require('config.nvim-cmp')]]}
-- nvim-cmp completion sources
use {"hrsh7th/cmp-nvim-lsp", event = "VimEnter"}
use {"hrsh7th/cmp-nvim-lsp", after = "nvim-cmp"}
-- nvim-lsp configuration (it relies on cmp-nvim-lsp, so it should be loaded after cmp-nvim-lsp).
use({ "neovim/nvim-lspconfig", after = "cmp-nvim-lsp", config = [[require('config.lsp')]] })
use {"hrsh7th/cmp-path", after = "nvim-cmp"}
use {"quangnguyen30192/cmp-nvim-ultisnips", after = {'nvim-cmp', 'ultisnips'}}
use {"hrsh7th/cmp-emoji", after = 'nvim-cmp'}