Vim basics

Published: December 23, 2025

Rolling Post
Last updated: December 23, 2025

Modes

Normal Mode

Used for :
1. Moving the cursor
2. Deleting characters, words, lines etc
3. Performing operations such as Copy and Paste

Basic Movement

  • h - Left
  • j - Down
  • k - Up
  • l - Right

Word Movements

word - A sequence of letters, digits and underscores separated by white-space. Words are also formed when switching between the mentioned characters and special symbols. alphanumeric#$%#@! - Contains two words. 'alphanumeric' and the characters #\$%#@! info@kavete.com - Contains 5 words. info, @, kavete, . and com.

  • w - Move to the next word
  • e - Move to the end of the word
  • b - Move back a word

Making small edits

x - Delete character under the cursor

s - Delete character under the cursor and enter insert mode

r - Replace the character under cursor with the next typed character

Moving by WORDs

WORD (all caps) - Any group of characters separated by whitespaces

println!("I'm a Rustacean")

The code above has 8 words and 3 WORDS.

W - Move to the next WORD

E - Move to the end of a WORD

B - Move back a WORD

Moving to line ends

0 - Move to the beginning of a line

$ - Move to the end of a line

_ - Move to the first word in a line

Find Motions

Find motions only work in the current line

f char -Move forward to the next occurrence of {char} within the line

F char - Move backward to the previous occurrence of {char}

; - Repeat the last find motion

Insert Mode

Used for editing and inserting text.

i - Enter insert mode

a - Enter insert mode after cursor

I - Enter insert mode at the start of a line

A - Enter insert mode at the end of the line

Opening New Lines

In normal mode:

o - Open a new line below the cursor and enter insert mode

O - Open a new line above the cursor and enter insert mode

Related Posts

Git basics

Programming

Git - Version control system

Uses

  • Tracking code changes
  • Collaborating

Key Git Concepts

Dec 23, 2025

Bash scripting

Programming

Bash (Bourne-Again SHell) - Used to write scripts and run commands in unix based systems.

Shell - Text based …

Dec 23, 2025