Debugging Vim Scripts

Working a vim plugin someone sent me to test and it turns out to be buggy... but only on Solaris. My MacBook has no such problem. Since I promised to debug it if it's not reproduceable. So to do that I'm working through the code, line by line, only to discover how limited my vim knowledge really is.

This little mapping will help with that. If, and only if, you are in a file which vim thinks has a 'vim' filetype, it will remap 'K' to automatically display help for any keyword the cursor is on. It's a much faster way of figuring things out (and it's actually in a filetype plugin rather than my.vimrc).

au! FileType vim:noremap K:exe "help " . expand("<cword>")<cr>

On a side note, I'm getting so irritated with vim that I started playing with Emacs. That led me quickly back to vim:(

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
Without JavaScript enabled, you might want to
use the classic discussion system instead. If you login, you can remember this preference.