vi(Visual)ÊÇÒÔÊÓ¾õΪµ¼ÏòµÄÈ«ÆÁÄ»±à¼Æ÷¡¢¹²·ÖΪÈýÖÖ·½Ê½£¨mode):
command·½Ê½£º
¡¡ÈκÎÊäÈ붼»á×÷Ϊ±à¼ÃüÁ¶ø²»»á³öÏÖÔÚÆÁÄ»ÉÏ£¬ÈôÊäÈë´íÎóÔòÓС°áµ¡±µÄÉùÒô£»ÈκÎÊäÈë
¡¡¶¼ÒýÆðÁ¢¼´·´Ó³
insert·½Ê½£º
¡¡ÈκÎÊäÈëµÄÊý¾Ý¶¼ÖÃÓڱ༼ĴæÆ÷¡£ÔÚcommand·½Ê½ÏÂÊäÈ루I,a,AµÈ£©,¿É½øÈëinsert·½Ê½£¬¡¡¡¡insert·½Ê½Ï°´ESC£¬¿ÉÌø»Øcommand·½Ê½¡£
escape·½Ê½£º
ÒÔ¡°£º¡±»òÕß¡°/¡±ÎªÇ°µ¼µÄÖ¸Á³öÏÖÔÚÆÁÄ»µÄ×îÏÂÒ»ÐУ¬ÈκÎÊäÈ붼±»µ±³ÉÌرðÖ¸Áî¡£
½øÈëvi£¨ÔÚϵͳÌáʾ·ûÏÂÃæÊäÈëÒÔÏÂÖ¸Á:
vi ¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡ ½øÈëvi¶ø²»¶ÁÈëÈκÎÎļþ
vi filename¡¡¡¡¡¡¡¡¡¡ ½øÈëvi²¢¶ÁÈëÖ¸¶¨Ãû³ÆµÄÎļþ£¨Ð¡¢¾ÉÎļþ¾ù¿É£©¡£
vi +n filename¡¡¡¡¡¡¡¡½øÈëvi²¢ÇÒÓÉÎļþµÄµÚ¼¸ÐпªÊ¼¡£
vi +filename ¡¡¡¡¡¡¡¡ ½øÈëvi²¢ÇÒÓÉÎļþµÄ×îºóÒ»ÐпªÊ¼¡£
vi + /word filename ¡¡½øÈëvi²¢ÇÒÓÉÎļþµÄwordÕâ¸ö×Ö¿ªÊ¼¡£
vi filename(s) ¡¡¡¡¡¡ ½øÈëvi²¢ÇÒ½«¸÷Ö¸¶¨ÎļþÁÐÈëÃûµ¥ÄÚ£¬µÚÒ»¸öÎļþÏȶÁÈë¡£
vedit¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡ ½øÈëvi²¢ÇÒÔÚÊäÈ뷽ʽʱ»áÔÚ״̬ÐÐÏÔʾ¡°INSERT MODE"¡£
±à¼Êý¸öÎļþ£¨ÀûÓÃvi filename(s))½øÈëviºó£©
:args ¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡ÏÔʾ±à¼Ãûµ¥Öеĸ÷¸öÎļþÃû
:n¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¶ÁÈë±à¼Ãûµ¥ÖеÄÏÂÒ»¸öÎļþ
:rew¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¶ÁÈë±à¼Ãûµ¥ÖеĵÚÒ»¸öÎļþ
:e#¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡ ¶ÁÈë±à¼Ãûµ¥ÄÚµÄÇ°Ò»¸öÎļþ
:e file ¡¡¡¡¡¡¡¡¡¡¡¡¡¡¶ÁÈëÁíÒ»¸öÎļþ½øvi(´ËÎļþ¿É²»ÔÚ±à¼Ãûµ¥ÄÚ£©,ÈôÔÎļþ¾Ð޸Ļ¹Ã»Óд浵£¬Ôò¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡Ó¦ÏÈÒÔ: w ´æµµ¡£
:e! file¡¡¡¡¡¡¡¡¡¡¡¡¡¡Ç¿ÆȶÁÈëÁíÒ»¸öÎļþ½øÈëvi£¬ÔÎļþ²»×÷´æµµ¶¯×÷¡£
´æ´¢¼°Í˳övi
:w filename¡¡¡¡¡¡¡¡¡¡ ´æÈëÖ¸¶¨Îļþ£¬µ«Î´Í˳övi£¨Èôδָ¶¨ÎļþÃûÔòΪµ±Ç°¹¤×÷µÄÎļþÃû£©¡£
:wq »òÕß :x»òÕßzz¡¡¡¡ ´æÎļþ£¬²¢ÇÒÍ˳övi.
:q¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡²»×÷ÈκÎÐ޸IJ¢Í˳övi¡£
:q!¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡ ·ÅÆúÈκÎÐ޸IJ¢Í˳övi¡£
:!command¡¡¡¡¡¡¡¡¡¡¡¡ ÔÝʱÍ˳övi²¢Ö´ÐÐshellÖ¸ÁִÐÐÍê±ÏºóÔٻص½vi¡£
:sh¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡ ÔÝʱÍ˳öviµ½ÏµÍ³Ï£¬½áÊøʱ°´Ctrl + dÔò»Øµ½vi¡£
¼ÓÊý¾ÝÖ¸Áî
i¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡ ÔڹرêλÖÿªÊ¼²åÈë×Ö·û£¬½áÊøʱºò°´ESC¼ü¡£
I¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡ ÔÚ¹â±êËùÔÚÐеÄ×îÇ°Ã濪ʼ¼Ó×Ö£¬½áÊøʱ°´ESC¼ü¡£
a¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡ ÔÚ¹â±êλÖúó¿ªÊ¼¼Ó×Ö£¬½áÊøʱ°´ESC¼ü¡£
A¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡ ÔÚ¹â±êËùÔÚÐеÄ×îºóÃ濪ʼ¼Ó×Ö£¬½áÊøʱ°´ESC¼ü¡£
o¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡ ÔÚ¹â±êϼÓÒ»¿Õ°×Ðв¢¿ªÊ¼¼Ó×Ö£¬½áÊøʱ°´ESC¼ü¡£
O¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡ ÔÚ¹â±êÉϼÓÒ»¿Õ°×Ðв¢¿ªÊ¼¼Ó×Ö£¬½áÊøʱ°´ESC¼ü¡£
!command¡¡¡¡¡¡¡¡¡¡¡¡¡¡Ö´ÐÐshellÖ¸Á²¢°Ñ½á¹û¼ÓÔÚ¹â±êËùÔÚÐеÄÏÂÒ»ÐС£
ɾ³ýÖ¸Áî
nx¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡É¾³ýÓɹâ±êλÖÃÆðʼµÄn¸ö×Ö·û£¨º¬¹â±êλÖ㬰´Ò»¸öx±íʾɾ³ý¹â±êËùÔÚµÄ×Ö·û£©
nX ¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡ ɾ³ýÓɹâ±êλÖÃÆðʼµÄn¸ö×Ö·û£¨²»º¬¹â±êλÖã©¡£
ndw¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡ ɾ³ý¹â±êλÖÃÆäʵµÄn¸ö×Ö·û×飨word)¡£
d0 ¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡ ½«ÐеĿªÊ¼µ½¹â±êλÖõÄ×Ö·ûÈ«²¿É¾³ý¡£
d$ »òD ¡¡¡¡¡¡¡¡¡¡¡¡¡¡ ½«¹â±êλÖÃÆðʼµ½ÐÐβµÄ×Ö·ûÈ«²¿É¾³ý¡£
ndd ¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡½«¹â±êλÖÃÆðʼµÄnÐУ¨ÕûÐУ©É¾³ý£¨dd±íʾɾ³ý¹â±êËùÔÚÐУ©¡£
:start,endd¡¡¡¡¡¡¡¡¡¡ ɾ³ýÎļþµÄµÚstartµ½endÐС£
¹Ø±êÒƶ¯
0 ¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡ÒƵ½Ò»ÐеĿªÊ¼
$ ¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡ÒƵ½Ò»ÐеÄ×îºó
[¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡ ÒƵ½Îļþ¿ªÊ¼Î»ÖÃ
]¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡ ÒƵ½Îļþ½áÊøλÖÃ
nh¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡Íù×óÒÆnλ
nl»òÕßspacebar ¡¡¡¡¡¡ ÍùÓÒÒÆnλ
nk¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡ÏòÉÏÒÆnÐÐ
n+¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡ÏòÉÏÒÆnÐУ¬¹â±êÔÚ¸ÃÐеÄÆðʼ
ni ¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡ ÏòÏÂÒÆnÐÐ
n-¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡ÏòÏÂÒÆnÐУ¬¹â±êÔÚ¸ÃÐеÄÆðʼ
H¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡ ÒƵ½ÆÁÄ»µÄ×óÉϽÇ
M¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡ ÒƵ½ÆÁÄ»µÄÖмäÐпªÍ·
L¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡ ÒƵ½ÆÁÄ»µÄ×îºóÒ»ÐÐ
G¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡ ÒƵ½ÎļþµÄ×îºóÒ»ÐÐ
nG»òÕß:n¡¡¡¡¡¡¡¡¡¡¡¡¡¡ÒƵ½ÎļþµÄµÚnÐÐ
nw¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡ÓÒÒÆn¸ö×Ö×飬±êµã·ûºÅÊôÓÚ×Ö×é
nW¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡ÓÒÒÆn¸ö×Ö×飬±êµã·ûºÅ²»ÊôÓÚ×Ö×é
nb¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡×óÒÆn¸ö×Ö×飬±êµã·ûºÅÊôÓÚ×Ö×é
nB¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡×óÒÆn¸ö×Ö×飬±êµã·ûºÅ²»ÊôÓÚ×Ö×é
Ctrl + u¡¡¡¡¡¡¡¡¡¡¡¡¡¡ÆÁÄ»ÉϾí°ë¸ö²Ëµ¥
Ctrl + d ¡¡¡¡¡¡¡¡¡¡¡¡ ÆÁĻϾí°ë¸ö²Ëµ¥
Ctrl + b ¡¡¡¡¡¡¡¡¡¡¡¡ ÆÁÄ»ÉϾíÒ»¸ö²Ëµ¥
Ctrl + F ¡¡¡¡¡¡¡¡¡¡¡¡ ÆÁĻϾíÒ»¸ö²Ëµ¥
ÐÞ¸ÄÖ¸Áî
r¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡ Ð޸Ĺâ±êÎļþµÄ×Ö·û
R¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡ ´Ó¹â±êλÖÿªÊ¼Ð޸ģ¬½áÊøʱ°´ESC¼ü
new¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡ ¸ü¸Än×é×Ö·û£¬½áÊøʱ°´ESC¼ü
ncc¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡ ´Ó¹â±êËùÔÚλÖÿªÊ¼¸ü¸ÄnÐУ¬½áÊøʱ°´ESC¼ü
ÖØÅŸ÷Ð㤶È
i¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡ ²¢°´Enter½«¸ÃÐÐÓɹâ±êËùÔÚ´¦¶Ï¿ª£¬²¢½øÈëinsert·½Ê½
J ¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡°ÑÏÂÒ»ÐеÄÊý¾ÝÁ¬½Óµ½±¾ÐÐÖ®ºó
Ñ°ÕÒÖ¸Áî
/text¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡ ´Ó¹â±êλÖÃÍùÏÂÕÒ×Ö´®text
?text¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡ ´Ó¹â±êλÖÃÍùÉÏÕÒ×Ö´®text
n¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡ ¼ÌÐøÕÒÏÂÒ»¸ö×Ö´®£¨ÔÚÊäÈëÉÏÃæµÄÑ°ÕÒÖ¸ÁîÖ®ºóʹÓã©
Ñ°ÕÒ²¢ÇÒÈ¡´úÖ¸Áî
:getxt1/s/ /text2/options ¡¡¡¡½«¸÷ÐеÄtext1Ì滻Ϊtext2
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡option=g±íʾÎļþÖÐËùÓеÄtext1¾ù±»È¡´ú£¬ÈôδÊäÈëÈκÎoption,ÔòÖ»ÓС¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¸÷ÐÐÖеĵÚÒ»¸ö³öÏÖµÄtext1±»È¡´ú
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡option=go ÔÚÆÁÄ»ÏÔʾ¸÷È¡´úµÄÐÐ
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡option=gc ÔÚÿ¸ö×Ö´®È¡´ú֮ǰҪÇóÈ·ÈÏ¡¡
Start,endgtext1/s/ / text2/options ¡¡Í¬ÉÏ£¬Ö»Ñ°ÕÒ²¢È¡´úµÚstart~endÐС£
»ò:Start,ends/text1/text2/options
¸´ÖƼ°Òƶ¯Îļþ
:first,last co dest ¡¡¡¡¡¡¡¡¡¡½«first µ½lastÐеÄÊý¾Ý¸´ÖƵ½Ä¿±êÐÐ(dest£©ÏÂÃæ
:Start,end¡¡m dest¡¡¡¡¡¡¡¡¡¡¡¡½«start µ½ endÐеÄÊý¾ÝÒƶ¯µ½Ä¿±êÐУ¨dest)Ï¡£¡¡¡¡¡¡
:r filename¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡ ½«Ö¸¶¨ÎļþµÄÄÚÈݶÁÈë¹â±êËùÔÚÐÐÏ¡£
nY ¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡ ½«¹â±êËùÔÚλÖÿªÊ¼µÄnÐÐÊý¾ÝÔÝ´æ
p¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡ ¸´ÖÆÔÝ´æÊý¾ÝÔÚ¹â±êµÄÏÂÒ»ÐÐ
P¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡ ¸´ÖÆÔÝ´æÊý¾ÝÔÚ¹â±êµÄÉÏÒ»ÐÐ
ÆäËûÃüÁî
.¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡ Öظ´Ç°Ò»Ö¸Áî
u¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡ È¡ÏûÇ°Ò»Ö¸Áî
Ctrl + l¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡Ë¢ÐÂÆÁÄ»ÏÔʾ
:set number¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡ ÏÔʾÎļþµÄÐкţ¬µ«²»»á´æÎļþ
:set nonumber¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡ ½â³ýÐкÅÏÔʾ
:set ai¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡ ÉèÖÃÿÐÐÆðʼλÖã¨ÒÔ¹â±êµ±Ç°Î»ÖÃΪÆðʼ£©
:set noai¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡ È¡ÏûÐÐÆðʼλÖÃÉ趨
:f »ò