How can I debug a Vim plugin not being loaded?
Question
I'm trying to use the Vim snipMate plugin, and I've installed it as it directs, but when I press tab nothing happens.
- How can I debug this? Are there log files Vim makes when it tries to load stuff?
- How can I see what plugins its loaded correctly?
I've tried :sni<tab>
to see if there's anything called snipsomething installed but nothing completes.
In the installation tutorial it doesn't mention adding anything into my vimrc
but I guess it finds the /plugin/
dir automatically?
I'm running on Windows and Unix and I have the same profile with the same problem.
Other plugins like NerdTree are loading OK.
Update: Following another question, I've tried :inoremap
and :snoremap
and the <Tab>
entry mentioning TriggerSnippet()
is there:
e.g.
s <Tab> * <Esc>i <Right><C-R>=TriggerSnippet()<CR>
- Does this mean it's enabled?
Solution
:verbose imap <tab>
will tell you what is bound to <tab>
:scriptnames
will tell you what scripts were loaded.
OTHER TIPS
You can insert echo "Loaded so far"
and the like inside the plugin code - the text will be displayed in the bottom line if the echo
is executed. Debugging by printf :) Crude, but simple and works.
Also: plugin
is loaded automagically. plugins
is not.
It looks like I had something dodgy in C:\Program Files\Vim\vimfiles\
directory which was superceding my user preferences. I just blew away that directory and it works now.