Vim can feel like a boss fight when you’re starting out — blinking cursor, no mouse, and zero clues. But once you get past the “what even is this” phase, it becomes a power tool that makes other editors feel… clunky.

So in this article, I would list down the vim commands which I use THE MOST. Many people on twitter were asking me to make a list of commands I use daily. So here it is!

This one would be mostly a cheatsheet sort of article and not a “How To” one.

h, j, k, l – The Arrow Keys

You’ll see these everywhere.

hleft
jdown
kup
lright

w, b, e – Word Navigation

  • w: jump to the start of the next word
  • b: back to the beginning of the previous word
  • e: end of the current/next word
:wSave file
ddDelete current line

gg and G – Top and Bottom

gggo to the top of the file
Ggo to the bottom

0, ^, $ – Line Navigation

0Beginning of line
^ → First non-blank character
$ → End of line

Editing Text

i, I, a, A – Insert Modes

iinsert before cursor
Iinsert at start of line
aappend after cursor
Aappend at end of line

o and O – New Lines

oopen new line below
Oopen new line above

x and X – Delete Characters

xdelete character under cursor
Xdelete character before cursor

dd, yy, p, P – Line Operations

dddelete (cut) current line
yyyank (copy) current line
ppaste below
Ppaste above

Searching and Replacing

/pattern – Search Forward

/foosearch for "foo" forward
nnext match
Nprevious match

:%s/old/new/g – Replace All

Replace “dog” with “cat” in the whole file:

:%s/dog/cat/g

Replace only the first instance on each line:

:%s/dog/cat/

Ask before replacing:

:%s/dog/cat/gc

Visual Mode

v, V, Ctrl+v

vcharacter-wise visual mode
Vline-wise visual mode
Ctrl+vblock visual mode (aka column selection)

Once selected, you can d, y, or p like usual.

File Operations

:w, :q, :wq, :q!

:wsave file
:qquit
:wqsave and quit
:q!quit without saving

Buffers, Windows, and Tabs

Buffers

:lslist open buffers
:bddelete current buffer
:buffer <n>switch to buffer number n

Windows (Splits)

:splithorizontal split
:vsplitvertical split
Ctrl+w wswitch between windows
Ctrl+w qclose window

Tabs

:tabnewopen new tab
gtnext tab
gTprevious tab
:tabcloseclose tab

Marks and Jumps

m{a-z} and 'a, `a

Set a mark:

maset mark 'a' at current position

Jump to it:

'ajump to line of mark a
`ajump to exact position of mark a

Other Handy Commands

. – Repeat Last Change

If you just deleted a line with dd, pressing . will repeat that action.

u and Ctrl+r

uundo
Ctrl+rredo

J – Join Lines

Jjoins the current line with the next line

>>, << – Indent and Outdent

>>indent current line
<<unindent current line

In visual mode, you can select multiple lines and use > or < to shift them.

Config Tweaks Worth Knowing

Put these in your ~/.vimrc to make Vim more friendly:

set number          " Show line numbers
set relativenumber  " Relative line numbers
set tabstop=4       " Number of spaces per tab
set shiftwidth=4    " Indentation amount
set expandtab       " Use spaces instead of tabs
set incsearch       " Incremental search
set ignorecase      " Case-insensitive search

Final Tip

You don’t have to memorize all this in one sitting. Start with the basics (h, j, k, l, :wq) and layer on as you go. Vim rewards muscle memory. The more you use it, the more natural it feels.

Happy Vimming!