免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 695 | 回复: 0
打印 上一主题 下一主题

A simple vi manual [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2006-01-19 23:22 |只看该作者 |倒序浏览

               
               
               
                Cursor Keys

up:    k       down:  j
left:  h
right: l    Word and Line Movement Keys Beginning of next word:      wBeginning of prev word:      bStart of line:               0 (zero) or ^End of line:                  $
Start of previous sentence:   (
Start of next sentence:        )
Start of previous paragraph:  {
Start of next paragraph:      }
Move to top of screen:           H (home)
Move to middle of screen:        M (middle)
Move to last line of screen:     L (last)
Start of following line:  RETURN
Last line in file:            G

Number Counts
To repeat command X, n times:  nX
Examples:
To move 10 lines down:         10j
To move 4 characters left:     4h
To move 5 words right:         5w
To move to the nth line:   "nG".
Example:
First line in file:  1G
23th line in file:   23G


Cancelling CommandsESCAPE
Status LineCTRL-G
Scroll Commands Scroll forward one screen:       CTRL-fScroll back one screen:             CTRL-b        Scroll up half a screen:      CTRL-uScroll down half a screen:    CTRL-d
Delete Commands
To delete a single character at cursor:      x
To delete large sections of text:            d
To delete from cursor to start of next word:         dw
To delete from cursor to end of line:                d$
To delete from current line to bottom of screen:     dL
To delete the current line:                          dd                  
  

Input/Editing Commands
Insert text before the cursor:    i
Insert text after the cursor:      a
Insert text at start of line:     I
Insert text at end of line:       A
Insert blank line below current line:     o
Insert blank line above current line:     O
Change from cursor to end of line:     C
Change a word to "newtext":            cwnewtext
Change entire line:                    cc                                     Replace character at cursor with x:              rx
Replace (overwrite) from cursor onward:      R
Substitute one or more characters for a single character:    snewtext
Substitute entire line:                                        S
Search Search for a string "foo":     /foo
Repeat search forward:     n or /
Repeat search backward:    N
Copy, Paste, Undo
Copy current line:     yy  or Y
Copy a word:           yw
Paste after cursor:    p
Paste before cursor:   P
Reversing two lines:      ddp
Reverse two characters:   xp
Insert previously pasted text here:        ^@ (max of 128 chars)Undo last modification:                uUndo all changes on a given line:      U
               
               
               
               
               
               
               
               
               
               
               

本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u/12756/showart_69195.html
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP