没有合适的资源?快使用搜索试试~ 我知道了~
vim_cheat_sheet, vim使用手册
资源详情
资源评论
资源推荐
HOW-TO make Vim not suck Out of the Box: :help statusline :set nocompatible ruler laststatus=2 showcmd showmode number
Search
:set incsearch ignorecase smartcase hlsearch Remove useless splash screen
Best tips: http://vim.wikia.com/ Best scripts:
http://www.vim.org/scripts/index.php
:map <F9> :e $HOME/_vimrc<CR> :map <F6> :so $HOME/_vimrc<CR>
~
! # $ % ^ & * ( ) _ +
`•
13 1
2 3
3
4 5 6 7 8
8
9 0 - =
2
14
^w•
12 10 9
E R T• Y U I O P { }
e r t• y
0
2
u i
↱
o p
0
[• ]•
7 10 15
D F• G H J K L : "•
0
|
d
0
2
f• g•
6
h j k l ;
16
'• \•
\
Ctrl ^
7,11 9,16 15
Unused & Duplicate keys
Shift ⇧
13
14
15
Legend:
16
The search direction is relative; next is the initial direction, previous is the opposite direction. n ; repeat same initial direction find. N , repeat opposite initial direction find. Note: ; , only searches cursor line, n N searches buffer.
Register name (0-9a-zA-Z) required
:r file
insert file
\
:map \ :Explore<CR>
manually type <,C,R,>
Motion req.; act between cursor & dst
:w
save
:gui
switch to
GUI :ts
list active tags
§0
"• before del/copy/paste to use register
:buffers
list
Command
:q
quit
:q!
quit w/o save
^]
jump to tag under cursor
"+x
cut to system clipboard reg. '+'
blank file/buffer
Command and enter insert mode
:e <file>
edit file
^t
restore cursor before tag jump
"+gP
paste from system clipboard
:bn
next file
Moves cursor or defines range for op
:source % ^p
complete word
1
Number before any action repeats it
:bp
prev file
Search (↖ = reverse, ↘ = forward)
:exec '...'
do cmd
:ta Foo
manual jump to tag 'Foo'
2p
paste twice
3.
repeat thrice
:bd
close file
ctags / diffs / folding
2
Repeat op to act on current line
:bd!
force close
Code formatting, whitespace, etc.
soft
^
⇤ Start of Line
1st non-whitespace
yy
copy line
dd
del line
:set lines=#
Extended functionality; req. extra chars
hard
0
⇤ Start of Line
column 0
[c
prev diff
<<
undent line
>>
indent line
:set columns=#
Char arg req.
$
⇥ End of Line
]c
next diff
3
#
highlight words under cursor
:winpos # # GUI
:help modes |
move col 0
#|
move col #
:diffupdate
:hi DiffText gui=none
4
ZZ
save & quit
ZQ
quit w/o save
n Normal
Esc ^[ ^c
^b
page ↑
^f
page ↓
resync
:hi DiffDelete
5
zz
center cursor line in window
:help windows
i
Insert
a i r s
^u
½ page ↑
^d
½ page ↓
zh
scroll left
zl
scroll right
^w•
or
:wincmd •
v
Visual
v V ^v ^q
^e
scroll line ↑
^y
scroll line ↓
zt
scroll top
zb
scroll bottom
o Op pending
c d y < >
1g
start of file
0g
end of file
zR
fold remove
:changes
§6
gg
top of file
c Command Line
: / ? !
#g
goto line #
G
end of file
zo
fold open
g;
older change
gf
open file under cursor
word
( src ,
␢
,
␢
len );
[[
begin this func {
zc
fold close
g,
newer change
7
^a
incr # under cursor (Dec / Hex)
]]
begin next func {
zi
invert all
^x
decr # under cursor (Dec / Hex)
WORD
Foo
( src ,
␢
,
␢
len );
:set matchpairs=(:),{:},[:],<:>,?:\:
zr
fold reduce
8
*
start a "new" search
Startup
%
goto matching { } < > [ ]
zm
fold more
:syntax enable
vim <filename> +123
goto line 123
:set filetype= ^p ^n
next
vim <file> … -t Foo
edit at tag 'Foo'
:s/Foo/Bar
find Foo replace w/ Bar
c cpp sh make perl python
^d
undent
^t
indent
vim <file> … -c "/Foo"
cmd: find 'Foo' & edit
:s/Foo/Bar/g
...all instances on line
q•
start recording
Note:&chose&only&ONE&type!
^x• ^f
filename completion
:sp [<filename>]
GUI vim -g
or
gvim
start GUI ver.
:%s/Foo/Bar
apply to whole file
@•
playback
^s
spelling
:set spell!
edit in split window
GUI
Linux
:set guifont=ProggyTinyTT\ 12
cur line, cur line + # lines
q
stop recording
:set fileformat= ^k
dictionary
]s
next bad
GUI
OSX
:set guifont=ProggyTiny\:h11
$
last line
'<
start of select
@@
repeat
unix or dos or mac
^t
thesaurus
:help spell :marks ` ' ^o
diff
gvimdiff <file1> <file2> [<file3>] '>
end of select
then :w to convert
^r•
paste register 0-9a-zA-Z or …
ma
mark local 'a'
bug
Broken Keys Ctrl-I = Tab, Ctrl-[ = ESC
Code
= < > << >> :set tabstop=#
set tab stop every #th col
+
clipboard (or '*')
'A
goto global 'A'
Vim is still unable to map certain keys for your own use…
:set backspace=indent,eol,start :set expandtab!
toggle hard/soft tabs
"
last del/copy
%
filename
''
prev location
§
Caps, Ctrl-1, Ctrl-Shift-1, Ctrl-I, Ctrl-\, etc.
allow backspace join lines
:set listchars=…
tab:>-:trail:-,nbsp:%,eol:$
:set numbers!
toggle line numbers
0
See: src/ops.c -c "/valid_yank_reg" for "• reg. names
:set list!
toggle whitespace
:set wrap!
toggle linewrap display
:Explore or :e .
6
See: src/normal.c -c "/nv_cmds" for g• extra cmds
:set autoindent!
:set showmatch
highlite matching ()
11
See: src/edit.c -c "/ctrl_x_msgs" for ^x• insert cmds
:set lisp
lisp indent mode
noremap + :s/^/\/\//<CR>
block comment
noremap - :s/^\/\///<CR>
uncomment
one of
buffer last
:hi DiffChange guibg=#rrggbb
C
c
prev auto-complete
10
§11
12
Insert mode
q•
page ↑
Middle
screen
quit
4
← del char
change ⇥
V
select
lines
X
Ctrl /
Ctrl .
Ctrl ,
goto mark ⇤
register
end
word ↘
A
a
:help c_CTRL-R
z•
set mark
,
find
"next"
:help recording
:help changes
:help syntax
convert <eol>
:help tags
extra
5
del char →
b
change
0
2
select
chars
f/F/t/T
16
9
"prev"
:hi DiffAdd guifg=#rrggbb
Q
Ctrl 3
page ↓
prev
identifier
end
WORD ↘
del ⇥
del
goto
match
Tab
Caps
goto mark
incr. #
extern filter
append ⇥
subst line
subst char
@•
play
macro
W
w
append
scroll line ↓
copy line
half page ↑
Normal / Cancel
block select
find char →
extra
replace
char
← find char
Replace
scroll line ↑
half page ↓
Ctrl J
Ctrl M
↓
←
↓
Ctrl H
<
v
:help movement
B
↖ WORD
↖ word
N
n
"prev"
find
M
m•
Vim Cheat Sheet for Programmers
Ctrl =
Ctrl I
Normal
soft ⇤
next
identifier
copy
⇥
repeat :s
insert ⇤
ctags return
:redo
paste ⤓
↑
Ctrl _
Ctrl 5
Ctrl 4
:set shortmess+=I
Ctrl ^
Ctrl 7
Ctrl 8
http:/michael.PeopleOfHonorOnly.com/vim/
Copyleft&©&2011
May&be&freely&distributed!
Sharing&is&Caring.
paragraph
↘
Ctrl 9
Ctrl 0
paste ⤒
↖
paragraph
misc.
open ⤒
open ⤓
prev mark
undo line
undo
insert
⇤
goto col#
Ctrl \
hard ⇤
end
sentence
cur line
↑
↓
cmd line
file/cursor info
goto eof /
goto line#
until char →
ctags identifier
misc.
Ctrl ;
redraw
Top screen
man page
identifier
begin
sentence
← until char
Bottom
screen
Ctrl '
Join lines
auto-
format
"next"
f/F/t/T
Esc
Revision 2.0
Sept. 11, 2011
Z•
:set browsedir=…
→
↑
\ Ctrl-K Ctrl-S (free)
Ctrl-L (redraw)
` near dup of '
Ctrl-Q = Ctrl-V
Ctrl-J = Ctrl-M = ^N
undent
2
>
indent
2
?•
find ↖
.
repeat
cmd
/•
find ↘
:buffer #
Windows
Cursor Bookmarks
File / Directory
:new
Find
:help diff
:help folding
Vim 7.3+
:version
Ctrl 1
x
1
record
macro
window…
WORD ↘
word ↘
decr. #
Ctrl `
Ctrl @
:suspend
↰
s
toggle case
S
block select
ex mode
Normal
:set shiftwidth=#
indent width for ai
:help cmdline
toggle auto-indent
visible right margin indicator
Modes
Macro
Cmd
Code
•
:set colorcolumn=80
Ins
Move
Op
exec cmds in cur file
g z Z ^w ' " ` …
.,.+#
:help range
dst
Note: There is no whitespace in-between 'Foo(src,' but before/after 'dst,'
Foo
dst
Extra
tag
w!
c!
n!
s!
v!
o!
=!
h!
j!
k!
l!
!
:switch to next
:close!
:new
:split horz.
:vsplit vertical
:only maximize
all same size
move to win ←
move to win ↓
move to win ↑
move to win →
w!
c!
n!
s!
v!
o!
=!
h!
j!
k!
l!
!
:switch to next
:close!
:new
:split horz.
:vsplit vertical
:only maximize
all same size
move to win ←
move to win ↓
move to win ↑
move to win →
杜旭Duke
- 粉丝: 34
- 资源: 10
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
评论0