SirVer / ultisnips

UltiSnips - The ultimate snippet solution for Vim. Send pull requests to SirVer/ultisnips!
GNU General Public License v3.0
7.54k stars 693 forks source link

Verbose map of <C-j> and <C-k> according to documented settings does not work as expected #1497

Open TryerGit opened 2 years ago

TryerGit commented 2 years ago

Expected behavior:

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>'

This is similar to what is specified in the official documentation here: https://github.com/SirVer/ultisnips/blob/master/doc/UltiSnips.txt

Once I load this vimrc and open a .tex file, I issue the following commands:

:verbose map <C-j>

I expect this to specify that is mapped to trigger expansion and trigger forward jump.

Likewise, I expect :verbose map <C-k> to indicate that is mapped to trigger backward jump.

Actual behavior: While :verbose map <C-j> provides expected output that indicates that it has read in the vimrc, :verbose map <C-k> returns that no mapping has been found.

Steps to reproduce

  1. The entire vimrc and sequence of steps has been provided above.
  2. In addition, here is an animated gif that shows the steps I followed and it should be easy to reproduce: https://imgur.com/qkHau09

    • Operating System: WSL Ubuntu 20.04 on Windows
    • Vim Version: VIM - Vi IMproved 8.1 (2018 May 18, compiled Apr 15 2020 06:40:31) Included patches: 1-2269
    • UltiSnips Version: 53e1921e3ef015ef658e540c0aa9c4835f9c18a6
    • Python inside Vim: 9,78 All3.8.10 (default, Jun 2 2021, 10:49:15) [GCC 9.4.0]
    • Docker repo/vimrc: vimrc provided above
BertrandSim commented 1 year ago

These mappings are autoloaded, that is, the mappings are only created after UltiSnips has been loaded. Try expanding a snippet first before inspecting :verbose imap <c-j>.