Chinaunix首页 | 论坛 | 博客
  • 博客访问: 258255
  • 博文数量: 52
  • 博客积分: 406
  • 博客等级: 一等列兵
  • 技术积分: 549
  • 用 户 组: 普通用户
  • 注册时间: 2012-04-21 12:34
个人简介

......

文章分类

全部博文(52)

文章存档

2014年(1)

2013年(32)

2012年(19)

我的朋友

分类: LINUX

2012-06-25 20:13:59

根据个人习惯整理一下vi基本操作,作为工具查用(update step by step)

1. movement of cursor

   h : move to the left     l : move to the right 

   k : move to the up       j : move to the down

   w : move to the next word  b: move to the previous word

   gg : move to the head of the article    G : move to the end of the article

2. copy & paste & delete

   yy(dd) : copy(delete) the total line    

   nyy(ndd) : copy(delete) the n line from the line of cursor located 

   wy(dy) : copy(delete) the one word       

   p  : paste

   v..y(press v ,and then move cursor to the alphabet you want , and then press y) : copy the 

        alphabet between v and y 

3. find 

   /liubbc   : find key word liubbc from up to down

   ?liubbc   : find key word liubbc from down to up

4. undo & redo 

   u : undo   Ctrl+r : redo

5. insert

   o : input your word from next line (chage command mode to edit mode)

6. jump to the defination of function and go back

   ctrl+] : jump to the defination of function

   ctrl+t : go back

7. text highlighting & no highlighting

   move to the word and then press shift+*
   input nohl   in command mode

8. edit your .vimrc

   there is a file named vimrc  in /etc, and it is a publicated conf file to all users.

   set nu  : show line number 

   syntax  enable :  text highlighting 

   autocmd  : rember the location before

   set tabstop=4 : tab == 4*space 

9. edit two more files at the same time

   a)vi xxx.c yyy.c 

   b):n edit next file  :N edit file last file

   c):files  list all files in the vim 

  


   

   

阅读(1572) | 评论(0) | 转发(0) |
0

上一篇:linux 链表

下一篇:linux hidden file

给主人留下些什么吧!~~