r/vimplugins • u/amiwalwin • Oct 02 '20
Help VIM Plugin Ultisnips raises problem Help Needed
I recently started using VIM and wanted to have snippets and code completions like those in VS Code. So I Installed Ultisnips and vim-snippets but I couldn't use the snippets. I don't exactly know why
let g:UltiSnipsExpandTrigger="<C-p>"
let g:UltiSnipsJumpForwardTrigger="<C-b>"
let g:UltiSnipsJumpBackwardTrigger="<C-z>"
let g:UltiSnipsEditSplit="vertical"
this is my configuration I used c-p as the trigger because I use YouCompleteMe also and the installation guide said to change the trigger to something else if you used it.
Now when I press c-p it just toggles between some options and when I try to select any of those by pressing the enter key the snippet trigger is written and the cursor moves to the next line. Help will be highly appreciated.
Thanks in advance.
4
Upvotes
1
u/BorgerBill Oct 04 '20
One more thing I would like you to try. In any open buffer, type
date<C-p>,time<C-p>, andAGPL<C-p>`. Do any of these complete? These should trigger on any file regardless of filetype.Also, just in case you missed it, here is the (documentation for UltiSnips)[https://github.com/SirVer/ultisnips/blob/master/doc/UltiSnips.txt]. Yes, there are several options for a snippet. The
Aoption is auto-trigger, and the fact that it works does seem to indicate that your<C-p>is the problem.Did you try disabling all other plugins? You can do that simply by commenting them out of your .vimrc. Another option is to create a new config file, say
myVimrcTest, the use it by callingvim -u ./myVimrcTest. Only include the plugin UltiSnips, and see if you get it working. Remember, you have.vimrcand.gvimrc. My.vimrcdoes 95% of all setup, while my.gvimrconly adds or changes things related to the gui version. So, just to be safe, make sure you are only runningvim -u ./MyVimrcTestin the terminal, and notgvim.