Reputation: 33674
In one of the vim config files I have noticed this keyboard mapping
map <C-L> <C-W>l<C-W>_
supposedly for easier moving in tabs and windows. What does that translate to keyboard presses? What is that underscore at the end for?
Upvotes: 4
Views: 1291
Reputation: 196731
The Ctrl+wlCtrl+w_ keys sequence is somewhat too long so someone has created a shortcut ("map
ping" in Vim-speak): Ctrl+L for it.
<C-w>l<C-w>_
moves the the cursor to the window on the right (<C-w>l
) and maximizes it vertically (<C-w>_
).
Mappings always follow the same structure:
map
(or imap
for insert mode mapping, nmap
for normal mode mapping, etc.)
some whitespace
the shortcut you want, here <C-L>
some whitespace
the sequence of commands triggered by the shortcut
See :help windows
for more info on window management and :help mapping
for more info on mappings.
Upvotes: 3
Reputation: 13526
The command map <C-L> <C-W>l<C-W>_
maps Ctrl-L to Ctrl-W, l
, Ctrl-W, _.
You invoke this binding by just pressing Ctrl-L. To invoke what it binds to you would type Ctrl-W, then l
, followed by Ctrl-W again, and finally _ (which on a US keyboard is shift-hyphen). This is two separate bindings, <C-W>l
moves the cursor to the window to the right, and <C-W>_
resizes current window to the maximum possible vertical size.
Upvotes: 6