5 ms·
"With Vim, I press j until I'm on the line where the word is, then I press w until I'm at the beginning of the word, then I press cw to change the word, retype
by stevelosh 16y ago
"With Vim, I press j until I'm on the line where the word is, then I press w until I'm at the beginning of the word, then I press cw to change the word, retype it the right way, and press escape to go back to command mode."
OK, this is something Vim people need to work on. Using j/k to move more than one or two lines is the wrong way to do things.
I know, I know, we extoll the virtues of hjkl constantly, but really they're barely more effective than the arrow keys.
There are better ways to move around in Vim, such as [f]orward, '[t]il and searching. In your case (changing word XYZ to something else) I would search for the word with /XY… and press return to get there, then edit as you described.
"Triple-clicking in Gedit highlights a line. Triple-clicking and dragging highlights a contiguous group of lines. In Vim, I'd need to move to the line I want to begin my selection on ([number]G or jjj), then press V, then press jjj until everything is selected."
See my previous comment about movement. You'd move to the line you want by using a search (or '{', which moves to empty lines), start your selection with V, and move to the end with another search (or some kind of movement command that gets you where you want to go quickly).
We Vim users need to stop touting our Nethack-honed hjkl skills and start talking about Vim's better movement commands.
"And I don't have to deal with the fact that the default way of deleting things overwrites the default clipboard either."
Yeah, this is dumb. YankRing helps a lot by letting you 'Ctrl+P' to the right text, but I really think Vim should have a "clipboard register" that only gets overwritten when you mean it (and have other registers for the last yanked elements).
"when I paste code in to a Vim document, the indentation gets all screwed up."
If you're using a graphical Vim like gvim or MacVim this simply shouldn't happen. It's a bug and you could report it.
If you're using the command line Vim you might need to do a bit more work to launch Vim and tell it to talk to X. It's a few extra minutes up front, but such is the price of using a terminal-based editor in a graphical environment.
- kemiller 16y ago:set paste Should help with indentation issues.
- sigzero 16y agoset pastetoggle=<F2> That is what I use.
- astrofinch 16y ago"There are better ways to move around in Vim, such as [f]orward, '[t]il and searching. In your case (changing word XYZ to something else) I would search for the word with /XY… and press return to get there, then edit as you described." That is both slower and has the disadvantage that any intermediary occurrences of the word between my cursor and the one I want to edit will be accessed first. "See my previous comment about movement. You'd move to the line you want by using a search (or '{', which moves to empty lines), start your selection with V, and move to the end with another search (or some kind of movement command that gets you where you want to go quickly)." I invented the following task for myself: With the cursor on a blank line above 4 lines of text followed by a blank line, copy the 4 lines and paste them so that there is a buffer of 2 blank lines between the 4 lines of text and their duplicates. I did the task 4 times in both gedit and vim, restarting whenever I screwed up (which was quite often). Here are my results. vim: 18.28s gedit: 14.45s I discarded an earlier task that I think Vim might have been doing better on because the task ended with the buffer back where it started, and I wasn't sure I was able to count accurately while performing the task. However, I had practiced with Vim on that task to the point where my movements were purely mechanical, and I was typing characters nearly as fast as I'm typing these words now. It's probably a better idea to relax while doing these tasks instead of racing through them, as I'm generally relaxed when I code, but I still don't see much promise in Vim at this point. As a side note, why is it that I'm the only one doing tests on myself? It's almost as though you guys don't actually want to know which editor is faster.
- gurraman 16y agoI don't know about other vim-users, but I haven't run any tests because my primary motivation for using vim isn't speed (it's that vim connects with my brain and my motor activity -- it just feels "right" and I get a great flow).
- Ivatar 16y agoI tried your test, and was slightly faster at doing it vim than gedit (assuming my fingers were on the keyboard to begin with). How exactly did you do it in vim? I used the following: y4j5jp -- yank down to 4 lines, move down to the blank line, paste after it. I appreciate that there's an awful lot to learn before you can edit quickly in vim, and that the difference (if any) between that and gedit(or any other editor) may not be worth it. I prefer vim for reasons other than speed, though -- the composable commands "feel" right to me, and the macro system makes short work of repetitive tasks. I'm essentially making lots of small programs to write the larger program for me.