IEsc
‘ome (ine (@ eel [# ten |[S_ 6 teal sa [Bees aes |e] nese (etome] ise
| 3 4 Ox" |[- sax |= ce]
nse Watota E wi I SBon|[P ease] {pate |[} sce
qessserdl| W wars |[@_ soc |[T- i nese |[O Skee [sate || [> mise J ]> mie
sre ee'|[Desy K * |[Laseeal[: ise)": 8 [ta
[Asonend|| || dae Ke # > | ee ee|\- 2.
(Zz soit] [XK Bpek| [Cae [> inset] (en
[z-ssz"| [x sos ||aae| send ave. "ge || ana
HORT heap eta sper Notes,
direct action command,
if red, itenters insert mode
Fequires extra input
‘commands with a dot need
‘char argument afterwards
(EGRIFOOT] Bary] Bay
WORDs: Bar.) Baz)
words:
Fora graphical vi/vim tutorial & more ti
before a yank/paste/del command
(Sipboard
(3) duplicate operator to act on current tine
‘ Ga achetline, > indent ine)
to save & quit, ZQ to quit w/o saving
Visual mode:
‘Mave around and type operator to act
on selected region (vim only),
scroll cursor to top,
bottom, zz: center
top of file (vim onl
f open file under cursor (vim only)
to_www.viemu.com home of ViEmu, vi/vim emulation for Microsoft Visual Studiovi/vim lesson 1 - basic editing
JG) EI are vi/vim cursor keys ~ use them as they are much
closer than regular eursor keys
Use I}to enter insert mode, cursor turns from a block into a vertical
ine, and you can type in text. Use [Ese] to return to normal mode.
Use ix]to delete the current character, or[] to delete the one to
thelen
Use [i] to go insert text at the end of the line (wherever you are
in theline!)
ote: insert mode is actually very similar to a regular editor, you ean use
‘eursor/navigation keys, backspace, delete.)
wales | _|_ lashes
belivherh ot
[Blto undo the last action traditional vi has a single level, while vim
Supports unlimited undo (CTRL. -[Rlvo redo)
[D]iumps directly to the beginning ofthe ine, {iJto the end,
snd [ato the first non-blank
tomove slong ‘words’. A‘word’ isn sequence ofall
Alphanumericor punctuation signs: GUESS] Bas]] BSS]
Use SIIB) to move along WORDs. A "WORD is a sequence of
any non-blank characters EE] BET
Uae (R] to enter insert mode with an overstrike cursor, which
types over existing characters.
[Elialand press enter to save, E[qJand enter to qui.
\__Forthe rest of the tutorial & a full cheat sheet, go to www.viemu.com - home of ViEmu, vi/vim emulation for Microsoft Visual Studio| 3 4 5 6 7 8 9
followed by another key, moves the cursor to the next instance
of that character on the current line, JBI does the same backward:
Wand [1] do the same, but they stop right before the character.
[dldelete), followed, by any motion deletes the text between the
cursor and that motion’s destination [iJ],
Hichange) does the same, but leaves you in insert mode.
‘Some motions, such as[]] and [I] are linewise - deletion includes,
the full start/end lines.
[repeats the last editing action: text input, delete or change, ete.
Prepend a count to any command/motion to repeat it that number
‘oftimes:
Hz [iilto delete up to the second word.
HMlz]e] > |to delete up to but not including the second comma.
“2 [i repeats the text after you press (Esc) to finish the input session.
1 or MIM) to operate on the current line.
Only in vim, ]enters visual mode. Move around with motions, the
be highlighted. Press an operator to operate on that selection.
[enters visual-tines mode — like [¥], but selecting whole li
Repeat operator (
CTRL-Z] selects rectangular blocks.
For the rest of the tutorial & a full cheat sheet, go to www.viemuu.com - home of ViEmu, vi/vim emulation for Mierosoft Visual Studiomal | [Stpei |
Extras
followed by any motion to ‘yank’ (copy),
Jand an [R]-[z] character before any yank/delete/paste command
an oe. ilinewi chooses a register.
to paste alter (fcharwise tothe right, iflinewise, below). ar
sen ‘An [A]- Z] register before yank/delete means “append-copy”.
to paste before ss BZ
IB copies the current ine [Jor[*[]select the system clipboard
[also works in visual mode.
‘Text deleted with HI], ZL... is also copied! 'Glenters insert mode in a new empty line below the eurrent on
‘Daves the same above the current line.
For the rest of the tutorial & a full cheat sheet, go to www.viemmu.com - home of ViEmu, vi/vim emulation for Mierosoft Visual StudioApeliae os vi/vim lesson 4 - searching
[ents] gains xe input
Basics: Extras:
[His the basic search motion ~ type the text you are searching for | ‘The following very useful motions work only in vim:
fter the slash, and then press return. Being. motion, you can use | [searches forward for the next instance of the identifier under
this after an operator, or in visual mode. the cursor
IB] does the same, backwards, [Eaves the same backwards.
In] repeats the last search inthe same direction, I] repeat
Hleneverse direction
Be careful, because the search target is interpreted as a regular
‘expression: a°b means one or more ‘a's followed by ab’, “abe
rmeans ‘abe’ at the beginning of a line, [0-0] looks for the next
digit, et
For the rest of the tutorial & a full cheat sheet, go to www.viemmu.com - home of ViEmu, vi/vim emulation for Mierosoft Visual StudioSpe vi/vim lesson 5 - marks & macros mete
icoocabeee
(Cos esires ere abut
zl
i
‘Macros: mal
Use [qlfollowed by an [a] -[z] character to start recording,
ise [afterwards to stop recording,
[@ltollowed by a character replays that macro.
[@llq to repeat the last macro played.
Marks:
Use Hi followed by ani] -[Z]eharacter to set a mark.
followed by a character to go to that mark,
Use lil and a character to go to the first non-blank in that line.
[Bl refers to the position of the last modification.
For the rest of the tutorial & a full cheat sheet, go to www.viemmu.com - home of ViEmu, vi/vim emulation for Mierosoft Visual Studioister
Cae eee pee
=o
ona
na
i
[39] jumps between matching pairs of (4) ‘[ Tete. [lana Di] jump to the beginning/end of the current sentence.
[HMI IU] jump directly to the top/middle/bottom of the screen. [land Il jump to the previous/next empty line.
1G) jumps to the end of the file, or to the line # typed before it. [ED jumps to the previous {' in column o.
1Ei/ El jump to the previous/next line. LIED jumps to the next'(’in column 0.
not technically a motion, jumps to the help for the word under
‘the cursor: vim help, man page under unix, ete.
For the rest of the tutorial & a full cheat sheet, go to www.viemu.com - home of ViEmu, vi/
emulation for Microsoft Visual Studiovi/vim lesson
various commands
fet
[joins the current line with the next one, or all the lines in the
current visual selection,
[followed by any character replaces the current character with
that one.
[Wiis shorthand for[Z][B], changes to end of line.
[Dlis shorthand for ULB], deletes to end of line.
[Wis shorthand for Bil]
J, yanks the whole Tine,
Bldcletes the character under the cursor and enters insert mode.
[S| clears the current ine and enters insert mode.
motion to indent one or more lines.
Band a motion to unindent.
and a motion to reformat a range of text.
All of them work in visual mode, or can be repeated (
to operate on the currenttline.
Bete...)
[El toggles the case of the character under the cursor.
Now go grab the full cheat sheet and learn the rest
Start with [I]/a| [il and [i]. Piece of cake!
For the rest of the tutorial & a full cheat sheet, go to www.viemmu.com home of ViEmu, vi/vim emulation for Mierosoft Visual Studio