Skip to content
nerdsid_
  • Posts
  • Journal

Navigation

  • Posts
  • Journal
Posts

Ultimate vi shortcuts cheat sheet

Updated: 07 Apr 2026

Big picture of Vim commands

  1. Normal mode (default)
   ├── Navigation (h, j, k, l, G)
   ├── Editing (d, c, x)
   ├── Insert triggers (i, a, o, O, A)
  1. Insert mode → typing text

  2. Visual mode → selecting text

  3. Command mode (:) → commands like :w, :q, :10,20d

Navigation (movement commands)

Text
G
  • G → go to last line

2. Editing / insertion commands

o, O, A : These change the file and switch you to insert mode.

CommandMeaning
oopen line below
Oopen line above
Aappend at end of line
Tip

G o - create a new line below last line and start typing

Here,

  • Shift + G → go to last line
  • o → open new line + switch to insert mode

Delete

Delete from line X to line Y

Bash
:X,Yd

Example:

Bash
:10,20d

Show line numbers:

Bash
:set number

Delete from current line → line 20

Bash
:.,20d

Here . = current line

Delete from current line → next 10 lines

Bash
d10d

Deletes current + next 10 lines

Delete with Visual mode

  1. Press:
Bash
Shift + V
  1. Use ↑ ↓ to select lines
  2. Press:
Bash
d

Delete entire file content

Bash
:%d
Tags: vim cheatsheet linux … views

Keep reading

  • Linux journalctl command cheat sheet
  • Linux commands cheat sheet (most used commands)
  • How to fix the apostrophe (') key not working in VirtualBox Ubuntu
  • grep failing on hyphen patterns? Try this fix

  • Home
  • Posts
  • Journal
  • Labs
  • Snippets
  • Quotes
  • Links worth your time
  • About
  • Contact
  • Style guide
  • RSS

© 2026 Sidharth R. · Licensed CC BY-NC-SA 4.0