VIM基础使用介绍

VIM基础使用介绍

ID:38278672

大小:623.41 KB

页数:12页

时间:2019-06-07

VIM基础使用介绍_第1页
VIM基础使用介绍_第2页
VIM基础使用介绍_第3页
VIM基础使用介绍_第4页
VIM基础使用介绍_第5页
资源描述:

《VIM基础使用介绍》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库

1、一、Vim没有菜单,只有命令。是一款全屏幕模式文本编辑器。二、VIM工作模式三、插入模式:在命令模式按i;进入编辑模式:在命令模式shift+:。四、命令:四、使用技巧基础:efilenameOpen filename foredition:wSavefile:qExitVim:q!Quitwithoutsaving:xWritefile(ifchangeshasbeenmade)andexit:savfilenameSavesfileas filename.Repeatsthelastchangemadeinnormalmode5.Repea

2、ts5timesthelastchangemadeinnormalmode在文件中移动korUpArrowmovethecursoruponelinejorDownArrowmovethecursordownonelineemovethecursortotheendofthewordbmovethecursortothebeginingoftheword0movethecursortothebeginingofthelineGmovethecursortotheendofthelineggmovethecursortothebeginingof

3、thefileLmovethecursortotheendofthefile:59movecursortoline 59.Replace 59 bythedesiredlinenumber.20

4、movecursortocolumn 20.%Movecursortomatchingparenthesis[[Jumptofunctionstart[{Jumptoblockstart剪切、复制和粘贴yCopytheselectedtexttoclipboardpPasteclipboardcontentsddCutcurrentlineyyCopy

5、currentliney$CopytoendoflineDCuttoendofline搜索/wordSearch word fromtoptobottom?wordSearch word frombottomtotop*Searchthewordundercursor/cstringSearch STRING or string,caseinsensitive/jo[ha]nSearch john or joan/Search the or breathe/S

6、earch the/<¦.>Searchallwordsof4letters//Search fred butnot alfred or frederick/fred

7、joeSearch fred or joe/Searchexactly4digits/^{3}Find3emptylines:bufdo/searchstr/Searchinallopenfilesbufdo%s/something/somethingelse/gSearch something inalltheopenbuffersandr

8、eplaceitwithsomethingelse替换:%s/old/new/gReplacealloccurencesof old by new infile:%s/onward/forward/giReplaceonwardbyforward,caseunsensitive:%s/old/new/gcReplacealloccurenceswithconfirmation:2,35s/old/new/gReplacealloccurencesbetweenlines2and35:5,$s/old/new/gReplacealloccuren

9、cesfromline5toEOF:%s/^/hello/gReplacethebeginingofeachlineby hello:%s/$/Harry/gReplacetheendofeachlineby Harry:%s/onward/forward/giReplace onward by forward,caseunsensitive:%s/*$//gDeleteallwhitespaces:g/string/dDeletealllinescontaining string:v/string/dDeletealllinescontain

10、ingwhichdidn’tcontain string:s/Bill/Steve/Replacethefirstoccurenceof Bill b

当前文档最多预览五页,下载文档查看全文

此文档下载收益归作者所有

当前文档最多预览五页,下载文档查看全文
温馨提示:
1. 部分包含数学公式或PPT动画的文件,查看预览时可能会显示错乱或异常,文件下载后无此问题,请放心下载。
2. 本文档由用户上传,版权归属用户,天天文库负责整理代发布。如果您对本文档版权有争议请及时联系客服。
3. 下载前请仔细阅读文档内容,确认文档内容符合您的需求后进行下载,若出现内容与标题不符可向本站投诉处理。
4. 下载文档时可能由于网络波动等原因无法下载或下载错误,付费完成后未能成功下载的用户请联系客服处理。