From the course: Learning Vim
Unlock the full course today
Join today to access over 24,600 courses taught by industry experts.
Navigate using keys: H, J, K, L - vi Tutorial
From the course: Learning Vim
Navigate using keys: H, J, K, L
- [Instructor] Let's open sherlock.txt, vim sherlock.txt. You're in normal mode and at the beginning of the file. To move around, you can use the arrow keys. However, this will force you to move your fingers from the natural typing position. Instead of the arrow keys, you can use the H, J, K, L keys. If you're an old-time gamer, you might recognize these keys. They were used in games to move around, as well. H goes to the left, J goes down, K goes up, and L goes right. It takes some time to get used to it but once you get it, it comes naturally. If you'd like to practice, you can head over to vim-adventures and try the first level. H, J, K, L move one character in each direction. Like many other vim commands, you can prefix them with a number, telling how many times you'd like the command to be executed. Let's move to the beginning of the file and then type 10L. This will move us 10 characters to the right. If you type 6J, this will move you six lines down.
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
(Locked)
Navigate using keys: H, J, K, L1m 11s
-
(Locked)
Words, sentences, and paragraphs1m 46s
-
(Locked)
Challenge: Find word19s
-
(Locked)
Solution: Find word31s
-
(Locked)
Regular expressions1m 56s
-
(Locked)
Challenge: Search word8s
-
(Locked)
Solution: Search word14s
-
(Locked)
Screen movement47s
-
Challenge: Move screens5s
-
Solution: Move screens12s
-
(Locked)
Lines1m 40s
-
(Locked)
Challenge: Move lines14s
-
(Locked)
Solution: Move lines16s
-
(Locked)
Current word59s
-
(Locked)
Challenge: Find next instance of word23s
-
(Locked)
Solution: Find next instance of word22s
-
(Locked)
-
-
-
-
-
-