0

I have the following vimrc:

if empty(glob('~/.vim/autoload/plug.vim'))
    silent !curl -fLo ~/.vim/autoload/plug.vim --create-dirs
        \ https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
    autocmd VimEnter * PlugInstall --sync | source $MYVIMRC
endif
call plug#begin('~/.vim/plugged')
Plug 'SirVer/ultisnips' | Plug 'honza/vim-snippets'
call plug#end()

let g:UltiSnipsExpandTrigger = '<C-j>'
let g:UltiSnipsJumpForwardTrigger = '<C-j>'
let g:UltiSnipsJumpBackwardTrigger = '<C-k>'

The settings of <C-j> for expansion and jumping forward and <C-k> for backward jump is consistent with official documentation https://github.com/SirVer/ultisnips/blob/master/doc/UltiSnips.txt

When the above vimrc is sourced from within a file, while the output of :verbose map <C-j> reveals that the settings has been read in from the vimrc.

The output of :verbose map <C-k>, however, is No mapping found.

This is confusing--why would only <C-j> be recorded but not <C-k>?

:echo g:UltiSnipsJumpForwardTrigger provides output <C-j>, and,

:echo g:UltiSnipsJumpBackwardTrigger provides output <C-k> indicating that these settings were read in from the vimrc and yet :verbose map <C-k> does not provide expected output. Animated gif of the various tests provided here: https://i.stack.imgur.com/vW747.jpg and reproduced below.

enter image description here

Tryer
  • 3,580
  • 1
  • 26
  • 49
  • If `:echo g:UltiSnipsJumpBackwardTrigger` prints `` then it means things work normally on Vim's end. Use the plugin's issue tracker. – romainl Oct 19 '22 at 16:46
  • @romainl Yes, I have opened an issue with the plugin page. Confusing, to say the least, that verbose map treats both these settings differently even though they are exactly similar in all other respects. – Tryer Oct 20 '22 at 02:17
  • 1
    What `:verbose map` does is orthogonal to what defining those variables does, which is entirely the plugin's responsibility. It shows mappings for the first variable because the plugin created those mappings and it doesn't for the second variable because the plugin didn't. Why it happens is a question for the plugin's issue tracker. – romainl Oct 20 '22 at 05:23
  • @romainl It is tidbits internals like this that help clarify in the (novice) user's (like I am) mind the otherwise confusing and frustrating way of learning VIM. Thank you! – Tryer Oct 20 '22 at 06:12
  • The right way to learn Vim is to follow its user manual. – romainl Oct 20 '22 at 07:54

0 Answers0