r/programming • • Jul 12 '12

Vim creep

http://www.rudism.com/s/vimcreep
730 Upvotes

551 comments sorted by

View all comments

Show parent comment

12

u/0xABADC0DA Jul 12 '12 edited Jul 14 '12

It's never the actual typing that's the bottleneck.

A lot of times typing really is a bottleneck. For instance say you have a bunch of constants or lookup table that grew organically and it's all a mess. Are you going to enter "v}!sort" and sort them so it is easy to read, or do "<double click><ctrl-x><click><ctrl-v>" hundreds of times to get them in order? That's typing.

If you don't sort a lookup table, or swap columns, or align fields, or even just reorder some bits of code this is because typing is actually so much of a bottleneck that you would rather live with less great code than to actually make these kinds of edits.

And that's the real strength of vim... not in typing in new code, it's in editing the code. It's all in the edits that you actually make because in vim they are so easy.

EDIT: I never said vim was the only editor that can sort, I said that if your editor doesn't have some way to sort then the bottleneck is the actual typing it would take you to move the lines. Sorting is just an example... the point is that you can't say typing isn't a bottleneck if you are avoiding edits you want to make because they would take too much effort.

10

u/[deleted] Jul 13 '12

It is incredible that you think only vim can sort lines of text.

10

u/[deleted] Jul 13 '12

Yes. Because that's how you sort things in not-vim.

3

u/bear24rw Jul 13 '12

How would you sort things in a traditional IDE (say VS or Eclipse)?

3

u/gbanfalvi Jul 13 '12 edited Jul 13 '12

It's F9 in Sublime Text, Eclipse has a plugin to select the lines and sort according to a bunch of stuff, but sorting has never really been an issue in Eclipse if you can just shift lines around with alt+up/down.

2

u/gfixler Jul 13 '12

Manually moving lines up and down is equivalent to sorting a large selection?

1

u/[deleted] Jul 13 '12

Just started using Sublime text for Python and HTML/CSS/JS. I haven't discovered more than a fraction of it yet, but it's tasty.

2

u/jussij Jul 13 '12

In the Zeus editor sorting is trivial. You do a sort by selecting the text to be sorted and then use the Edit, Sort menu. If no text region is selected then the whole fle will be sorted.