1vim*
NAME
vim,command \- command line editor
================================================================================
CURSOR MOVEMENT {{{1
w
W
b
B
0
^
$
================================================================================
EDITING {{{1
dd
dw
D
J
xp
u
\.
Delete line
Delete word
Delete from cursor to the end of the row
Join the line below to the current one.
tranpose two letters (delete and paste)
undo
repeat last editing command
================================================================================
VISUAL MODE (MARKING TEXT) {{{1
v
start a visual mode
V
start a line visual mode
Ctrl + v start visual block mode
Visual block mode
Modifications in one line are done in all lines. To put a block comment, press c
trl+v, select lines, type I and type //. The escape. all lines will be commented
.
In
>
<
y
d
~
visual mode
shift right
shift left
yank marked text
delete marked text
switch case
================================================================================
AUTOCOMPLETION {{{1
Ctrl + x Ctrl + <key> insert mode
Activate autocompletion mode (^x mode). You can type as key the followin
g to do autocompletion
Ctrl + n
Token autocompletion. Can be used without typing Ctrl + x before.
Ctrl + l
line autocompletion
Ctrl + f
file autocompletion. Autocomplete word with the name of file of the current path
.
================================================================================
MACROS {{{1
Macros are stored in registers.
Modify a macro
If the macro is in register reg type in a new line.
"reg p: print the register (so the macro).
Modify the command
0"reg y$: Move to the beginning of the line, copy the entire line to the registe
r
q <macro_name> <record_macro> q
Only one letter name is permitted.
x@<macro_name>
Executes the macro x times (without the x only 1 time is executed).
================================================================================
BOOKMARKS {{{1
m<bookmark_name>
Assign <bookmark_name> as a bookmark (only one letter).
'<bookmark_name> (this apostrophe is in ? key)
Goes to exact position.
`<bookmark_name> (this apostrophe is in key at the right of p)
To go to macro beginning line position
:marks
Show all bookmarks.
Default
'
[
]
<
.
>
.
bookmarks
position before of the latest jump or where last m was given.
To the line first character of the previously modify or yanked.
same as [ but with last.
First line first selected character in the last visual mode visual mode
same that < but with last.
position where the last change was made.
================================================================================
EX COMMANDS {{{1
:[execute] 'com1' | 'com2'
executes com1 and then com2
:normal normal_mode_command
================================================================================
LINE COPY {{{1
yy
Copy the current line.
"ayy
Copy the current line to a. First is necessary to do "a to prepare a as a buff
er.
"Ayy
Copy the current line to a concatenating it with the previous stuff.
================================================================================
COMMAND HISTORY {{{1
:his
Show the command history
:his /
Search in the command history
q: or q/
Opens command history in an editor window (the second options is for searches).
You can edit a command from that windows and execute it typing return. To exit,
press Esc twice or Ctrl+c.
================================================================================
OTHER COMMANDS {{{1
Ctrl + o (in insert mode)
Allow to introduce a vim command and then getinto insert mode again.
gq
reflow. Correct the format of the text. For example, if one addition caused the
text to overcome the wrap width.
=
fix indentation. gg=G (go to beginning of the file, fix identation until the end
of the file).
================================================================================
DIGRAPHS AND CODES {{{1
To insert a digraph you must type Ctrl+k before to type the code . With the
Ctrl + v option is possible to instroduce non-printable characters like <return
>.
:set [no]digraph
Activate [deactivate] another form to insert digraph. The form is char1 <BS> c
har2 where <BS> means backspace (delete key)
Ctrl+k <digraph_code> (In insert mode)
Insert the digraph that corresponds to <digraph_code>.
Ctrl+v {u|x} <code> (In insert mode)
Insert a digraph or character by its {unicode|hexadecimal} code. Hexadecimanl ad
mits 2 numbers, unicode 4.
square
^v u 25a1
schwa
^v u 018f
GENERAL {{{2
x
x
plus minus
superscript
subindex
coproduct
summation
dot product
square root
inifinity
left arrow
right arrow
up arrow
down arrow
Code: +Code: 2S
Code: 2s
Code: *P
Code: +Z
Code: Sb
Code: RT
Code: 00
Code: <Code: ->
Code: -!
Code: -v
for all
partial differential
there exists
logical and
logical or
empty set
in, element of
integral
double integral
nabla
tilde operator
approximately equal to
not equal
less than or equal to
greater than or equal to
Code:
Code:
Code:
Code:
Code:
Code:
Code:
Code:
Code:
Code:
Code:
Code:
Code:
Code:
delta
theta
i
sigma
hi
Code:
Code:
Code:
Code:
D*
H*
P*
*
Code:
*
FA
dP
TE
AN
OR
/0
(In
Code:
NB
?1
?=
!=
=<
>=
DI
}}}2
hi
omega
lph
et
elta
psilon
ambda
mu
ho
au
si
Code:
f*
Code:
W*
Code:
*
Code:
*
Coe:
*
Cod:
*
Code:
*
Code:
m*
Code:
*
Code:
*
Code:
:unma [!] ke
Remove ke fom ma s.
"kes in ma ing"
You can en e kes i ea. To inse
h ://vim.wikia.com/wiki/Ma ing_kes_in_Vim_-_Tu oia_(Pa _1)
h ://vim.wikia.com/wiki/Ma ing_kes_in_Vim_-_Tu oia_(Pa _2)
================================================================================
ABBREVIATION {{{1
'':[ic!]ab'' ma _ke con en
When ou wi e ma _ke<s ace> i wi be subs i u ed b con en . The e es
inside backe s indica e we he he abbevia ion is done in inse mode, command
mode o bo h.
'':ab''
hows he abbevia ons
'':una'' ma _ke
Dee e ma _ke as abbevia ion
================================================================================
WORKING WITH ILE, TAB AND WINDOW {{{1
vim [{-o-O- }] <fie1> <fie2> ...
O en <fie1> <fie2> ... in diffeen window. Wi h -o o ion o ens hem in he
same window se aa ed b hoizon a ines, \fb-O ve ica ines o - in new a
bs..
:e fie
O en a fie in a new buffe (e of edi ).
:bdee e[!] [#]
Cose a buffe [ he buffe #] [wi hou saving changes (if ! was used)]
:s
Lis cuen buffes
:s i <fie>
i he sceen in hoizon a and o en he fie <fie>
:vs i <fie>
i he sceen in ve ica and o en he fie <fie>.
C +w[#]{+-}
{Incease/decease} he size of he window in # ows (defau 1).
c +w[#]{<>}
{decease/incease} he size of he window in # coumns (defau 1).
:[v]new
O en a new em window in hoizon a o [in ve ica].
:[ ab]f[ind] ex
ook fo a fie caed ex in he cuen a h. ex can con ain widcads. O
en i in a window o in a ab ([ ab] used)
:s fiename
O en a fie in a new buffe and s i window
c + ws
i windows
c + wv
i windows ve ica
:new
O en a new em window.
:nex : evious
Go o he nex o evious fie.
C +w <diec ion_aow>
Move o he window in he diec ion of he aow.
:se
Bind
e
ou
[no]scobind
[o unbind] sevea windows o sco in same amoun . This command has o b
e in each window ha has o be bind. If ou wan o com ae wo fies, ma
ae in ees ed in vimdiff, see vimdiff(11 oos).
osi ion #.
: abs
show he cuen ab ages and he windows he con ain. hows > fo he cuen
one and + fo modified.
: abd[o] {cmd}
execu es cmd in each ab.
C +g
Name of he fie and numbe of ines. Pecen age of he fie coes onding o cu
so osi ion.
:e
Reoad, efesh an o en fie.
gg
Go o he beginning of he fie.
G
Go he end of he fie.
:se ines=num_ coumns=num_c
age down.
c + f
one age down
================================================================================
OLD {{{1
Thee is sevea modes of fods. You can ook a i in |o ion.1vim|, in
|fod-o ion.1vim|.
The defau make is hee cu baces { { { # (wi hou s aces, # is a numbe
fo he de h of he fod). The numbe is o iona.
To conseve he s a e of he fods fo a fie, see |sec ion-views|.
zo
O en fod
zO
o en fods unde he cuso ecusive.
zc
cose fod unde he cuso
zC
cose fod unde he cuso ecusive
za
if o en hen cose he fod. If cose, hen o en he fod.
zv
o en enough fods so he ine whee he cuso a eas no foded (visibe)
z
o he
]z
Move o end. If aead in he end, o he end of he con aining fod.
zj
Move downwads o he nex fod.
zk
Move u wads o he nex fod.
-------------------------------------------------------------------------------execu ing in fods
:[%-#,#]s/<text_to_replace>/<new_text>/[gc]
Replace the first occurrence of <text_to_replace> in the current line . If
g is used, replace all occurrences in the current line . If c is used, ask
for comfirmation. If % is used, replace occurrences in the whole document .
If #,# is used, replace text between lines # and #. If #=. indica es he cuen
ine . If #=$ indica es he end of he documen .
================================================================================
ORMAT AND EDITOR APECT CHANGE AND ET COMMAND {{{1
:se au oinden
:se cinden
:se abs o =4
Tabs of 4 s aces.
:se [no]numbe
how o [hide] he ine numbes
:se w=wid h
e he ine wid h ( w= ex wid h) o wid h chaac es. Do g
wi h seec ed i
nes o efow. Wods ha exceed his imi wi no be h hen.
:se shecmdfag=i
ags assed o she when using :! {comm} . The execu ion wi h :! {comm} in sh
e is done as if i was invoked in eac ive if -i ae assed bu exi s fom v
im.
:se un ime a h[?]
in he un ime a h wi h ? o ion. Run ime a h is a vaiabe wi h a hs ha
vim ooks fo fies. ou can add a hs b ing = o += ( o a end).
================================================================================
MICELLANEOU {{{1
g
mkview [numbe]
save he s a e of he fods fo he fie. You can give a numbe as id o es oe
wi h oadview.
oadview [numbe]
es oe he s a e of he fods fo a fie saved wi h mkview. You can give i a n
umbe as an id.
================================================================================
PREDEINED VARIABLE OR TOKEN {{{1
%
name of he cuen fie which we ae woking on.
================================================================================
PRINT THE PAGE {{{1
:hadco > fie. s
H REERENCE
REERENCE {{{1
h ://bog.sesa u.com/w -con en /u oads/Chue aVim-sim e. ng