Ctrl-space inserts a null character (you can verify this by putting it in a file and running od -xc on it). I've done lots of googling in the past, but it's hard to google on strings like " " or even "space" or "null", and nobody I asked had a clue what this function was called (it turns out it re-inserts whatever the last inserted characters were) so I couldn't google on the function name.
Vim's help suggests that <Nul>, <Char-0>, or <C-^V > should do it. I tried them with map, vmap, cmap, and nmap, to no avail. I also tried <C-@> since that's a historical way of referring to the null character, googling found some references to that in vim, and that's how it displays if I type it in vim.
I finally found #vim on freenode, and asked there. Last night nobody knew, but this morning, p0g found the problem: I needed to use imap, not the map/vmap/cmap/nmap I'd been using.
So here, perserved for google posterity in case other people are plagued by this problem, is the answer:
imap <Nul> <Space>
For good measure, I also mapped the character to no-op in all the other modes as well:
map <Nul> <Nop> vmap <Nul> <Nop> cmap <Nul> <Nop> nmap <Nul> <Nop>
[ 10:24 Feb 17, 2005 More linux/editors | permalink to this entry ]