0

I'm using spf13-vim in Fedora. When I try to use a snippet, I get options that pop up but when I don't know how to actually insert the snippet. For example, if I type for in a .cpp file, I get four options. I'm assuming I'm supposed to either hit tab or enter to insert them but neither works. I'm not even sure which vim plugin it is that the snippets come from (snipmate? neocomplcache?).Screenshot. The same problem happens in vim and gvim.

2 Answers 2

4

You can read about neocomplcache in :h neocomplcache.

You commited one big mistake: you installed a pre-backed package without looking at what it does, how it does it or why. Now you end up with things you don't understand that happen against your will and outside of your control and you are lost.

Take my advice: drop this stupid distribution, write your own ~/.vimrc as you go and install your plugins yourself, as you need them. Being completely in control of your environment is unvaluable.

4
  • 2
    +1 for the rant against pre-packaged distributions. It may be right for some people (e.g. a local dev community), but this issue perfectly illustrates the pitfalls. Dec 13, 2012 at 8:11
  • This isn't the only problem I've run into related to not knowing which plugin was controlling what. I think I'll take your advice, and thanks for letting me find the answer in :h neocomplache. I found the lines in my .vimrc file for snippet expansions - imap <C-k> <Plug> and smap <C-k> <Plug>.
    – user327301
    Dec 13, 2012 at 16:54
  • @raoulcousins, please note that I'm not playing smartass by not giving you the correct mapping: the documentation is really the first place to look for answers which are there 90% of the time. Most questions here could be answered with a dry :help whatever. And I don't use neocomplcache.
    – romainl
    Dec 13, 2012 at 17:53
  • @romainl I agree that documentation is useful, but for answering my specific question the most important part of your answer was saying it was neocomplcache. It's hard to use :help x when you don't know x (another argument against prepackaged vim).
    – user327301
    Dec 13, 2012 at 18:40
2

What you search is CTRL+K

NeoComplCache not only uses it to choose position from the list but also to jump between positions in the snippets (${1:some_text}).

Beginners make many mistakes in the configuration file which makes the VIM unusable.
Good books and proved configurations are OK.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .