Mission 02 / 52• Basic Vim

Basic Movement

In normal mode, your keyboard becomes a remote control for the cursor. Instead of reaching for the arrow keys, vim puts movement directly on the home row.

The four directions

  • hmoves the cursor left
  • jmoves the cursor down
  • kmoves the cursor up
  • lmoves the cursor right

A handy mnemonic: j looks a bit like a downward arrow, and it sits below k on the keyboard.

1
function moveAround() {
2
const left = "h";
3
const down = "j";
4
const up = "k";
5
const right = "l";
6
return left + down + up + right;
7
}

Now it's your turn!

  1. Try moving your cursor to the green target.
  2. Make sure that you are using the correct fingers!
  3. See how fast you can complete 15 targets.
0/15
1
// Welcome to this interactive Vim Playground!
2
// Try moving your cursor to the green target
3
function setGreeting(greeting: string) {
4
const element = document.getElementById('greeting');
5
element.innerText = greeting;
6
}
7
8
setGreeting('Hello World!');
NORMAL
00:00

Why not the arrow keys? Because your hands never have to leave the home row. It feels slow for the first day or two, then it becomes faster than reaching for arrows ever was.

Try it in the challenge above: use h, j, k, and l to reach all green targets as fast as possible, or switch to the Mini-Game to dodge crawling bugs!

NextCtrl+jMoving by Words