From ac4bb6c162d708d407f2769f8188bf1b5a19a681 Mon Sep 17 00:00:00 2001 From: jdhao Date: Sun, 8 Aug 2021 21:27:54 +0800 Subject: [PATCH] Change ultisnips load condition Benefit of doing this: + No change of cursor line position after entering insert mode. Previous, if we load ultisnips on InsertEnter, the cursor line will moved automatically (e.g., if cursor line is on bottom of the screen, when we enter insert mode, now we are at the middle of the screen, like Ctrl-E is used before entering insert mode), which is really annoying! + We can see the snippets in nvim-compe auto-completion menu. Previously, the snippets are not shown on the nvim-compe completion menu (snippet expansion works though, it is just we can not see snippets in the completion menu), possibly due to the loading order of ultisnips and nvim-compe, because we load them both on event InsertEnter. After changing ultisnips to a start plugin, this issue is gone. --- lua/plugins.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/plugins.lua b/lua/plugins.lua index f602883..315bff0 100644 --- a/lua/plugins.lua +++ b/lua/plugins.lua @@ -126,7 +126,7 @@ require('packer').startup( end -- Snippet engine and snippet template - use {'SirVer/ultisnips', event = {'InsertEnter'}} + use 'SirVer/ultisnips' use {'honza/vim-snippets', event = {'InsertEnter'}} -- Automatic insertion and deletion of a pair of characters