1

I recently installed the ultisnips plugin on neovim, and I'm having an issue with it:

When I enable ultisnips, when I press < in visual mode, there's a delay until my lines are left-shifted, but my right-shifting using > works instantly.

If I run :verbose map <, I see the following

x  <nop>       * :call UltiSnips#SaveLastVisualSelection()<CR>gvs
        Last set from ~/.vim/plugged/ultisnips/autoload/UltiSnips/map_keys.vim line 64
s  <nop>       * <Esc>:call UltiSnips#ExpandSnippet()<CR>
        Last set from ~/.vim/plugged/ultisnips/autoload/UltiSnips/map_keys.vim line 62

And from what I see, the bindings are coming from the snippet files and they're not my mapping, so I was wondering if there's any way for me fix the issue.

Thank you

4

1 回答 1

1

你已经设置了g:UltiSnipExpandTrigger="<nop>"

第 62 行ultisnips/blob/master/autoload/UltiSnips/map_keys.vim

exec "snoremap <silent> " . g:UltiSnipsExpandTrigger . " <Esc>:call UltiSnips#ExpandTrigger()<cr>"

您可以看到,这实际上并没有禁用g:UltiSnipExpandTrigger. 相反,它将文字键映射<nop><Esc>:call UltiSnips#ExpandTrigger()<cr>.

一旦你输入,Vim 就会等待你<是否会按下nop>。等待一段时间后,它才会将您的选择向左移动(多长时间取决于 的值'timeoutlen')。

您需要做的是设置g:UltiSnipExpandTrigger不同的键。如果要禁用它,可以将其映射到 13 到 19 之间的功能键(您的键盘上可能没有它):

let g:UltiSnipExpandTrigger = "<F13>"
于 2020-09-21T19:46:48.790 回答