Steps to reproduce
first vimrc -- it uses Deoplete and actually misses few lines from the default config suggestions (like mapping <tab> to expand key), one might simply add few these lines, but it works even without those.
second vimrc -- this one doesn't have Deoplete at all, like described below.
nvim file.cppans<tab>My ~/.vim/UltiSnips/cpp.snippets content is:
snippet ans "anonymous namespace"
namespace {
${VISUAL}$0
} // namespace
endsnippet
Hence, I expect the macro to expand. In fact, nothing happens.
vim file.cpp and do the same: ans<tab> -> The snippet expands!Okay, that's weird. I first blamed it on Deoplete, but in fact even completely removing Deoplete and everything related and/or remapping snippet expansion key to e.g. <Up> or anything else does not change anything.
honza/vim-snippets. After that, the expansion works (using the same <tab> key, i.e. the only change from the config I posted is basically installed honza/vim-snippets). Not only the snippets brought by the plugin work, but my snippets (e.g. ans) work aswell.All in all, I would very much like to have UltiSnips working without having to install honza/vim-snippets, because I don't really need it and I like calling my snippets using similar or same names.
3.6.4 (default, Jan 5 2018, 02:35:40)
[GCC 7.2.1 20171224]
Neovim is currently not supported. However I'm using neovim with ultisnips, and it works for me without vim-snippets. I'm not seeing configured path to search snippets in your vimrc files. You saying that your snippet located in ~/.vim/UltiSnips/cpp.snippets. Try to add let g:UltiSnipsSnippetDirectories=[$HOME.'/.vim/UltiSnips'] to your vimrc, and try again.
Have you've done this? https://neovim.io/doc/user/nvim.html#nvim-from-vim. my guess is your Snippets are not found because they are not on the search path for NeoVim. Closing as this is quite definitley a neovim config issue, not an UltiSnips issue.
Hi, I had the same problem, and tried @andreyorst then fixed. Thanks!
If you only use your own snippets, the answer by @andreyorst may be ok. But if you also use vim-snippets, you will find that a lot of snippets becomes inactive.
For example, if you create a markdown.snippets under that directory and add the following snippet:
snippet kbd "keyboard tag"
<kbd>${1:KEY}</kbd>$0
endsnippet
Open a markdown file and the kbd snippet is available. But many snippets provided here for markdown file by vim-snippets are invalid now.
If this is not what you want, you may consider the answer here.
Most helpful comment
Neovim is currently not supported. However I'm using neovim with ultisnips, and it works for me without vim-snippets. I'm not seeing configured path to search snippets in your vimrc files. You saying that your snippet located in
~/.vim/UltiSnips/cpp.snippets. Try to addlet g:UltiSnipsSnippetDirectories=[$HOME.'/.vim/UltiSnips']to your vimrc, and try again.