最新VIM指令教程 英文+翻译版本Word文档下载推荐.docx
- 文档编号:16714340
- 上传时间:2022-11-25
- 格式:DOCX
- 页数:60
- 大小:94.61KB
最新VIM指令教程 英文+翻译版本Word文档下载推荐.docx
《最新VIM指令教程 英文+翻译版本Word文档下载推荐.docx》由会员分享,可在线阅读,更多相关《最新VIM指令教程 英文+翻译版本Word文档下载推荐.docx(60页珍藏版)》请在冰豆网上搜索。
dd
4.Torepeatamotionprependitwithanumber:
2w
5.Theformatforachangecommandis:
operator[number]motion
where:
operator-iswhattodo,suchasdfordelete
[number]-isanoptionalcounttorepeatthemotion
motion-movesoverthetexttooperateon,suchasw(word),
$(totheendofline),etc.
6.Tomovetothestartofthelineuseazero:
0
7.Toundopreviousactions,type:
u(lowercaseu)(#应用)
Toundoallthechangesonaline,type:
U(capitalU)
Toundotheundo'
s,type:
CTRL-R(#应用)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Lesson3SUMMARY
1.Toputbacktextthathasjustbeendeleted,typep.Thisputsthe
deletedtextAFTERthecursor(ifalinewasdeleteditwillgoonthe
linebelowthecursor).
2.Toreplacethecharacterunderthecursor,typerandthenthe
characteryouwanttohavethere.
3.Thechangeoperatorallowsyoutochangefromthecursortowherethe
motiontakesyou.eg.Typecetochangefromthecursortotheendof
theword,c$tochangetotheendofaline.
4.Theformatforchangeis:
c[number]motion(w$)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Lesson4SUMMARY
1.CTRL-Gdisplaysyourlocationinthefileandthefilestatus.
Gmovestotheendofthefile.
numberGmovestothatlinenumber.
ggmovestothefirstline.
2.Typing/followedbyaphrasesearchesFORWARDforthephrase.
Typing?
followedbyaphrasesearchesBACKWARDforthephrase.
Afterasearchtypentofindthenextoccurrenceinthesamedirection
orNtosearchintheoppositedirection.
CTRL-Otakesyoubacktoolderpositions,CTRL-Itonewerpositions.
3.Typing%whilethecursorisona(,),[,],{,or}goestoitsmatch.
4.Tosubstitutenewforthefirstoldinalinetype:
s/old/new
Tosubstitutenewforall'
old'
sonalinetype:
s/old/new/g
Tosubstitutephrasesbetweentwoline#'
stype:
#,#s/old/new/g
Tosubstitutealloccurrencesinthefiletype:
%s/old/new/g
Toaskforconfirmationeachtimeadd'
c'
%s/old/new/gc
∙
Ubuntu
∙Forum
∙Wiki
∙Linux
∙Blog
∙Paste
∙Chat
TopofForm
BottomofForm
登录
注册
FAQ
论坛首页
»
软件使用
办公、图像、机械电子设计等
Vim和Emacs
当前时区为UTC+8小时
30分钟学会vim之vimtutor(双语版)
带行号显示文件的内容:
nl文件名
分页:
1
/
1
[5篇帖子]
打印预览
上一个主题
|
下一个主题
作者
内容
楼
132811
文章标题:
发表于:
2010-07-110:
35
注册:
2010-04-2021:
19
帖子:
130
地址:
Mygtalk:
a132811@
送出感谢:
次
接收感谢:
次
文件我上传到这里:
注:
我觉得vimtutor是众多vim帮助文档中最好的入门教程,其中的每一个知识点都有相应
的习题,可以让你在短时间内掌握基本的VIM操作。
本双语版是我练习翻译之作,对于其中出现的任何词义、语法等等的错误还还请大家
指正。
因为我的是英文环境,没有中文版的,不知道大家的vimtutor_cn是多少版本的,如
果有新版的话希望能共享一下。
EMAIL:
ahui132@
请通过vim练习:
vimvimtutor_cn.txt
===============================================================================
=WelcometotheVIMTutor-Version1.7=
欢迎使用VIM教程1.7版
Vimisaverypowerfuleditorthathasmanycommands,toomanyto
explaininatutorsuchasthis.Thistutorisdesignedtodescribe
enoughofthecommandsthatyouwillbeabletoeasilyuseVimas
anall-purposeeditor.
VIM是一个强大的编辑器,它拥有大量的命令,所以没法在本教程中全部解释。
本
教程描述了足够多的命令,使你能轻松将VIM作为通用编辑器。
Theapproximatetimerequiredtocompletethetutoris25-30minutes,
dependinguponhowmuchtimeisspentwithexperimentation.
完成本教程的时间大约是25-30分钟,主要依赖于你在实验中花去的时间。
ATTENTION:
Thecommandsinthelessonswillmodifythetext.Makeacopyofthis
filetopractiseon(ifyoustarted"
vimtutor"
thisisalreadyacopy).
注意:
本课程中的命令会改变本文,请创建一个副本来练习(如果你用命令“vimtutor"
开始,本文已经是一个副本了)。
译者注:
创建副本的命令为:
vim-uNONE-c'
e$VIMRUNTIME/tutor/tutor'
-c'
w!
vimtutor_copy'
q'
;
ls-l
Itisimportanttorememberthatthistutorissetuptoteachby
use.Thatmeansthatyouneedtoexecutethecommandstolearnthem
properly.Ifyouonlyreadthetext,youwillforgetthecommands!
重要是要记住,本教程是用于指导VIM的使用。
这意味着你需要执行命令以
以正确地学习它们。
如果你只是阅读文本,你会很快忘记这些命令!
Now,makesurethatyourShift-LockkeyisNOTdepressedandpress
thejkeyenoughtimestomovethecursorsothatLesson1.1
completelyfillsthescreen.
现在,请确保你的shift键是启用的,按j键多次移动到1.1课并使之
完全占据屏幕
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Lesson1.1:
MOVINGTHECURSOR
1.1课:
移动光标
**Tomovethecursor,presstheh,j,k,lkeysasindicated.**
**要移动光标,则按示意按下h,j,k,l键。
**
^
kHint:
Thehkeyisattheleftandmovesleft.
<
hl>
Thelkeyisattherightandmovesright.
jThejkeylookslikeadownarrow.
v
示意:
左边的h键是往左移
右边的l键是往右移
j键是往下移
1.Movethecursoraroundthescreenuntilyouarecomfortable.
1.在屏幕中移动光标到你觉得合适的地方。
2.Holddownthedownkey(j)untilitrepeats.
Nowyouknowhowtomovetothenextlesson.
2.按住j键,使之重复作用。
现在你知道了怎么移动到下一节了吧。
3.Usingthedownkey,movetoLesson1.2.
3.使用下移键,移动到1.2节。
NOTE:
Ifyouareeverunsureaboutsomethingyoutyped,press<
toplace
youinNormalmode.Thenretypethecommandyouwanted.
如意你不确定你按下了什么,按<
回到正常模式。
再按你想要输入的命令。
Thecursorkeysshouldalsowork.Butusinghjklyouwillbeableto
movearoundmuchfaster,onceyougetusedtoit.Really!
光标键同样生效。
但hjkl键会使你移动得更快,只要你熟悉了它。
真的!
Lesson1.2:
EXITINGVIM
1。
2节:
退出VIM
!
NOTE:
Beforeexecutinganyofthestepsbelow,readthisentirelesson!
注:
执行以下步骤前,请读完全节!
!
1.Pressthe<
key(tomakesureyouareinNormalmode).
1.按下<
键(确保你处于正常模式)。
2.Type:
.
Thisexitstheeditor,DISCARDINGanychangesyouhavemade.
2.按:
此命令使编辑器退出并放弃你作的作用改动。
(即不保存对文本的编辑)
3.Whenyouseetheshellprompt,typethecommandthatgotyouintothis
tutor.Thatwouldbe:
vimtutor<
3.当你看见shell提示时,输入以下命令并进入本教程:
vimtutor<
事实上你vimtutor是打开一个副本,你也可以打开你之前创建的副本:
vimvimtutor_copy
4.Ifyouhavethesestepsmemorizedandareconfident,executesteps
1through3toexitandre-entertheeditor.
4.如果你已经记住的这些步骤并有信心了,就执行步骤1-3退出,然后再进入编辑器。
discardsanychangesyoumade.Inafewlessonsyou
willlearnhowtosavethechangestoafile.
enter>
会取消你对文本所作的任何改动。
在新的一节你会学到保存文件的修改。
5.MovethecursordowntoLesson1.3.
5.移动光标到1.3节。
Lesson1.3:
TEXTEDITING-DELETION
1.3节:
文本编辑之删除
**Pressxtodeletethecharacterunderthecursor.**
**按下x键以删除光标所在的字符.**
1.Movethecursortothelinebelowmarked--->
1.移动光标到--->
标记的行。
2.Tofixtheerrors,movethecursoruntilitisontopofthe
charactertobedeleted.
2.为了修复错误,移动光标到要删除字符上。
3.Pressthexkeytodeletetheunwantedcharacter.
3.按下x键以删除不想要的字符。
4.Repeatsteps2through4untilthesentenceiscorrect.
4.重复步骤2到4,直到语句正确。
--->
Theccowjumpeddovverrthhemooon.
5.Nowthatthelineiscorrect,goontoLesson1.4.
5.现在语句正确了吧,请移步1.4节。
Asyougothroughthistutor,donottrytomemorize,learnbyusage.
浏览本教程时,不要试着去记,而是学习其用法。
Lesson1.4:
TEXTEDITING-INSERTION
1.4节:
文本编辑之插入
**Pressitoinserttext.**
**按下i键以插入文本**
1.Movethecursortothefirstlinebelowmarked--->
2.Tomakethefirstlinethesameasthesecond,movethecursorontop
ofthefirstcharacterAFTERwherethetextistobeinserted.
2.为使第一行同第二行相同,移动光标到要插入文本处字符上。
3.Pressiandtypeinthenecessaryadditions.
3。
按下i键,键入需要的字符。
4.Aseacherrorisfixedpress<
toreturntoNormalmode.
Repeatsteps2through4tocorrectthesentence.
4.当错误被修复后,按下<
esc>
重复步骤2到4以修改完整。
Thereistextmisngthis.
Thereissometextmissingfromthisline.
5.Whenyouarecomfortableinsertingtextmovetolesson1.5.
5.当你正确插入完文本后,移步1.5节。
Lesson1.5:
TEXTEDITING-APPENDING
1.5节:
文本编辑之追加
**PressAtoappendtext.**
**按下A键以追加文本**
Itdoesnotmatteronwhatcharacterthecursorisinthatline.
该行同下一行在字符上不匹配。
2.PressAandtypeinthenecessaryadditions.
2.按下A键,然后键入要添加的内容。
3.Asthetexthasbeenappendedpress<
3.当添加完文本后按下<
返回到正常模式。
4.Movethecursortothesecondlinemarked--->
andrepeat
steps2and3tocorrectthissentence.
4.移动光标到第二个--->
Thereissometextmissingfromth
Thereissometextmissingfromthisline.
Thereisalsosometextmiss
Thereisalsosometextmissinghere.
5.Whenyouarecomfortableappendingtextmovetolesson1.6.
5.当你正确添加了文本后,请移步1.6节。
Lesson1.6:
EDI
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- 最新VIM指令教程 英文+翻译版本 最新 VIM 指令 教程 英文 翻译 版本