Vim /

Vim

Vim Cheat Sheet

How to enter console mode

ESC - Escape on you're keyboard so you can use console

How to triger Console

:
/

Enter INSERT MODE

i

Exit the document

:q

Exit the document without saving

:q!

Navigate UP/DOWN

j - for up
k - for down

Navigate Right/Left

l - for left
h - for right

Exit and Save

:wq

Undo

u - undo
:u - undo
:undo - undo

Search and Replace ALL for single change u just type "%s/keyword/newkeyword/ without G

%s/keyword/whatuwanttoreplace/g - Replaces anything whith whatuwanttoreplace that is known as keyword

How to save and quit

ESC; :wq - Write and quit or a.k.a Save and quit

How to search

/keywoard

Show number lines

ESC, :set number

Delete a line

dd

Jump to first line

gg

Jump to last/bottom line

SHIFT+G
G

Exit INSERT mode

ESC

Enable Syntax

:syntax on

Disable Syntax

:syntax off

Go to specific line

/20 - Sents you to line 20

This commands most of them apply to "vi" to but for full experience please install vim:

pkg_add vim