Sidharth R
  • Home
  • Posts
  • Journal
  • Home
  • Posts
  • Journal
  • Search
  1. Home
  2. Posts
  3. Ultimate Vi Shortcuts Cheat Sheet

Ultimate Vi Shortcuts Cheat Sheet

Updated: 07 Apr 2026 ⚬ Page views: loading...

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

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
  • Quotes
  • Links worth your time
  • About
  • Contact
  • Style guide
  • RSS
© 2026 Sidharth R.
Licensed CC BY-NC-SA 4.0