In one of the vim config files I have noticed this keyboard mapping map <CL> <CW>l<CW>_
supposedly for easier moving in tabs and windows. What does that translate to keyboard presses? What is that underscore at the end for?
The command map <CL> <CW>l<CW>_
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, <CW>l
moves the cursor to the window to the right, and <CW>_
resizes current window to the maximum possible vertical size.
The Ctrl + w l Ctrl + w _ keys sequence is somewhat too long so someone has created a shortcut (" map
ping" in Vim-speak): Ctrl + L for it.
<Cw>l<Cw>_
moves the the cursor to the window on the right ( <Cw>l
) and maximizes it vertically ( <Cw>_
).
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 <CL>
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.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.