Java Reference
In-Depth Information
myArraylist.doSomething(magical); // cool
From the beginning of the line, you'd need to type w seven times (or know
to type 7w—but how could you guess seven?) To help out, vi uses the upper-
case W to skip words defined not by punctuation but solely by white space.
Think of it as “bigger” words. And of course B will go “back” by these bigger
words. So on our example line, a single W will get you to the start of the
comment.
Be sure that you're not just reading these descriptions. Run vi on any file
that you can find and practice navigating by lines or words or screens. Once
you get the hang of it, it can be so much faster than reaching for the mouse and
trying to maneuver the cursor into just the right spot between letters.
Sometimes you can see where you want to go based on the characters of
text in the document. See that “x”? That's a relatively rare character on any line
of text. If you see a character, your cursor can “find” it if you type f and then
the character you are looking for. So fx would search forward on the line for
an “x”. And Fx would search backward from the cursor. To repeat the search,
just type a semicolon (“ ; ”).
Searching for a string is another good way to move your way through a
file. To search forward, type a slash ( / ), then the characters for which you want
to search, and end the string with a second slash and then Enter: 2
/myArrayList/
To search backwards (towards the first line of the file) use the question
mark rather than the slash to bracket your search string. In either case, to jump
to the next occurrence, type n , or 27n to jump to the 27th occurrence. Whether
you are searching forward ( / ) or backward ( ? ), using uppercase N will reverse
the direction as it searches for the next occurrence. So, you can search forward
with /myVar/ and then press n for each next occurrence forward. If you go too
far, just type N to back up. Similarly, if you were going backwards looking for
an occurrence of a constructor, say something like: ?new HotClass? ; then
each n will search toward the top of the file, and each N will search toward the
end of file.
2. The second slash is optional in most vi implementations, but used for consistency with the
same command in ex mode which has optional suffix characters.
Search WWH ::




Custom Search