r/coding • • Oct 04 '13

Just use Sublime Text (instead of vim)

http://delvarworld.github.io/blog/2013/03/16/just-use-sublime-text/
43 Upvotes

254 comments sorted by

View all comments

Show parent comments

3

u/Tenobrus Oct 05 '13

Shift+Ctrl+Space is actually just "expand selection to context", so it will still work. Or Shift+Ctrl+D, which is specifically "expand to brackets".

1

u/rs-485 Oct 05 '13

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 ".

8

u/mirhagk Oct 06 '13

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.

3

u/Tenobrus Oct 05 '13

Ok. Each to his own.

1

u/[deleted] Oct 17 '13

Those key combinations just seem rather arbitrarily chosen

Why is delete a line DD. Why not DL?
Same with CC(Change line)
Why is $ end of line?

Sometimes things just are arbitrarily chosen. They have to pick SOMETHING, and that keyboard shortcut makes the most sense to the devs.

1

u/rs-485 Oct 18 '13

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.

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.

0

u/nairebis Oct 28 '13

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/codygman Nov 25 '13

$ is not randomly chosen, $ means end of line in regular expressions.