03. Navigating lines $, 0, ^, g_, -, +

We can navigate much more efficiently by navigating through lines. Use the following keys to move to: $ - end of line 0 - beginning of line Notice that some lines are really long, and thus wrap around. To see which lines are wrapped around, simply look at the line number to the left. Try navigating to the end of the line in this sentence. In the case where the line begins with with white space, use: ^ - first non-white space at the beginning of line g_ - first non-white space at end of line (this doesn't work in this interface, but it should when using external Vim). # Try using the above commands in a simple python code, which loves to use white space. def fib(n): if n < 2: return n return fib(n-2) + fib(n-1) You may also navigate through lines with indentations with the - and + keys: - - moves up to the first non-whitespace character + - moves down to the first non-whitespace character Notice that for "+" you have to press shift, then the "=" sign. In Vim terms, that's just too much work. What we can use instead is the [return] key. Try navigating through the first letters of this tricky paragraph! Challenge! Review Questions: 1) NavigatE Through This Line HittinG Only The CapitalizeD letteR. 2) How would you ignore punctuations while navigating through words? Solutions 1) (starting from the 1) Wewwwwewwwee 2) Use the upper-case counterparts - WEB.

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?

Self-Massage Tool

Aching back from coding all day? Try Back Problems

Relieve spasms, tight muscles, trigger points and pressure points with the Body Back Buddy! This trigger point massage is designed to help you self-message any area of your body - especially those that are hard to reach. Keeping your muscles relaxes and out of contraction is importan in helping to reduce pain and prevent muscle injury.

$ Check price
29.9529.95Amazon 4.5 logo(3,443+ reviews)

More Back Problems resources

Ad