Vim使用经验技巧.doc_第1页
Vim使用经验技巧.doc_第2页
Vim使用经验技巧.doc_第3页
Vim使用经验技巧.doc_第4页
Vim使用经验技巧.doc_第5页
免费预览已结束,剩余1页可下载查看

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

Vim使用经验技巧Vim挂起:ctrl + Z返回vim:fgVim替换:%s/pattern1/pattern2/g(%范围前缀表示在所有行中执行替换。g代表替换行中的所有匹配点,如果需要逐个确认则在其后加c,)N,$s/pattern1/pattern2/则代表替换从n到$行如果替换内容有/时,则把分隔符/变为#修改文本模式下分辨率问题:/boot/grub/grub.conf里的后面加上vga=0x317(1024X768)即可Command Actioni insert text just before the cursorI insert text at the start of the linea append text just after the cursorA append text at the end of the lineo open a new line belowO open a new line aboves substitute the current characterS substitute the current liner replace the current characterR replace continuous charactersWant to move the cursor to the next word? Press w.Want to move to to the next paragraph? Press .Want to move to the 3rd occurrence of the letter h? Press 3fh.Want to move 35 lines downwards? Press 35j.After one of the above movements, want to jump back to the previous location? Pressctrl-o.h You have to stretch your index finger (which is on j) to the left to press the h. This is the left-most keyand signifies going left.j The drooping j key signifies going down.k The upward pointing k key signifies going up.l The right-most l key signifies going right.Traditional Vimhome key moves to the start of the line key (think anchored to the start)end key moves to the end of the line $ key (think the buck stops here)pgup key moves one screen up ctrl-b which means move one screen backwardpgdn key moves one screen down ctrl-f which means move one screen forwardMove the cursor to the first line by pressing 1G. Move 20 characters to the right by pressing 20l. Move back to the first character by pressing . Jump to the last character by pressing $. Press G to jump to the last line.Press H to jump as high as possible (first line of the window)Press M to jump to the middle of the windowPress L to jump as low as possible (last line being displayed)First, lets position the cursor on the first character by pressing .Want to move to the next word? Press w.How about moving 2 words forward? Just add the prefix count to w: 2w.Similarly, to move to the end of the next word, press e.To move one word backward, press b. By prefixing a count, 2b will go back by 2 wordsPosition the cursor at the first character ().To move to the next sentence, press ).To move to the previous sentence, press (.Notice that the bigger brackets is for the bigger text object. If you had already noticedthis, then congratulations, you have already started to think like a winner, err, think like aVimmer.Use ma to create a mark named a. Move the cursor towherever you want, for example 4j.simply press ctrl-oto jump to the previous location and ctrl-i to jump forward to the next location again.Press v to start the visual mode, and press ap to select a paragraph. Press to flip thecase of the text. If you want to cancel the selection, simply press .Other text object mnemonics are aw which means a word, a means a quoted string (likethis is a quoted string), ab means a block which means anything within a pair ofparentheses, and so on.NoteTo make saving easier, add the following line to your vimrc file: To save, ctrl-s.nmap :wimap :wacd is short for change directory.pwd is short for print working directory.Desktop world vim world operation cut delete dcopy yank ypaste paste pyap will copy the current paragraphp (lower case) paste after current cursor positionP (upper case) paste before current cursor positionx delete one character at curre

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

最新文档

评论

0/150

提交评论