Vim教程.docx
- 文档编号:2968216
- 上传时间:2022-11-16
- 格式:DOCX
- 页数:40
- 大小:41.85KB
Vim教程.docx
《Vim教程.docx》由会员分享,可在线阅读,更多相关《Vim教程.docx(40页珍藏版)》请在冰豆网上搜索。
Vim教程
注:
我觉得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'-c'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.
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
youinNormalmode.Thenretypethecommandyouwanted.
注意:
如意你不确定你按下了什么,按
再按你想要输入的命令。
NOTE:
Thecursorkeysshouldalsowork.Butusinghjklyouwillbeableto
movearoundmuchfaster,onceyougetusedtoit.Really!
注意:
光标键同样生效。
但hjkl键会使你移动得更快,只要你熟悉了它。
真的!
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Lesson1.2:
EXITINGVIM
1。
2节:
退出VIM
!
!
NOTE:
Beforeexecutinganyofthestepsbelow,readthisentirelesson!
!
!
!
注:
执行以下步骤前,请读完全节!
!
1.Pressthe
1.按下
2.Type:
:
q!
Thisexitstheeditor,DISCARDINGanychangesyouhavemade.
2.按:
:
q!
此命令使编辑器退出并放弃你作的作用改动。
(即不保存对文本的编辑)
3.Whenyouseetheshellprompt,typethecommandthatgotyouintothis
tutor.Thatwouldbe:
vimtutor
3.当你看见shell提示时,输入以下命令并进入本教程:
vimtutor
译者注:
事实上你vimtutor是打开一个副本,你也可以打开你之前创建的副本:
vimvimtutor_copy
4.Ifyouhavethesestepsmemorizedandareconfident,executesteps
1through3toexitandre-entertheeditor.
4.如果你已经记住的这些步骤并有信心了,就执行步骤1-3退出,然后再进入编辑器。
NOTE:
:
q!
willlearnhowtosavethechangestoafile.
注:
q!
在新的一节你会学到保存文件的修改。
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节。
NOTE:
Asyougothroughthistutor,donottrytomemorize,learnbyusage.
注:
浏览本教程时,不要试着去记,而是学习其用法。
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Lesson1.4:
TEXTEDITING-INSERTION
1.4节:
文本编辑之插入
**Pressitoinserttext.**
**按下i键以插入文本**
1.Movethecursortothefirstlinebelowmarked--->.
1.移动光标到--->标记的行。
2.Tomake
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- Vim 教程
![提示](https://static.bdocx.com/images/bang_tan.gif)