I am using vim 7.3 on OSX Lion. I installed snipmate from garbas/vim-snipmate on github, and it appears that <tab> doesn’t work in certain places while <c-n> does.
When I try to tab-complete an existing word in the file or if I want to tab-complete something from my ctags list, all I get is spaces being added…but <c-n> works!
If I freely type for<tab>, that does work.
Why is it not completing in some cases but does in others?
You are confused,
<C-n>and Snipmate’s tab-expansion system have nothing to do with each other.<C-n>is a built-in shortcut for omnicompletion: it allows you to complete what you are currently typing with other words from the currently opened buffers, and some other sources.Snipmate’s
<Tab>expands arbitrary stubs into full snippets of code:would give you this in a JS file:
It’s not a completion mechanism. If you don’t have a language-specific snippet defined for the few letters you just typed, Snipmate won’t do anything:
doesn’t expand anything because you don’t have a
farsnippet while omnicompletion will complete withting.Because you want your
<Tab>to do two unrelated things you will probably need a plugin like SuperTab.