Getting started with Vim

Here is a list of the most useful commands to get started with Vim

hjkl = navigation
h = left
j = down
k = up
l = right

i = insert mode
esc = back to command mode
:q = quit
:w = write
:wq = write and quit
:q! = quit without saving

:set number = show line numbers

In command mode
dd = delete a line
u = undo
ctrl + r = redo

/searchquery = search for "searchquery"
n = go to next occurrence of search
shift + n = previous occurance
:%s/searchquery/replacementtext = search and replace first occurrance
:%s/searchquery/replacementtext/g = search and replace all occurrances
:%s/searchquery/replacementtext/gc = search and replace all occurrences but ask for confirmation

Leave a comment

Your email address will not be published. Required fields are marked *

For security, use of Google's reCAPTCHA service is required which is subject to the Google Privacy Policy and Terms of Use.

I agree to these terms.