砍敺 IT_man 2017-5-6 23:16 蝺刻摩
& y5 J3 u: f7 q1 d2 n# ?. ]1 k' N! X' ?. V2 ?
vi隞方牧(摰渡)
3 h% N' v9 T! y8 n # [ K% z1 O. j6 o; e
vi 靘拍車雿璅∪嚗頛詨交芋撘(insert mode)隞斗芋撘(command mode)嗡蝙刻脣 vi 敺嚗批唾冽隞斗芋撘銝嚗甇文駁萄乩隞颱摮 鋡怨箸隞扎冽迨璅∪銝舫脰芷扎靽格寧雿亥頛詨亥嚗脣亥撓交芋撘 - 頛詨交芋撘
: r; \6 b" S! g! l8 D# i! z
2 o& O o, S% `5 c9 g+ r 憒雿脣亥撓交芋撘2 O8 Y: X) a+ P
a (append) 望虜璅銋敺亥
$ @2 I) Y; x$ j- M% v q A 梯府銵銋怠亥/ A: I W2 K" v: l
i (insert) 望虜璅銋亥0 ]7 u X: _ x
I 梯府銵銋擐亥
2 j1 v- S w. w; l( D o (open) 啣銝銵潸府銵銋銝靘頛詨亥銋具
0 Q; P- N( v. h) k1 {5 O O 啣銝銵潸府銵銋銝靘頛詨亥銋具1 W9 q j, M5 C# |; `
憒雿a頛詨交芋撘
+ g! T' j' E$ r @7 n8 m* V ESC 蝯頛詨交芋撘
/ R$ s) t6 F7 i, X) i- 隞斗芋撘) U9 U- e6 l' L& p) i
2 r* X* `3 Q' |# @: ?1 [* q
1.皜豢銋蝘餃& P: r% D% c5 G0 U; F* k/ d
h 撌衣宏銝摮; L3 D: I* m) R3 [) _/ @# L
j 銝蝘颱摮- c4 B# O$ j3 n6 U2 Y: e
k 銝蝘颱摮" d' @2 [9 t& A" h0 D
l 喟宏銝摮
% c1 x0 i: A; Y$ _6 u7 m9 T; O 0 蝘餉唾府銵銋擐2 @% f' r7 w: P$ [. P8 X" Q+ G
$ 蝘餉唾府銵銋怒
3 B P) |3 D! T+ f ^ 蝘餉唾府銵蝚砌摮
" V* d! E: P& b: D' _5 c Q& \ H 蝘餉唾蝒蝚砌7 a/ n2 c4 y, q
M 蝘餉唾蝒銝剝2 z C+ L# j/ W/ l
L 蝘餉唾蝒敺銝( ?& N+ f# L$ ?3 j* ~0 u
G 蝘餉唾府瑼獢敺銝
; V+ \7 t7 r1 C/ { + 蝘餉喃銝蝚砌摮. q: R. \" u8 [) @1 M! E$ c5 s
- 蝘餉喃銝蝚砌摮, t- Y* I N% H! r/ P
( 蝘餉唾府乩擐 (閮颱)) M c/ f i% `5 H5 k; N
) 蝘餉唾府乩怒
+ B% @* Y7 B; d { 蝘餉唾府畾菔賭擐 (閮颱)' E. J" e2 y! T+ F5 F
} 蝘餉唾府畾菔賭怒. N# t5 X! t# R1 H" h. Y
nG 蝘餉唾府瑼獢蝚 n " k6 F0 ?0 ]4 l8 G# W- F7 h
n+ 蝘餉單虜璅其蝵桐敺蝚 n ' B7 Q2 k7 M- `# v
n- 蝘餉單虜璅其蝵桐蝚 n
- S# L# B1 i6 p, O8 k+ y) r; R <Ctrl><g> 憿舐內閰脰銋銵瑼獢蝔晞瑼獢銝剜怨銋銵皜豢刻雿蝮質銋曉瘥
9 b5 S& s/ i+ t! { 閮颱嚗亙(sentence)肖i銝剜舀隞乓嚗.嚗蝯銝銝脣
" d: u1 ]2 d6 ^0 b 閮颱嚗畾菔(paragraph)肖i銝剜舀隞亦征質摮
) t1 O5 `. }) e5 D
3 Z& c9 i. D Q! g2.閬蝒蝘餃 <Ctrl><f> 閬蝒敺銝脖; t c4 c0 v7 f5 y9 u6 ^
<Ctrl><b> 閬蝒敺銝脖
8 W# |: G: L6 ^. e; w <Ctrl><d> 閬蝒敺銝脣! q6 k2 X; ?& f: j# b
<Ctrl><u> 閬蝒敺銝脣$ P4 G8 w$ T( E
<Ctrl><e> 閬蝒敺銝脖銵0 j8 Y: u9 u6 y8 V+ r
<Ctrl><y> 閬蝒敺銝脖銵4 L/ K7 T8 ?/ N! }7 W0 K
! e* K+ Q% R% u0 ?4 o
3.芷扎銴鋆賢靽格寞隞支蝝 (甇文桀頛撠雿輻)
' `& Z% J4 j& {+ n' h& j d(delete)c(change)y(yank)銝憿隞文 vi 銝剔隞斗澆綽
, f6 Y& [" L8 s4 R$ w Operator + Scope = command
+ D/ X" z6 N% y* ^ (蝞摮) (蝭)* `* n; ?" Z5 R
蝞摮嚗( G. v7 ~5 o1 `( d* N
d 芷斗隞扎芷方嚗雿撠芷方銴鋆賢啗園蝺抵
; m! d" `* Z6 ]+ d3 V y 撠鞈(摮蝯銵亙畾菔)銴鋆賢啁楨銵
5 f. G; |0 s' g6 r5 B* {7 C8 W p 曄蔭(put)隞歹 d y 雿輻具臬敺deleteyank鞈
; I3 I! b$ m+ b0 G& B 曄蔭潭虜璅其蝵桐銵銝
7 `) g' Y& p" v- }7 X0 ] c 靽格(change)隞歹憿隡寮eleteinsert蝯芷支摮蝯6 ]% }4 j0 W& R6 ?! q0 T
摮蝑銋鞈嚗銝行交圈菔
+ `9 ^7 E; u9 C2 A' B+ o5 G 蝭嚗0 W9 V$ \4 U1 G) M% Z; F
e 望虜璅其蝵株唾府摮銝脩敺銝摮+ [! Y$ Q9 ?, V% H5 C
w 望虜璅其蝵株喃銝摮銝脩蝚砌摮* Z6 ^+ o0 j# p1 s! |
b 望虜璅其蝵株喳銝摮銝脩蝚砌摮, N/ o" s$ P# R0 ^4 S
$ 望虜璅其蝵株唾府銵敺銝摮
4 O" M$ C$ s. G$ {. O 0 望虜璅其蝵株唾府銵蝚砌摮
; T% B q- z, E7 s1 F( y; F ) 望虜璅其蝵株喃銝亙蝚砌摮
+ c( V, D& m5 D" y4 U ( 望虜璅其蝵株唾府亙蝚砌摮+ k4 R% Q( I1 _1 |' n5 _2 w+ T
{ 望虜璅其蝵株唾府畾菔賜敺銝摮
7 f: h9 _# T# c7 a" M: [8 [ } 望虜璅其蝵株唾府畾菔賜蝚砌摮, s1 ~" v* L; \
渲雿* D R' {" K8 O W$ F
dd 芷斗渲# V( Z" \0 P! S8 }, J% V
D 隞亥箏桐嚗芷斗虜璅敺銋摮
8 Z% F/ S- G, \7 x, r9 K9 q cc 靽格寞渲批捆( ? m C! Q" i" F& l6 h1 c" ~& Y. o
yy yank渲嚗雿踵虜璅刻府銵銴鋆賢啗園蝺抵
) x7 ]3 J. m$ o5 s: ^2 G+ K1 @1 x$ o+ j: e4 t- ^
4.芷方靽格. U; N$ z4 e7 S
x 芷斗虜璅刻府摮9 X3 l! n/ w, p5 I
X 芷斗虜璅其銝摮) s. f* U1 J! J2 p
dd 芷斗虜璅刻府銵9 X/ h c$ j e, r' M
r 冽交潭迨隞支敺摮隞(replace)皜豢典
# O# }3 {5 i$ A& E w" O 憒嚗 ra 撠皜豢典隞 a 隞銋7 i1 n) {: m3 k) u# i+ _* a( D6 _
R 脣亙隞嚗游啜ESC箸迫
0 T3 p% a% P; n. H' b s 芷斗虜璅其摮嚗銝阡脣亥撓交芋撘游啜ESC7 i, ?. `( s0 b% b& d6 J
S 芷斗虜璅其閰脰鞈嚗銝阡脣亥撓交芋撘游啜ESC* d8 d2 `; @) F: J, [
8 {0 e- A# U+ s( _- r5.祉宏銴鋆1 V! R5 q2 V7 V( v7 L( e$ L
拍牡elete put 隞文臬鞈祉宏銋桃$ r% b# \( i R0 R7 N% `
拍肘ank put 隞文臬鞈銴鋆賭桃
8 @9 T5 {3 J; r) A4 ? yank delete 臬摰鞈銴鋆賢啗園蝺抵嚗 put 隞/ t; D8 B3 l/ c* B' O/ [
臬蝺抵抒鞈銴鋆賢啗W銝# P' N0 v1 j# {1 i5 Y* g
靘嚗! E, c5 k5 M; Y* S
祉宏銝銵 批刻府銵瑁 dd
& V3 b1 c3 O2 X1 i6 v. T* n 扳虜璅蝘餉喟桃3 f ^1 B8 w: `, }8 N
批瑁 p9 g; s6 [/ P) }# [) Q& C
銴鋆賭銵 批刻府銵瑁 yy u% {0 @# i: z8 s" ]+ |
扳虜璅蝘餉喟桃
5 P# v1 Z( o* j0 D+ Y9 O, @ 批瑁 p
& f# v& J" m+ X7 m! u. X* ?( |% K
( u2 `& U0 `( W4 q6.隞日銴& S# |# h& t Z9 N
冽隞斗芋撘銝哨臬冽隞文W乩詨 n嚗甇斗隞文雿銴瑁 n
5 h( N2 K q, @# B! @ 甈∼- y5 d5 V) i* q" [; r& X) Q% ^* u
靘嚗2 p3 M& h) L% m1 N8 d- M2 O
芷10銵 10dd
# N* M3 Y1 a3 r! S0 y1 |) N( ~; Z) ` 銴鋆10銵 10yy7 Y6 D/ W: y% P
扳虜璅蝘餉喟桃
, ?9 ~; V: m' z$ y9 p# e+ T 吠6 c6 ?9 Z! F2 v7 Y e( Y9 E( d
璅敺銝蝘10銵 10j8 H+ }1 W) x5 t3 q
5 ]$ P/ X2 M! a% W/ K* u$ o; K, ?% V7.瘨銝雿(Undo)* |% u& V: d- I0 ?1 F: I, B
喳儔瑁銝銝隞文批捆, V+ X0 N6 i. ]* a+ }
u W儔敺銝隞支蝯
8 v1 t' n9 b% H- ` U W儔皜豢閰脰銋寡
' f, D; c% _4 |/ l1 W% V
/ j" [: e* S5 J/ l. O8.撠+ t1 W0 y0 I5 j% Q! Z+ g# X* {
肖i銝剖舀撠銝摮銝莎雿踵虜璅蝘餉唾府9 |+ h% G) L, C5 G j) g
/摮銝 敺皜豢銋敺撠曇府摮銝脯2 j5 x. A/ J2 H
?摮銝 敺皜豢銋撠曇府摮銝脯% c9 A Y1 r4 Z8 N% h5 N
n 敺銝蝜潛撠曆銝詨摮銝脯
: g) o. F" Q9 }9 e4 a! }/ o: F/ i5 r N 敺銝蝜潛撠曆銝詨摮銝脯
% F I5 e3 W; _2 e- C, y6 L' ~% @( i8 y( h t5 S: r# Y( h. {
9.鞈, ~) v$ H9 S: O @3 y7 S, e
J 亙乓撠皜豢其銝銝銵亥單虜璅閰脰敺U
# S2 P, w6 X R. \" s 交銵鞈憭芷瑚漲臬嗅抵嚗芾撠皜豢蝘餉喳暺嚗脣亥撓交芋撘
, ?7 l' h3 J( [ (臬拍災i蝑隞)Enter喳胯
1 L; h; ]' v8 b( c: C
, Q2 X y' Z! M" I+ V10.啣閮剖
) {+ X d2 J- i8 e! _5 S* ?4 \ 嚗setnu 閮剖鞈銵& m7 b( U, q/ @+ `/ j6 [! v
嚗setnonu 瘨銵閮剖
( }( Q+ i2 u0 w6 ?8 @, B 嚗setai 芸抒葬. U8 l6 \" Q! w0 s: }& o
嚗setnoai 瘨芸抒葬+ {" e( C1 b4 |+ S4 I- \
芸抒葬(automatic indentation)
; d: J K0 D- ] 函楊頛舀隞嗆蝔撘嚗圈閬抒葬瘜嚗嚗set ai單靘
* B8 R1 ^" l4 V4 u! @ 抒葬踝其靘閫銋嚗* G' H# H O |, P4 f
听i test0 Z- U ^& o. T s5 W
(脣亦楊頛航蝒敺), ?! t: q: K% H+ N
this is the test for auto indent
: ~0 E9 ^! n) P$ n Tabstart indent 嚗set ai (閮剛芸抒葬)
/ q5 J8 N- y$ j: v& I Tabdata& Z: J9 U5 ^* z$ n% p5 {, j" d9 g. n
Tabdata' k" ?" R# s V6 ~
Tabdata 嚗set noai (瘨芸抒葬)
f! C7 k6 m5 \ the end of auto indent.
$ [" T$ W' @$ ~ 扯酉嚗<Ctrl><d>臬芷扎Tab摮* C" p- W' z' q% w @. r2 i
: k- J* c4 I1 O( ?; Y4 Q
11.ex隞9 U+ \' Y! z, L3 @
霈撖怨+ s3 R) L6 P- ?6 u. S& h
嚗w 撠蝺抵鞈撖怠亦蝣銝准% N2 Q: M g t2 V
嚗10,20wtest 撠蝚10銵喟洵20銵鞈撖怠另est瑼獢
0 l$ Q) y9 Y. g 嚗10,20w>>test 撠蝚10銵喟洵20銵鞈系est瑼獢銋敺
) W' x+ K5 Z; G" N x: O4 x6 H 嚗rtest 撠test瑼獢鞈霈亦楊頛舐楨銵敺
1 ?' e7 N, e1 W 芷扎銴鋆賢祉宏- y0 v1 g9 z; t! o4 ]8 D$ s/ b
嚗10,20d 芷斤洵10銵喟洵20銵鞈
9 {, ?( O! m3 B" }( ? 嚗10d 芷斤洵10銵鞈
* n# x0 i, i; n- Y2 y 嚗%d 芷斗游蝺刻摩蝺抵
9 L% e( Q, n8 @& h 嚗10,20co30 撠蝚10銵喟洵20銵鞈銴鋆質喟洵30銵銋敺, E; \6 c6 g: O
嚗10,20mo30 撠蝚10銵喟洵20銵鞈祉宏喟洵30銵銋敺+ y4 Z8 u5 B, E, n! ~
摮銝脫撠隞
1 h, G; {, ^ n3 @ s(substitute)隞文舀撠銵蝭. S4 E( ^1 n5 J# a: X6 [1 i# K# i
g(global)隞文舀撠游蝺刻摩蝺抵鞈
3 i% v2 s3 j/ v6 x/ `# I s隞支誑蝚砌皛輯雲閰脫隞嗥摮銝脩箏嗅隞撠鞊∴亥府銵詨皛輯雲閰脫
* _' ~) g3 W2 S! d 隞嗥摮銝莎銋賢隞蝚砌嚗交喳隞摮銝脣銝g詻( C0 o% a( ~' s ^$ f
嚗1,$s/old/new/g 撠瑼獢銝剜old寞new, ]$ M2 q# B3 F, u' p% D2 C
嚗10,20s/^/ / 撠蝚10銵喟洵20銵鞈X5蝛箇賬
7 M( i; r3 }8 Q& S: x 嚗%s/old/new/g 撠蝺刻摩蝺抵銝剜old寞new- L* U( T9 `3 @6 C. F& w
8 @9 h9 U( Z) _; E( B, d12.W儔蝺刻摩鋡思葉瑞瑼獢
$ _! ?4 o, @& u( A+ L 函楊頛舫蝔銝哨亦頂蝯梁嗆蝺銝剜瘀蝺抵鞈銝阡; S2 d9 v+ e4 `! L
鋡怠神蝤蝣嚗嗅摨血啁頂蝯梧瑁銝隞文喳臬敺拐葉瑕
& K( m. ?4 K* { 瑼獢批捆8 ]1 A( y4 l; A0 L0 l* b
%vi -r filename6 v4 b. C; M$ z4 N
( x* G. g# L) L- p/ o& z5 m6 V13.蝺刻摩憭瑼獢
c! F, y8 R w, E+ b# U vi鈭行靘蝺刻摩憭瑼獢踝寞憒銝嚗! x- i) e1 }5 H- L/ U( o! j3 f
%vi file1 file2 ... l0 n1 _/ I& l
嗥洵銝瑼獢蝺其耨摰敺嚗臬拍具嚗w撠閰脩楨銵摮瑼嚗敺
; |# b/ B& e; \2 u$ N; J8 z 拍 嚗n頛乩銝瑼獢$ S1 w/ ^" L7 Z1 E
' R" v# P: Y/ [. j2 L:
0 J% r, D- f1 D
1 v+ m$ V5 F) P; Z: E$ w% Shttp://chunchaichang.blogspot.tw/2010/08/vim-s.html
0 U/ X9 Y1 q `. K6 H6 O8 W! ~. k |
|