4 ms·
If I am looking for a particular word, then I will use a search. Even notepad and nano has a short-cut key for a simple search for a particular word. Where I f
by CJefferson 14y ago
If I am looking for a particular word, then I will use a search. Even notepad and nano has a short-cut key for a simple search for a particular word.
Where I find a mouse useful is when I want "that loop which I suspect is misbehaving. That one which adds a new member to all arrays". There a quick flick of the mouse-wheel, and then fine positioning of the mouse cursor I find gets me to my location faster.
Even when the loop is on the screen, maybe 35 lines up, I have to either do a binary-search style jump with the keyboard, or with the mouse just click on it.
Also, looking for a particular word is easy when there is only one occurrence of it, or you want the next occurrence. A mouse might still be useful when there are many occurrences of a variable and you want (for example) one somewhere near the end.
Perhaps vimmers tend to keep better track of where everything is to make it easier to "hard jump" to, while mousers tend to keep a more ad-hoc overall view, so they know approximately where to scroll to?
- tmarthal 14y agoMy .vimrc is the following: <quote>set number</quote> Which shows the line number no matter what in a vi editor. Jumping to a loop on the screen is as easy as viewing the line the loop is on, then hitting colon+line number (e.g. ":68"). This might be what you're referring to with a "hard jump". I also use the "number+command" shortcuts quite a bit. If you want to jump up/down 20 lines (or 2000), then "2000k" or "2000j" will move the cursor up 2000 lines or down 2000 lines. Also a hard jump. But to find an occurrence of a word at the end of the file, the typical search sequence is the following: 1) :$ - this jumps to the end of the file ($ is a common regex meaning 'end of', the same way that '^' means beginning of) 2) ?word - this does a backwards search for the word. this is at the bottom of the file, searching upwards 3) n - this jumps to the next occurrence of the word So thats like 5 keystrokes not including typing in the word. Jumping around and viewing files really is neat with vi/vim.