码迷,mamicode.com
首页 > 系统相关 > 详细

Vim工具使用备忘

时间:2015-04-17 20:24:22      阅读:208      评论:0      收藏:0      [点我收藏+]

标签:

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

标签:

原文地址:http://www.cnblogs.com/y2ghost/p/4435673.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!