Chapter 7 - Finding/Buffer
Even though this is a very short chapter, I thought it valuable as it helps to introduce the next chapter on multi-cursors a little bit better.
Find word and add to buffer ⌘ + G
Let’s open WOTW.md
by pressing ⌘ + O and look for the word “Martians” in the first sentence.
Select this word by pressing shift + ↑, then press ⌘ + G once. Now the word “Martians” has been added to our Find Buffer. We can easily find the next occurrence of this word by pressing ⌘ + G.
Find next/previous occurrence from buffer kbd>⌘</kbd> + G / kbd>⌘</kbd> + shift + G
See what happens when you keep on pressing ⌘ + G. If all goes well, your cursor should start iterating through all occurrences of the selected word. Conversely, using kbd>⌘</kbd> + shift + G allows you to backtrack through the usages (aka. “find previous”)
Now open War.java
, position your cursor on 13:33
(line number 13, character number 13) using ⌘ + G. Next, select
the .
and press ⌘ + G.
Exercise: Find the next .
.