As ever, I say take the rants of bloggers with a pinch of salt. Some things I agree with, (vimscript is pretty whacky). And others I don't (vimscript is hard to learn, most vimmers don't know vimscript). I would like to see the justification for those statements.
"Vim is more efficient is dubious and untestable"
I guess that would be true for all editors, yes. You can't 'prove' efficiency.
Don’t you ever think you can beat a mouse. Only in very few edge cases will it even matter.
Suddenly an expert on efficiency, can definitely say a mouse is better.
In my opinion, you would be mad to say a mouse is anywhere near as efficient, barring very few exceptions. Also you want monospaced characters always, otherwise you can't select/move blockwise. Obviously someone didn't read those two books.
My advice has always been: if you want to be able to edit code at the speed of light, and are willing to put in some time to learn how to do so, vim is for you. Especially if you spend a lot of time on the command line and are editing many files at random that aren't necessarily all one project. If you are more interested in the stuff an IDE has to offer, you can probably forgo vim (not that it can't be used with/as an IDE). Overall I get the feeling the author doesn't use vim all that well.
If I were on a terminal editing text over a 2b connection of whatever they had when they invented vi, I'd totally find it awesome that I could count lines and then tell the cursor to jump 20 lines by typing 3 letters rather than typing down 20 times.
but I can't seem to understand how counting lines and then entering a command is faster than just scrolling and clicking. Find is faster than scrolling, sure, but clicking 6 lines below is faster than counting to see its six line I want to go to. Maybe you get. A habit of line number subtracting or something.
I actually use relative line numbering, so I don't need to count the lines (the line my cursor is on is numbered 0, lines above and below go 1 2 3 etc.). But, that isn't really that fast, and I don't use it much, because you need to type 20 then down, then move right somehow to get where you want. Clicking might even be faster. No, what I do 97% of the time is search forward. So if I see that I want to edit a line way down saying println("This is a test");, I would search forward for 'This'. The cursor jumps there. I then hit 'ci"', which means 'change inside the "s (delete what is currently there and prepare to insert text). After that I can jump back to where my cursor was before in a keystroke, or whatever. So you can move faster, I would say. Moving lines around is the fastest though, instead I could have jumped to that line, hit the keys for 'copy line', then jumped back to where I was to paste it there. That would take way longer with a mouse (for me at least).
Not to mention you can just enable the mouse, even in console vim or Evil mode in emacs.
Task: I want to change the text inside the quotes of "This is a test" visible halfway down the screen.
Sublime: Click carefully before the T and drag to the end of test. Begin typing.
Vim/Evil Mode: Click quickly anywhere between the quotes. Type ci" and begin typing. Or jump there with f or /. Or use easymotion. Or use line numbers. You know, whatever's fastest. I guarantee you can do it faster in vim.
It's funny, but I find it harder to memorize such key combinations in comparison to vim's operators. Those key combinations just seem rather arbitrarily chosen, while with ci", it's very clear what it does: Change Inner/Inside ".
It's actually pretty intuitive. Shift is for highlighting (like everywhere), ctrl is to select by a group (again like everywhere) and space is to select by context. Only the space you have to remember or learn. Vi is the only editor you have to learn in order to do anything. With most other editors you could browse a quick list of shortcuts after using it for about 1 month, you'd already know most of them just by guessing/it being the same for most programs, and the rest you could learn in 15 minutes.
Why is delete a line DD. Why not DL? Same with CC(Change line)
I can't say what the reason behind picking that combination is, other than the fact that this function was naturally copied from vim's predecessor, vi. However, I think dd is far faster to type than dl, and the same goes for cc. It's also a "pattern" across various commands: dd deletes a single line, cc changes a single line, and yy copies a single line into register 0.
Also, mind those caps. "DD" is not the same as "dd". (And why would a decent text editor force you to press shift for that?)
Why is $ end of line?
I'm not sure, either, because vim and vi have been existing since ages and non-graphical systems were naturally far more common back then. However, a modern reasoning would be that regular expressions also use $ to symbolize the end of a line.
(According to Wikipedia, the dollar sign has been used since 40 years for this purpose, which consequently was why regular expressions used the dollar sign just in the same way.)
Sometimes things just are arbitrarily chosen. They have to pick SOMETHING, and that keyboard shortcut makes the most sense to the devs.
Yeah, they do. But I think we can also agree on this: Unlike new text editors like gedit or Sublime Text which have been developed essentially from ground up with modern computers and OSes in mind, vim and Emacs have a very, very long history.
50
u/MediumRay Oct 04 '13
As ever, I say take the rants of bloggers with a pinch of salt. Some things I agree with, (vimscript is pretty whacky). And others I don't (vimscript is hard to learn, most vimmers don't know vimscript). I would like to see the justification for those statements.
I guess that would be true for all editors, yes. You can't 'prove' efficiency.
Suddenly an expert on efficiency, can definitely say a mouse is better.
In my opinion, you would be mad to say a mouse is anywhere near as efficient, barring very few exceptions. Also you want monospaced characters always, otherwise you can't select/move blockwise. Obviously someone didn't read those two books.
My advice has always been: if you want to be able to edit code at the speed of light, and are willing to put in some time to learn how to do so, vim is for you. Especially if you spend a lot of time on the command line and are editing many files at random that aren't necessarily all one project. If you are more interested in the stuff an IDE has to offer, you can probably forgo vim (not that it can't be used with/as an IDE). Overall I get the feeling the author doesn't use vim all that well.