ultisnips
ultisnips copied to clipboard
Setting key as expand trigger overrides previous mapping of that key
I use <c-j>
as my expand trigger. But if there is no snippet to expand, I want <c-j>
to do nothing, so I have added a line,
imap <c-j> <nop>
to my init.vim. But once I set <c-j>
as my expand trigger, this mapping gets overwritten.
Expected behavior:
<c-j>
does nothing if there is no snippet to expand
Actual behavior:
<c-j>
does what it does by default, inserts a newline I think.
Steps to reproduce I have this in my init.vim:
let g:plugged_home = '~/.vim/plugged'
imap <c-j> <nop>
et g:UltiSnipsExpandTrigger = '<c-j>'
let g:UltiSnipsJumpForwardTrigger = '<c-j>'
call plug#begin(g:plugged_home)
Plug 'sirver/ultisnips'
call plug#end()
- Operating System: Ubuntu 20.04.4
- Vim Version: NVIM v0.4.3 Build type: Release
- UltiSnips Version: 3.1
- Python inside Vim: 3.8.10
- Docker repo/vimrc: https://github.com/SirVer/ultisnips/pull/1447