砍敺 IT_man 2017-5-6 23:16 蝺刻摩 ! r. F( O8 [! I0 a
- p5 R' M! F9 u2 Q6 P: ^
vi隞方牧(摰渡)
! I# ]. N4 F1 y' q3 P3 H- vi 雿璅∪6 p% P6 v* f2 S1 b" o' Z( M
6 K5 ?, d- G/ M; [( a7 c+ H; o
vi 靘拍車雿璅∪嚗頛詨交芋撘(insert mode)隞斗芋撘(command mode)嗡蝙刻脣 vi 敺嚗批唾冽隞斗芋撘銝嚗甇文駁萄乩隞颱摮 鋡怨箸隞扎冽迨璅∪銝舫脰芷扎靽格寧雿亥頛詨亥嚗脣亥撓交芋撘 - 頛詨交芋撘6 L% x. ~( M# v- f+ `2 V! o
& ^! H" L* t2 E- c. ]
憒雿脣亥撓交芋撘
0 l0 D( |* h5 f a (append) 望虜璅銋敺亥: Y/ S6 N0 j/ T
A 梯府銵銋怠亥
! O: y4 m" @ ^( U* ` i (insert) 望虜璅銋亥5 V8 o$ Q# M( w" q, H) m9 y, ^: D' P
I 梯府銵銋擐亥
- I( M ]1 @6 w$ ]" y% P o (open) 啣銝銵潸府銵銋銝靘頛詨亥銋具
% P2 y8 z2 t! I9 e7 Z O 啣銝銵潸府銵銋銝靘頛詨亥銋具
7 n, T# R% u+ f6 l" ? 憒雿a頛詨交芋撘
% D% \ J" ? {& u0 t5 w ESC 蝯頛詨交芋撘
% U1 l" P) B: k/ V' A: f% T- 隞斗芋撘
& Y) m6 @4 o q$ {* T
& K _; D b; a( o
1.皜豢銋蝘餃
3 @+ w, H- Z% a8 G h 撌衣宏銝摮
% @* j0 o) y( }" g0 f j 銝蝘颱摮- {- p- H/ o8 ~" N- ^' V
k 銝蝘颱摮! @1 b8 g# `, v- T
l 喟宏銝摮6 S/ [" ^! v8 ]
0 蝘餉唾府銵銋擐
- p5 p6 M5 p3 G0 _7 X" S $ 蝘餉唾府銵銋怒+ R, e. j# D4 I# u6 u
^ 蝘餉唾府銵蝚砌摮
7 f$ B/ X, p" @6 u H 蝘餉唾蝒蝚砌. ]. N! P' L' G4 p, o5 g J
M 蝘餉唾蝒銝剝7 k' a# g6 f2 O3 L. y, V4 u* `
L 蝘餉唾蝒敺銝
( ]6 M% A9 |7 a9 ?; ?# c* U5 [5 a G 蝘餉唾府瑼獢敺銝9 C, _- z$ E, J( P2 ^- D* |' `
+ 蝘餉喃銝蝚砌摮
1 f4 d/ `' h4 }6 D$ z - 蝘餉喃銝蝚砌摮9 e( W& } L% r' a- w, [- s
( 蝘餉唾府乩擐 (閮颱)
9 ]& S& J" Q" q$ l7 t" _ ) 蝘餉唾府乩怒" N6 L7 a8 j1 g0 N7 G9 I
{ 蝘餉唾府畾菔賭擐 (閮颱)
7 T) Y- ]6 }% o } 蝘餉唾府畾菔賭怒
% w% u! }( l2 b, [5 P nG 蝘餉唾府瑼獢蝚 n - D) s& X, |$ T
n+ 蝘餉單虜璅其蝵桐敺蝚 n
, C" ~1 K2 c6 G8 L; K n- 蝘餉單虜璅其蝵桐蝚 n
& v4 R( n" o3 @% d( F* C, R1 e0 {6 O <Ctrl><g> 憿舐內閰脰銋銵瑼獢蝔晞瑼獢銝剜怨銋銵皜豢刻雿蝮質銋曉瘥' T9 G q: l6 }1 t
閮颱嚗亙(sentence)肖i銝剜舀隞乓嚗.嚗蝯銝銝脣2 e! @% [# u* E. i3 C* X
閮颱嚗畾菔(paragraph)肖i銝剜舀隞亦征質摮* v6 C5 t7 Q6 d7 K
5 b/ d4 j+ A8 r- C U
2.閬蝒蝘餃 <Ctrl><f> 閬蝒敺銝脖
' P4 X( m6 |3 |8 W- x1 ^ <Ctrl><b> 閬蝒敺銝脖
. b1 i: u4 w5 r- | <Ctrl><d> 閬蝒敺銝脣$ r% e- R% U$ J* n3 y8 Q1 y, x8 r
<Ctrl><u> 閬蝒敺銝脣
+ Q& r8 D, ^5 M: s4 m) q <Ctrl><e> 閬蝒敺銝脖銵
$ B6 o$ C, [/ I4 G <Ctrl><y> 閬蝒敺銝脖銵1 [( f- ?. c9 y1 e4 d% X. [$ p, ~
. m$ f/ D0 A+ w$ R3.芷扎銴鋆賢靽格寞隞支蝝 (甇文桀頛撠雿輻); K, ]5 @9 |0 C% y, W, ]7 o9 g
d(delete)c(change)y(yank)銝憿隞文 vi 銝剔隞斗澆綽
5 R5 i/ ?# n- l/ N Operator + Scope = command. X# \# u/ J/ y9 |$ _% I
(蝞摮) (蝭)3 u" @$ W# l8 C9 y
蝞摮嚗
, S5 n- G! f2 P, E: d) B4 W) `# l! g d 芷斗隞扎芷方嚗雿撠芷方銴鋆賢啗園蝺抵
' C! A" F) T, @# \9 C( W: c9 M: [ p y 撠鞈(摮蝯銵亙畾菔)銴鋆賢啁楨銵- ^* W& D$ \# @! a8 f
p 曄蔭(put)隞歹 d y 雿輻具臬敺deleteyank鞈
+ X) i) r2 a2 k) I- {7 d) D 曄蔭潭虜璅其蝵桐銵銝* E2 m8 w4 k2 k; T. _
c 靽格(change)隞歹憿隡寮eleteinsert蝯芷支摮蝯
8 {+ Q* X" s& R& K# q 摮蝑銋鞈嚗銝行交圈菔: K( D1 v" w1 Q0 `4 `+ [3 q+ U) k3 }
蝭嚗/ o4 w2 L/ P! i2 L6 z
e 望虜璅其蝵株唾府摮銝脩敺銝摮
# }% w D' v9 t1 U w 望虜璅其蝵株喃銝摮銝脩蝚砌摮' @$ S% B( f; k% s7 ]9 J
b 望虜璅其蝵株喳銝摮銝脩蝚砌摮) \( H2 w& `6 z8 j) {1 d1 ^7 Z7 ^. d" W
$ 望虜璅其蝵株唾府銵敺銝摮! O' `( S# x% W7 \
0 望虜璅其蝵株唾府銵蝚砌摮7 F2 R) o* Z/ N8 N: @
) 望虜璅其蝵株喃銝亙蝚砌摮
1 {; Z3 V8 y/ k ( 望虜璅其蝵株唾府亙蝚砌摮4 e7 k8 h! r" z3 n; v
{ 望虜璅其蝵株唾府畾菔賜敺銝摮
' R' Y" A6 ]) P. b: K% ^ } 望虜璅其蝵株唾府畾菔賜蝚砌摮$ F/ b" A- m8 t) D0 I0 E
渲雿
0 z3 U6 H2 {: |% J$ ? dd 芷斗渲
& M9 j- r2 e4 D* H( ~7 M: O D 隞亥箏桐嚗芷斗虜璅敺銋摮- x, M8 T& Z1 U! P
cc 靽格寞渲批捆
* U! u( N+ ^% Q, K% L yy yank渲嚗雿踵虜璅刻府銵銴鋆賢啗園蝺抵* P% w+ T4 p9 s! ^, A0 Q
& T6 F, z+ N0 T
4.芷方靽格8 u4 R5 ~* F0 P
x 芷斗虜璅刻府摮
$ }2 J2 `) L D* M7 k1 V X 芷斗虜璅其銝摮% I% Y% {$ T9 n0 `
dd 芷斗虜璅刻府銵# T0 ^8 g" e& P/ D
r 冽交潭迨隞支敺摮隞(replace)皜豢典
8 J% Z$ n% g; ~4 h 憒嚗 ra 撠皜豢典隞 a 隞銋
7 {( c |: q9 b R 脣亙隞嚗游啜ESC箸迫1 k5 j# j* L1 U# b) C( m
s 芷斗虜璅其摮嚗銝阡脣亥撓交芋撘游啜ESC
* Y9 F* `; C: M# i# W, w# s S 芷斗虜璅其閰脰鞈嚗銝阡脣亥撓交芋撘游啜ESC( h7 w9 _% w% Q. G7 A$ d2 l
, C5 e& l5 x7 B; B/ x i1 h5 u- r# r
5.祉宏銴鋆
. ~3 A5 m) ` B/ R; @ 拍牡elete put 隞文臬鞈祉宏銋桃
/ v' ?; O6 }5 m% b8 C 拍肘ank put 隞文臬鞈銴鋆賭桃 w* m, c9 O& V9 c8 O
yank delete 臬摰鞈銴鋆賢啗園蝺抵嚗 put 隞
! \2 Y& x& o# z 臬蝺抵抒鞈銴鋆賢啗W銝% n+ K4 C* h# I, r
靘嚗& k4 Z' n% Y) `( W( d9 V* w
祉宏銝銵 批刻府銵瑁 dd
. ^7 z2 w* K, R 扳虜璅蝘餉喟桃
& e- O: r4 g0 ?: g3 g1 N 批瑁 p
+ q4 S) A0 ~9 K4 k# { 銴鋆賭銵 批刻府銵瑁 yy
& ]- y3 X, F" G+ r 扳虜璅蝘餉喟桃3 l" i) `2 x1 N+ Q4 `* f2 |
批瑁 p# w/ b3 z* _6 r2 x/ q" a
! Q! l0 _) }+ W2 D& K6.隞日銴
# C' F. P4 P; v v) o 冽隞斗芋撘銝哨臬冽隞文W乩詨 n嚗甇斗隞文雿銴瑁 n1 e H2 s! h# h5 `
甈∼
8 T# k% M( b8 B0 X3 O 靘嚗* t7 f8 [3 P8 y5 n8 `
芷10銵 10dd
% N4 m% O" X% I7 ~7 b9 P, B 銴鋆10銵 10yy9 R$ k% q# Y6 b6 J5 L5 a0 K& V
扳虜璅蝘餉喟桃
- q# _' x( v3 c. N 吠
3 g }7 ~' Y, ^4 Q 璅敺銝蝘10銵 10j7 a1 ~7 h" f2 N5 l, p T- l7 U
: j. V; W" H/ ^
7.瘨銝雿(Undo)
5 m% V. p* a5 i" a7 R( H+ n 喳儔瑁銝銝隞文批捆
( V3 _: B/ i6 C9 E1 V, ` o u W儔敺銝隞支蝯# X/ A! B2 [, n3 G& O
U W儔皜豢閰脰銋寡 M( `9 E! I* @- a
5 Y" {) f' T+ [: I# P8.撠
. s- h, T2 L. D+ j. V 肖i銝剖舀撠銝摮銝莎雿踵虜璅蝘餉唾府
) p+ h# B' H) E# M8 X /摮銝 敺皜豢銋敺撠曇府摮銝脯
9 ]- s5 h& {: C* p4 K2 s ?摮銝 敺皜豢銋撠曇府摮銝脯
5 J- S5 G K# D8 y+ F8 H n 敺銝蝜潛撠曆銝詨摮銝脯
& t! Z1 @0 S$ O N 敺銝蝜潛撠曆銝詨摮銝脯. {( |7 d: a2 ^( |9 H
) b# j! Y- t1 }" t3 w' A! \. d9.鞈
: S8 \. i" \, `0 K8 O* q9 D3 y, e4 @6 j J 亙乓撠皜豢其銝銝銵亥單虜璅閰脰敺U
* r# P; h' P/ |# C6 |4 P2 \ 交銵鞈憭芷瑚漲臬嗅抵嚗芾撠皜豢蝘餉喳暺嚗脣亥撓交芋撘
" l: o' D1 S1 B. h+ \ (臬拍災i蝑隞)Enter喳胯" z/ e* V6 Y: r& V' [5 o
3 T1 P$ k# y. B" f
10.啣閮剖
, Z& ~+ `+ _, W% @# M3 G 嚗setnu 閮剖鞈銵
: s( H# P# j6 i: y) \4 ~ 嚗setnonu 瘨銵閮剖+ t; W( F0 J9 X6 _. {
嚗setai 芸抒葬
; ]. W6 S0 R/ C, M9 j+ C 嚗setnoai 瘨芸抒葬
; V1 q* H S; Q 芸抒葬(automatic indentation)
( f0 r. k( R: \* } 函楊頛舀隞嗆蝔撘嚗圈閬抒葬瘜嚗嚗set ai單靘3 b( T: e; B* d9 R' M
抒葬踝其靘閫銋嚗
; w l8 R6 L0 F. h4 b 听i test
* D* ?$ O- n* a8 T& V& b (脣亦楊頛航蝒敺)
8 R/ `9 M9 O. U* D. p- P, G this is the test for auto indent
! B, n \! C I- l' h Tabstart indent 嚗set ai (閮剛芸抒葬)
. ~- `/ U3 e N0 x9 e* @6 ? ? Tabdata8 G+ f" _* P- n9 f2 G
Tabdata
" v, Q& v8 `% J Tabdata 嚗set noai (瘨芸抒葬)& O5 p! W; y2 _$ `: i
the end of auto indent.+ ^5 Y0 E) ^: o0 F
扯酉嚗<Ctrl><d>臬芷扎Tab摮/ \6 X" H9 u1 N/ D2 s% C4 ?# X
0 m- U3 V5 K& Z- d8 u2 j0 @11.ex隞
p0 ?; f1 T. q5 ] D+ J 霈撖怨- Q0 Q' C0 B* J* S
嚗w 撠蝺抵鞈撖怠亦蝣銝准
4 g# Y6 K$ {3 V4 g9 b 嚗10,20wtest 撠蝚10銵喟洵20銵鞈撖怠另est瑼獢
" s( t1 p, Y; V! d3 N! | 嚗10,20w>>test 撠蝚10銵喟洵20銵鞈系est瑼獢銋敺/ K/ }: M, N; _' n4 L3 t: ~
嚗rtest 撠test瑼獢鞈霈亦楊頛舐楨銵敺2 G/ @+ Q7 X% q7 K* J! j; f9 V1 m
芷扎銴鋆賢祉宏; D' T" Z. d' W: J* a; e$ G$ H: T
嚗10,20d 芷斤洵10銵喟洵20銵鞈
3 Y1 z* U; Q4 }$ p 嚗10d 芷斤洵10銵鞈
1 I/ n5 Q# T3 |; N9 A6 S! U 嚗%d 芷斗游蝺刻摩蝺抵
: J9 Y, D' r& |8 d5 s 嚗10,20co30 撠蝚10銵喟洵20銵鞈銴鋆質喟洵30銵銋敺8 I: V' N, `' E" s8 J5 L( O% _! a
嚗10,20mo30 撠蝚10銵喟洵20銵鞈祉宏喟洵30銵銋敺
) U* X3 D6 }! E w( v6 ] 摮銝脫撠隞/ M' ?& G7 \3 H) `( G. S
s(substitute)隞文舀撠銵蝭
( j+ `, t+ a8 E8 f: G; n g(global)隞文舀撠游蝺刻摩蝺抵鞈% v t$ G3 M& }2 J% m
s隞支誑蝚砌皛輯雲閰脫隞嗥摮銝脩箏嗅隞撠鞊∴亥府銵詨皛輯雲閰脫
% A/ y6 W- s# ], l! _/ a) @' N 隞嗥摮銝莎銋賢隞蝚砌嚗交喳隞摮銝脣銝g詻2 B% E' P! k& h2 l7 Y; J2 e
嚗1,$s/old/new/g 撠瑼獢銝剜old寞new9 y9 n6 f! ~, T
嚗10,20s/^/ / 撠蝚10銵喟洵20銵鞈X5蝛箇賬
7 ^; p$ x9 j- @, R: H% e+ \+ g 嚗%s/old/new/g 撠蝺刻摩蝺抵銝剜old寞new
% v$ A* f' q% T6 ]! t5 d, H
) z" b4 J% j8 H/ w1 L2 ?/ p2 ?5 n12.W儔蝺刻摩鋡思葉瑞瑼獢5 ]* H& g, u2 T& o; f
函楊頛舫蝔銝哨亦頂蝯梁嗆蝺銝剜瘀蝺抵鞈銝阡
9 O) K0 r8 G2 J4 @& T( k 鋡怠神蝤蝣嚗嗅摨血啁頂蝯梧瑁銝隞文喳臬敺拐葉瑕& d4 G# {% s: J
瑼獢批捆$ z0 b5 X, ?% d' B* e/ T" D* ^
%vi -r filename4 x, F$ C3 V% m5 G/ _$ G2 i3 M
# e# w% e& w2 I13.蝺刻摩憭瑼獢
& K7 N& ?4 V1 |0 n" v% l vi鈭行靘蝺刻摩憭瑼獢踝寞憒銝嚗
# b) R8 F2 f! x6 \: ^7 } %vi file1 file2 ..% Z4 l1 A& @, X4 q0 _% P
嗥洵銝瑼獢蝺其耨摰敺嚗臬拍具嚗w撠閰脩楨銵摮瑼嚗敺" Y. i4 w0 y% G$ H
拍 嚗n頛乩銝瑼獢
8 v, E G8 ?; x6 m }" x( q: @+ k1 E; l" [, f
:7 n5 J. u% g' F8 V( [7 P
% O- J) |$ p5 A/ e6 Q
http://chunchaichang.blogspot.tw/2010/08/vim-s.html- r- U; p' F* h" h( V
|
|