|
QUICKLY GETTING
STARTED |
MOVING FASTER |
Multi-File PERFORMANCE |
Start
Open/Close |
|
|
<esc>:q |
quit (without write) |
|
vim . |
navigate directory in netrw |
|
vim <filename> |
open filename |
|
|
|
<esc>:wq! |
force write of filename |
|
|
Movement |
|
|
h j k l |
left, down, up, right |
% |
find matching (), {}, [] |
gf |
Open file under cursor |
|
0 $ |
begin, end-of-line |
f<char> |
find char on line |
ga |
hex value under cursor |
|
w |
word |
|
Screen
Movement |
|
|
c-F c-B |
forward-page, back-page |
H M L |
move cursor high/mid/low screenline |
|
|
1G G |
Goto-line1, Goto-last-line |
10G |
Goto line 10 |
|
|
z<cr> |
Current line to top of screen |
z. z- |
Current line mid/bot of screen |
|
Undo |
|
|
u c-r |
Undo, Redo |
|
|
Modify
text |
|
|
i |
insert chars until <esc> |
r |
replace one characters |
i c-r=2.1+7<cr> |
Compute # to insert(RealNum) |
|
A |
Append chars at EOL until <esc> |
|
|
|
x |
delete character |
|
|
|
5x |
delete 5 charaters |
|
|
Modify
lines |
|
|
dd |
delete line |
D |
delete to EOL |
df<char> |
delete to char on line |
|
3dd |
delete 3 lines |
|
|
|
d0 d$ |
delete to BOL, delete to EOL |
|
|
|
J |
join two lines |
|
|
Copying
lines |
|
|
yy p |
yank line paste
line(after) |
c-v <select>y |
blockwise selection mode |
"+3yy |
Yank 3 lines to system buffer |
|
mt y't p |
markline-t yank to t, paste lines |
mt y`t p |
markchar t, yank to char t,
paste |
`t |
move to markchar-t |
|
|
mt"[a-z]<move>y't |
yank marked-t to buffer [a-z] |
|
|
"ap |
paste buffer a |
Searching |
|
|
<esc>/string/b-1 |
find string-cursor before begin |
|
* # |
Find word under cursor next/prev |
|
<esc>/string[0-9]/e+1 |
find string-cursor 1 char after end |
|
. * ^ $ \ [ ] |
Metacharacteris must be quoted with \ |
|
n N |
next search, previous search |
|
alnum alpha blank |
Character classes |
Search
& Replace |
|
|
<esc>:%s/old/new/g |
substitute new for old globally-on-line |
~ |
change case |
|
Macros |
|
|
. |
repeat last command |
t b e v |
macrokey t-till, b-backw, e-endw, v-vis |
:!command |
execute command |
|
<esc>:map t d0n |
map character to commands |
qa ….. q @a |
record macro to a, @execute macro a |
:1,44!sort |
sort and replace lines 1 thru 44 |
|
:<uparrow> |
edit last mapped key |
noremap t @a |
map keystroke 't' to recorded macro a |
:map t=c-r c-r char…edit |
Map keystroke 't' to value(macro) |
|
:reg @[char] |
View macro register |
LINE2: tabe | read !dir b* :exe getline(2) |
Execute Line2 output to newTab
|
|
c-v <ESC> |
insert ascii char (CR:c-vc-m , LF: c-vc-a) |
:let i=1 q[char]
:let i+1=1<cr>I c-r =i<cr>q |
Count up insert |
Help |
|
|
c ->        c <- |
Move next topic on help |
<tab> |
Next topic |
:help index |
show all help keys |
|
:help ^v |
help for ctrl-v (use
literal ^, not ctrl) |
c-] c-T |
Descend-into-Topic
Upscend-Topic |
help grep |
Use grep to find help |
|
c-w c |
close help window |
:tab help <topic> |
Open help in new tab
(:tabclose) |
|
Startup |
|
STARTUP |
|
BUFFERS, REGISTERS |
|
:set tabstop=4 |
|
:tab $MYVIMRC |
edit startup file in new tab |
[a-z] |
buffers |
|
filetype indent off |
|
|
|
:set list |
show: tabs, CR, LF |
syntax enable |
|
[1-9] |
deletion registers |
|
:set shiftwidth=4 |
|
set noeb vb t_vb= |
no error bell |
p1 |
paste deletion register 1 |
|
:set showmatch |
|
set hlsearch |
|
:reg |
show all reisters |
|
:expandtab |
|
map <f7> mt.^'tj |
|
:marks |
show all bookmarks (i.e. mt) |
EXEC |
|
|
:browse oldfiles |
browse old files |
:e file1 file2 |
Open file1 and file2 in buffers |
|
:x |
write and quit |
:n :p |
next file in args, prev file in args |
|
:w |
write to new filename |
:args |
list files opened |
|
:.,$w <filename> |
write curline to EOF into filename |
:bn :bp :bd |
next buf, prev buf, delete buf |
|
:.r<filename> |
append file to EOF |
:.,$w >><filename> |
append curline to EOF into filename |
|
|
:set binary |
used before editing binary file |
|
TABS |
|
WINDOWS |
|
|
:tabnew filename |
|
:vsplit |
Vertically split window |
|
:tabclose |
|
c-wj c-wp |
next/prev window |
|
c-pgdn c-pgup |
Move to tab next/prev |
c-wc |
close window |
|
:tabedit <filename> |
new tab with explorer(netrw) |
c-ws-< c-ws-> |
change window width |
NETRW |
|
|
:tabedit . |
start NETRW, select file to edit |
vim . |
open netrw on current directory |
|
|
-
<CR> |
up directory, descend
directory |
|
|
<CR> :RE |
Open file Retrun
from file |
|
|
% d |
Create file, Create
directory |
|
|
R D |
Rename Delete
file/dir |
|
|
|
|
|
|
|