Casey Falk
Casey Falk

Reputation: 2667

What Does CTRL+Space Do in Vim?

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?

Upvotes: 27

Views: 14205

Answers (1)

romainl
romainl

Reputation: 196886

<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.

Upvotes: 49

Related Questions