Vim工具使用備忘

來源:互聯網
上載者:User

標籤:

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工具使用備忘

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.