Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What Does CTRL+Space Do in Vim?

Tags:

I've been looking for a while, but I can't seem to find any documentation on this key-command. Just by playing around, it seems that CTRL+Space inserts the text that was typed in the last insert-mode session.

However, is something more subtle going on? What exactly does this key-command do in vanilla Vim?

like image 337
Casey Falk Avatar asked Jul 27 '14 17:07

Casey Falk


1 Answers

<C-Space> doesn't do anything in any mode by default. Try :verbose map <c-space> to see where it is mapped to do what you see.

edit

I somehow forgot about that previous answer to a related question:

When you press <C-Space>, the terminal sends an ambiguous signal to Vim which interprets it as <Nul>. Because <Nul> is usually represented as <C-@>, Vim acts as if you actually pressed <C-@> and tries to insert the previously inserted text.

Note that this issue is not present in GVim/MacVim.

like image 149
romainl Avatar answered Oct 02 '22 17:10

romainl