ɾ³ý¡¢¸´ÖƼ°ÐÞ¸ÄÖ¸Áî½éÉÜ (´Ëµ¥Ôª½ÏÉÙʹÓÃ)
=========================
d(delete)¡¢c(change)ºÍy(yank)ÕâÒ»ÀàµÄÖ¸ÁîÔÚ vi ÖеÄÖ¸Áî¸ñʽΪ£º
Operator + Scope = command
(ÔËËã×Ó) (·¶Î§)
ÔËËã×Ó£º
d ɾ³ýÖ¸Áɾ³ý×ÊÁÏ£¬µ«»á½«É¾³ý×ÊÁϸ´ÖƵ½¼ÇÒäÌ建³åÇø¡£
y ½«×ÊÁÏ(×Ö×é¡¢ÐÐÁС¢¾ä×Ó»ò¶ÎÂä)¸´ÖƵ½»º³åÇø¡£
p ·ÅÖÃ(put)Ö¸ÁÓë d ºÍ y ÅäºÍʹÓ᣿ɽ«×îºódelete»òyankµÄ×Ê
ÁÏ·ÅÖÃì¶ÓαêËùÔÚλÖÃÖ®ÐÐÁÐÏ¡£
c ÐÞ¸Ä(change)Ö¸ÁÀàËÆdeleteÓëinsertµÄ×éºÍ¡£É¾³ýÒ»¸ö×Ö×é¡¢¾ä
×ÓµÈÖ®×ÊÁÏ£¬²¢²åÈëмü×ÊÁÏ¡£
·¶Î§£º
e ÓÉÓαêËùÔÚλÖÃÖÁ¸Ã×Ö´®µÄ×îºóÒ»¸ö×ÖÔª¡£
w ÓÉÓαêËùÔÚλÖÃÖÁÏÂÒ»¸ö×Ö´®µÄµÚÒ»¸ö×ÖÔª¡£
b ÓÉÓαêËùÔÚλÖÃÖÁÇ°Ò»¸ö×Ö´®µÄµÚÒ»¸ö×ÖÔª¡£
$ ÓÉÓαêËùÔÚλÖÃÖÁ¸ÃÐеÄ×îºóÒ»¸ö×ÖÔª¡£
0 ÓÉÓαêËùÔÚλÖÃÖÁ¸ÃÐеĵÚÒ»¸ö×ÖÔª¡£
) ÓÉÓαêËùÔÚλÖÃÖÁÏÂÒ»¸ö¾ä×ӵĵÚÒ»¸ö×ÖÔª¡£
( ÓÉÓαêËùÔÚλÖÃÖÁ¸Ã¾ä×ӵĵÚÒ»¸ö×ÖÔª¡£
{ ÓÉÓαêËùÔÚλÖÃÖÁ¸Ã¶ÎÂäµÄ×îºóÒ»¸ö×ÖÔª¡£
} ÓÉÓαêËùÔÚλÖÃÖÁ¸Ã¶ÎÂäµÄµÚÒ»¸ö×ÖÔª¡£
ÕûÐж¯×÷
dd ɾ³ýÕûÐС£
D ÒÔÐÐΪµ¥Î»£¬É¾³ýÓαêºóÖ®ËùÓÐ×ÖÔª¡£
cc ÐÞ¸ÄÕûÐеÄÄÚÈÝ¡£
yy yankÕûÐУ¬Ê¹ÓαêËùÔÚ¸ÃÐи´ÖƵ½¼ÇÒäÌ建³åÇø¡£
ɾ³ýÓëÐÞ¸Ä
==========
x ɾ³ýÓαêËùÔÚ¸Ã×ÖÔª¡£
X ɾ³ýÓαêËùÔÚ֮ǰһ×ÖÔª¡£
dd ɾ³ýÓαêËùÔÚ¸ÃÐС£
r ÓýÓ춴ËÖ¸ÁîÖ®ºóµÄ×ÖԪȡ´ú(replace)ÓαêËùÔÚ×ÖÔª¡£
È磺 ra ½«ÓαêËùÔÚ×ÖÔªÒÔ a È¡´úÖ®¡£
R ½øÈëÈ¡´ú״̬£¬Ö±µ½¡¶ESC¡·ÎªÖ¹¡£
s ɾ³ýÓαêËùÔÚÖ®×ÖÔª£¬²¢½øÈëÊäÈëģʽֱµ½¡¶ESC¡·¡£
S ɾ³ýÓαêËùÔÚÖ®¸ÃÐÐ×ÊÁÏ£¬²¢½øÈëÊäÈëģʽֱµ½¡¶ESC¡·¡£