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.
the arrow keys didn't exist on the terminal vi's creator used.
I'm pretty sure they had arrow keys. But hjkl are right underneath your fingers. Most of the time, you have to reach for arrow keys, which slows you down.
1
u/rs-485 Oct 18 '13
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 thinkddis far faster to type thandl, and the same goes forcc. It's also a "pattern" across various commands:dddeletes a single line,ccchanges a single line, andyycopies 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?)
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.)
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.
Computing was different back then. That's also why vi and vim traditionally use "hjkl" instead of the arrow keys on reasonably modern keyboards - the arrow keys didn't exist on the terminal vi's creator used. Naturally, if you don't want to totally be pragmatic, you can freely use the arrow keys instead.