0% found this document useful (0 votes)
326 views1 page

Vim Cheat Sheet

This document provides tips for using Vim. The key points are: 1) In normal mode, you can operate on a selection by moving the cursor, running a command, and moving the selection. For example, "f(ldt)". 2) Visual mode allows you to select text first by moving the cursor before running a command. 3) Preceding a command with a number repeats it that many times. For example, "3w" moves forward 3 words.

Uploaded by

Saed Cattywampus
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
326 views1 page

Vim Cheat Sheet

This document provides tips for using Vim. The key points are: 1) In normal mode, you can operate on a selection by moving the cursor, running a command, and moving the selection. For example, "f(ldt)". 2) Visual mode allows you to select text first by moving the cursor before running a command. 3) Preceding a command with a number repeats it that many times. For example, "3w" moves forward 3 words.

Uploaded by

Saed Cattywampus
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

Modes Tips Move(cursor & selection) H

Top
NORMAL k

Screen
Normal vim use is [move
REPLACE
cursor] [command] [move h l

Fi
INSERT
Character

Start

le
selection] to operate on 0 G
esc that selection (e.g. 'f(ldt)').
j
R i When learning, as an a
alternative to [move]

{line number} G
n Words

Middle
[command] [move], you y M
w

"word"
can use visual mode which w w w w w w
(at start of line I )
VIM
means you can do [move] l b
b b b b b b

v [move] (visual confirm) i


(at end of line A ) [command]... just try it! n Lorem ipsum(dolor) si

"WORD"
(substituting line S ) Preceding a command with e

Bottom
W W E end of WORD W
a digit (e.g. 3 ) will
(new line above O ) G B
B B

End
repeat it x times. e end of word
L
(new line below o )
. : .h will open up vim
(replacing till eol C ) help in a new (split) vim ( Sentence ) # prev Indent next * { Paragraph }
window (navigate it using
'Move' commands and ':q' 0 indent ^ Line $
Command (on next selection) to exit)
prev - next +
(start of mark line)
' [char] ` [char]
Mark

Precede with . g opens up a whole


y [move] yank (copy) "[char] to use toolkit of extra commands. till (excl) char t [char] (backwards T )
named register Google for more info!
d [move] delete (cut) prev , ; next
(clipboard) [char]. Easter egg: ':h 42' find (incl) char f [char] (backwards F )
> [move] indent (and outdent < )
Repeating the above command (e.g. yy) instead Files find term / {search term} (backwards ? ) prev n N next

of [move] will use current line as selection : w save Move(selection) Move(cursor)


Command (on cursor) : w {file} save as new
i inside y i w
y i )
up C F
: w q save & quit (Lorem ipsum) Page
T
+
x delete char (or X previous) R

(can precede no-save quit a around down


L
B
: q ! y a )
p paste before (or P after) with named
register) : e {file} open Replace
m [char] set mark J join with line after Non-existing file will
create new : % s {search regex} / {replace with} / g
insert
Command (absolute) : r {file} contents : g / {search regex} d delete lines containing
open file under
u undo (through buffer) . repeat last cmd g f cursor : v / {search regex} d delete lines NOT containing

You might also like