VIm Basic


Why VIM?

  • 21 years of continuous development
  • Over 4,500 plugins available to date



The Basics

  1. Modes
  2. Commands
  3. Movement
  4. Editing
  5. Searching
  6. Windows

Modes

Normal
Default behavior, used for navigation and manipulation of text. 
Insert
 Used for inserting new text. "Normal" mode commands are also available in "Insert" mode through the use of meta keys.
Visual
 Used for navigation and manipulation of text selections. Most "Normal" mode commands are available in "Visual" mode.

Commands

Introducing the Colon
Open
 :e <filename>
Write
 :w <filename>
Quit
 :q
Help
 :h

Movement

h => leftj => downk => upl => right

Movement

Document Level
Page Down
 <ctrl>+f
Page Up
 <ctrl>+b
Jump to Top
 gg
Jump to Bottom
 G
Jump to Line
 <line number>gg

Movement

Screen Level
Jump to Top of Screen
H
Jump to Middle of Screen
M
Jump to Bottom of Screen
L

Movement

Line Level
End of Word
 e
Beginning of Word
 b
End of Line
 $
Beginning of Line
 0

Movement

Miscellaneous
Jump to Closing Character
 %
Undo Jump
 ``

Editing

Adding Data
Insert
i
Append
a
Append to Line
A
New Line
o

Editing

Replacing Data
Replace Character Under Cursor
r
Replace Word
cw
Replace Until Escape is Pressed
R

Editing

Deleting Data
Delete Character Under Cursor
x
Delete Word Under Cursor
dw
Delete Line
dd
Delete From Cursor to End of File
dG

Editing

Visual Blocks
Selecting Characters
v
Selecting Lines
V
Selecting Columns
<ctrl>+v
Editing Multiple Lines
I

Searching

Find
Basic Search
/<query>
REGEX Search
/<regex query>

Search

Find and Replace
Replace First Instance
 :s/<find>/<replace>
Replace All Instances on Line
 :s/<find>/<replace>/g
Replace All Instances in File
 :%s/<find>/<replace>/g

Windows

Split Windows
Split Vertically
:vsplit
Split Horizontally
:split
Resize Split Window
:<vertical> resize <columns>
Move to Split Window
<ctrl>+w <direction>

Windows

Tabs
New Tab
:tabnew
Next Tab
gt
Previous Tab
gT
Jump to Tab #
<tab number>gt

VIM Basic

By xfyuan

VIM Basic

  • 539