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

linux----vi

时间:2017-06-11 17:31:52      阅读:293      评论:0      收藏:0      [点我收藏+]

标签:退出   main   dnw   bsp   stat   char   border   quit   arc   

vi------http://www.cs.colostate.edu/helpdocs/vi.html

查找: 

 /string search forward for occurrence of string in text
 ?string search backward for occurrence of string in text
 n move to next occurrence of search string
 N move to next occurrence of search string in opposite direction

退出:  

 

 :r filename<Return> read file named filename and insert after current line
(the line with cursor)
  :w<Return> write current contents to file named in original vi call
  :w newfile<Return> write current contents to a new file named newfile
  :12,35w smallfile<Return> write the contents of the lines numbered 12 through 35 to a new file named smallfile
  :w! prevfile<Return> write current contents over a pre-existing file named prevfile
 :x<Return> quit vi, writing out modified file to file named in original invocation
 :wq<Return> quit vi, writing out modified file to file named in original invocation
 :q<Return> quit (or exit) vi
 :q!<Return> quit vi even though latest changes have not been saved for this vi call

删除

*

 

 x delete single character under cursor
 Nx delete N characters, starting with character under cursor
 dw delete the single word beginning with character under cursor
 dNw delete N words beginning with character under cursor;
  e.g., d5w deletes 5 words
  D delete the remainder of the line, starting with current cursor position
* dd delete entire current line
  Ndd or dNd delete N lines, beginning with the current line;
  e.g., 5dd deletes 5 lines

复制粘贴:

 yy copy (yank, cut) the current line into the buffer
 Nyy or yNy copy (yank, cut) the next N lines, including the current line, into the buffer
 p put (paste) the line(s) in the buffer into the text after the current line

linux----vi

标签:退出   main   dnw   bsp   stat   char   border   quit   arc   

原文地址:http://www.cnblogs.com/whateveranyhow/p/6985502.html

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