2013/10/05

vimのチートシート

! warnings を無視
(action)(times)(object) actionをtimes回objectにする

** Insert
i a カーソルの前/後に挿入
I A 行頭/行末に挿入
O o 今/次の行に挿入

** Visual-mode
v V C-v char/line/block visual mode
u U lower/uper case
~ inver case
> < increase/decrease indent
iw iW inner word/Word
aw aW word with space
is as inner/a sentence
ip ap inner/a paragraph
i( i) a( a) inner/a (...)
i< i> a< a> inner/a <...>
i" a" inner/a "..."
i` a` inner/a `...`


** Move
( ) sentence back/forward
{ } paragraph back/forward
%
| 0 $ begin/end line
gg G begin/end file
nG nth line
H M L top/middle/bottom screen
zt zz zb where cursor is top/middle/bottom
C-e C-y scroll down/up line
C-d C-u scroll down/up half page
C-f C-d scroll down/up page
0 ^ g_ $ begin/first char/last char/end of line
gE ge w W previous/next word
B b e E begging/end of word
[( ]) goto ( )
[{ ]} goto { }
(this is { a test (once more ) middle} end)
fc Fc forward/backward of c
; repeat char
, reverse char
# prev identifier
* next identifier


** Edit
x X delete forward char/backword char
D delete end of line
dd delete line
yy Y yank line
y$ yank end of line
yw yank word
C change enf of line
cc change line
cw change word
R replace mode
r replace char
s substitute
S substitute line
p P paste before/after
. repeat
u U undo last change/ all changes of line


** Replace
:s/pattern/string/gc
g all
c comfirm
& repeat :s


** Marker
mc marker c
`c goto beggining in c
'c goto first non-blank char in c

** Search
/ ? search forward / backward
n N search forward / backward

** Macro
qc record macro
@c do macro


** Command
:w 保存
:zz 保存して終了
:r 読み込み
:n 次のファイルへ
:p 前のファイルへ
:e 編集

C-] goto definition (VsVim)

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.