標籤:
intent Act Repeat Reverse
Make a change {edit} . u
Scan line for next character f{char}/ t{char} ; ,
Scan line for previous character F{char}/ T{char} ; ,
Scan document for next match /pattern<CR> n N
Scan document for previous match ?pattern<CR> n N
Perform substitution :s/target/replacement & u
Execute a sequence of changes qx{changes}q @x u
* 匹配當前選中的單詞
:h key-notation 查看按鍵組合位的用途
Keystrokes Effect
<Esc> Switch to Normal mode
<C-[> Switch to Normal mode
<C-o> Switch to Insert Normal mode
<c-r> 粘貼內容,insert mode
<c-v>code 插入編碼代表的字元
ga 顯示當前字元的編碼
Command Effect
<Esc> Switch to Normal mode
v Enable character-wise Visual mode
V Enable line-wise Visual mode
<C-v> Switch to block-wise Visual mode
gv Reselect the last visual selection
o Go to other end of highlighted text
Symbol Address
1 First line of the file
$ Last line of the file
0 Virtual line above first line of the file
. Line where the cursor is placed
‘m Line containing mark m
‘< Start of visual selection
‘> End of visual selection
% The entire file (shorthand for :1,$)
@: repeat the ex commands
Command Effect
<C-w>s Split the current window horizontally
<C-w>v Split the current window vertically
:sp {file} Split the current window horizontally
:vsp Split the current window vertically
Command Effect
<C-w>w Cycle between open windows
<C-w>h Focus the window to the left
<C-w>j Focus the window below
<C-w>k Focus the window above
<C-w>l Focus the window to the right
Ex Command Normal Command Effect
:cl[ose] <C-w>c Close the active window
:on[ly] <C-w>o Keep only the active window, closing all others
Keystrokes Buffer Contents
<C-w>= Equalize width and height of all windows
<C-w>_ Maximize height of the active window
<C-w>| Maximize width of the active window
[N]<C-w>_ Set active window height to [N] rows
[N]<C-w>| Set active window width to [N] columns
Command Effect
<C-w>T Move the current window into its own tab
:tabc[lose] Close the current tab page and all of its windows
:tabo[nly] Keep the active tab page, closing all others
:tabe[dit] {file} Open {filename} in a new tab
Ex Command Normal Command Effect
:tabn[ext] {N} {N}gt Switch to tab page number {N}
:tabn[ext] gt Switch to the next tab page
:tabp[revious] gT Switch to the previous tab page
Command Move cursor
h One column left
l One column right
j One line down
k One line up
Keystrokes Buffer Contents
iw Current word
aw Current word plus one space
iW Current WORD
aW Current WORD plus one space
is Current sentence
as Current sentence plus one space
ip Current paragraph
ap Current paragraph plus one blank line
Command Effect
[count]G Jump to line number
% Jump to matching parenthesis
(/) Jump to start of previous/next sentence
{/} Jump to start of previous/next paragraph
H/M/L Jump to top/middle/bottom of screen
gf Jump to file name under the cursor
<C-]> Jump to definition of keyword under the cursor
’{mark} / `{mark} Jump to a mark
//pattern <CR> /?pattern <CR> / n / N Jump to next/previous occurrence of pattern
Register Contents
"_ black hole register
"+ system clipboard
"* selection registers
"% Name of the current file
"# Name of the alternate file
". Last inserted text
": Last Ex command
"/ Last search pattern
Vim工具使用備忘