ele
ele

Reputation: 6181

What's the <C-w> key in Vim?

I see a lot of talk about different keys (<C-R>, <C-j>, and <C-w>) in Vim and I'm wondering if there's a list somewhere (:help?) that tells what they are. I figured out <C-R> is Enter ("carriage return", I suppose) but often the others don't make immediate sense.

Upvotes: 29

Views: 23458

Answers (3)

Zoneur
Zoneur

Reputation: 1099

These are not keys, they are keys associated with the control key. <C-j> means "Press j while pressing control".

<C-R> is not carriage return, it's the redo command. <CR> is carriage return. <C-F> is page up, <C-B> is page down, ...

Upvotes: 21

kev
kev

Reputation: 161604

So many key-bindings to learn in vim, you'd better learn how to use the :help.
There are some tips to get help quickly:

Ctrl-W in normal mode:

:h ^w

Ctrl-W in insert mode:

:h i^w

Ctrl-W in visual mode:

:h v^w

Ctrl-W in command mode:

:h c^w

Open help in another tabpage:

:tab h ^w

Upvotes: 29

RocketDonkey
RocketDonkey

Reputation: 37249

The control keys. For instance, using <C-w> h (or j, k, l) will toggle between open buffers.

<C-j> will move you down a line. Also, I could be wrong, but I believe the carriage return is <CR> (not <C-R>).

Upvotes: 3

Related Questions