vimpluginsultisnipsvim-snipmate

Why if can expand instead of ifee in vim-snippets and ultisnips?


I have installed vim-snippets and ultisnips with plugin manager--pathogen this way.

cd ~/.vim/bundle
sudo git clone https://github.com/honza/vim-snippets.git
cd ~/.vim/bundle && git clone git://github.com/SirVer/ultisnips.git

Set configuration in .vimrc.

execute pathogen#infect()
execute pathogen#helptags()
syntax on
filetype plugin indent on
let g:UltiSnipsExpandTrigger="<tab>"
let g:UltiSnipsJumpForwardTrigger="<tab>"
let g:UltiSnipsJumpBackwardTrigger="<s-tab>"
let g:UltiSnipsSnippetDirectories=['/home/debian9/.vim/UltiSnips']

I list if ife ifee structure in my python.snippets.

cat .vim/bundle/vim-snippets/UltiSnips/python.snippets
snippet if "If" b
if ${1:condition}:
    ${2:${VISUAL:pass}}
endsnippet

snippet ife "If / Else" b
if ${1:condition}:
    ${2:${VISUAL:pass}}
else:
    ${3:pass}
endsnippet

snippet ifee "If / Elif / Else" b
if ${1:condition}:
    ${2:${VISUAL:pass}}
elif ${3:condition}:
    ${4:pass}
else:
    ${5:pass}
endsnippet

Now it is time to edit a test.py file with vim.

Input #! and press tab can expand into :

#!/usr/bin/env python3

Input if and press tab can expand into :

if condition:

Why Input ifee and press tab can expand into nothing in my vim?

enter image description here


Solution

  • The file .vim/bundle/vim-snippets/UltiSnips/python.snippets that you show is not included in the ultisnips directory you configured in your vimrc (/home/debian9/.vim/UltiSnips).

    You could try: