Generally, I find VIM features on a need to know basis (although the need sometimes advances to such levels that I forget to do original work, but its fun, believe me). So, I have to explain to you the whole scenario, otherwise you won't be able to enjoy the search (and their use afterwards) for VIM features that I do. Anyways, usually I find myself browsing codes (at very few times, you are actually writing the code). Now, I have found the use of a variable Y (using VIM's cscope support), and I am going through the context in which it has been used (through the use of VIM's [{ command). After I have reached the top of context tree (e.g., variable Y use within an if, which is within a for and which is within function X: aha, now I have the whole picture of how variable Y has been used), I have to go back to where I originally started (or may be to the for loop within which Y was used). How do I trace back the jumps that I took when I used [{ commands?
Here is the solution: use Ctrl-o and Ctrl-i. Easy, haan: not before you find it. C-o takes you into one direction of jumps, whereas C-i takes you into reverse direction. Use them, and you'll start appreciating VIM as much as I do...:)
(Another use): you are at a certain part of a code. You have to search for a particular pattern, so you start the search by /, and pressing n. How do you go back to where you were before the search..? great, haan.. Without imagination, VIM is nothing. Imagine, and then search for that particular feature (and then use it, and then think again, oohh not, a vicious cycle)..
(psssssssss: dude, what is this talk all about, I am happy with something, may be notepad..:))
No comments:
Post a Comment