01. Navigating controls h, j, k, l, ESC, [0-9]

Using a Mac and can't hold down the hjkl keys?

This is due to the default settings have the Apple press-and-hold feature enabled.

To disable this, simply go into your terminal and paste this code:defaults write -g ApplePressAndHoldEnabled -bool true

You may need to log in/out to restart your user preference settings.

Hello! Click this region to activate me and start learning about Vim! Let's jump right to it! Vim is a "modal editor", meaning it has different modes. When you open vim, it opens in COMMAND mode. If you ever find Vim in a different mode (or if your controls are acting wonky), simply press ESC to re-activate COMMAND mode. Great! We'll start with basic navigation. To move around in Vim, press: ^ k < h l > j v l - move right h - move left j - move down k - move up Time to practice! Try going right (l) and left (h). Now try moving down (j)! Let's move back up (k). Stray away from the [[arrow keys]]! It may seem easier to use the arrow keys, but those two seconds you take to move over to use them can actually add up to a lot on the course of your programming career! Let's try navigating through this haiku: Yay, we are learning how to navigate with Vim This is so much fun! We can make moving around more efficient using a numerical modifier. Simply precede the command with an value [0-9]. For example, pressing '4h' moves 4 characters to the left. Review Questions: 1) Why are we learning Vim? (scroll down for answer) Solutions: 2) It's fast, lightweight, and available on almost every computer.

Take your Linux skills to the next level!

The Linux Command Line

Take your Linux skills to the next level! Try Linux & UNIX

The Linux Command Line takes you from your very first terminal keystrokes to writing full programs in Bash, the most popular Linux shell. Along the way you'll learn the timeless skills handed down by generations of gray-bearded, mouse-shunning gurus: file navigation, environment configuration, command chaining, pattern matching with regular expressions, and more.

$ Check price
39.9539.95Amazon 4.5 logo(274+ reviews)

More Linux & UNIX resources

Aching back from coding all day?

Acupressure Mat & Pillow

Aching back from coding all day? Try Back Problems

Relieve your stress, back, neck and sciatic pain through 1,782 acupuncture points for immediate neck pain relief. Made for lower, upper and mid chronic back pain treatment, and improves circulation, sleep, digestion and quality of life.

$$ Check price
144.87144.87Amazon 4.5 logo(1,890+ reviews)

More Back Problems resources

Ad