diff options
| author | jdhao <jdhao@hotmail.com> | 2021-10-19 01:14:21 +0800 |
|---|---|---|
| committer | jdhao <jdhao@hotmail.com> | 2021-10-19 01:14:21 +0800 |
| commit | 498dcaef944ce235ebff08c5259f3b2e393eab1f (patch) | |
| tree | 32a35566fcab7c0d8c3bfe1dce3d31e1ad08ffed /lua | |
| parent | 7750a43e55527461822b1538a9342c49d8270e03 (diff) | |
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.
Diffstat (limited to 'lua')
| -rw-r--r-- | lua/plugins.lua | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/lua/plugins.lua b/lua/plugins.lua index b646632..b4e3517 100644 --- a/lua/plugins.lua +++ b/lua/plugins.lua @@ -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'} |
