vim: Binding C-i bad for tab

Note: This entry has been restored from old archives.

In the unlikely case that anyone made use of the C-i binding I suggested for toggling vim 7.0 spell-checking they may have noticed that it messed with the use of their tab key! So it turns out that tab and C-i are the same thing from vim’s point of view!

Choose a different combo. Like C-c for *c*heck, or C-s for *s*pell, that’s surely better! Meta maybe?

I’m now using C-a:

" Set spelling language.
set spelllang=en_gb
" Toggle spell checking for the current buffer with Ctrl-i
map   :setlocal invspell
imap   :setlocal invspella

Note 1: The ‘i‘ at the end of the imap is now an ‘a‘ so that the insert position comes back the same.

Note 2: The C-i is only a problem for the imap and if you remove that you can then use C-i or tab in command mode to toggle spelling and live without the ability to toggle spelling when in edit mode. This’ll clash with any other command mode binding of tab of course, but I have none. I like to toggle in edit mode though so I’ll stick with C-a for now (hrm, what does it clash with?).

Update

Of course, a few minutes later I try to use C-a for it’s normal purpose, incrementing a number under the cursor. I use this surprisingly often. *sigh*