vimcode-snippetsultisnips

E492: UltiSnips not an editor command


When I'm trying to use UltiSnips, it returns this error:

E492: Not an editor command: snippet test "Test Snippet"
E492: Not an editor command: Test
E492: Not an editor command: endsnippet

My .vimrc look like that: https://pastebin.com/0AwFks2J

What should I do to fix it?


Solution

  • There are two things.

    1. You put Plugin “SirVer/UltiSnips” and Plugin “honza/vim-snippets” outside of your call vundle#begin()...call vundle#end() block, you’ll need to move those in order for those plugins to be loaded.

    2. Snippets are not supposed to be defined in your vimrc. They are supposed to be defined in *.snippets files. By default, UltiSnips looks for an UltiSnips directory inside directories in your 'runtimepath'. You could create a ~/.vim/UltiSnips directory if it doesn’t exist and put your *.snippets flies there.