Hacker News new | ask | show | jobs
by DrewG 5416 days ago
Why do you have the same 10 characters on 10 consecutive lines? Sounds like that is probably a violation of DRY, at least it always has been when I encountered something like that. Also, if you are comparing vi(m) to something, please don't compare it to notepad. Every editor and IDE I have used in the past few years has rectangular selection. Commonly with alt+click and drag, or shift+alt+arrow keys.
1 comments

There are lots of scenarios when this comes up:

- braindead configuaration files. - data files that need some massaging - commenting out code blocks in languages which need a prefix comment delimiter on each line (e.g. python's # or haskell's --) - any time you are doing a series of operations calling functions in a module or from a single class/object and the name changes (e.g. foo.x();, foo.y(); foo.z(); and so on);

OK, I can potentially see where vi(m)'s rectangluar selection would be good for editing config files and such, but I'm pretty sure all modern editors have rectangular selection anyway (notepad is not a modern editor). My IDE has the ability to rename a variable and to comment/uncomment a selection which solves your last two problems.
I wasn't defending vim over your editor, just answering the question of when there are valid times to do 10 lines of block change. 2 more that came up for me yesterday:

We changed the data format being sent over JSON now I needed to:

1) make a bunch of int declarations into float declarations, fortunately those tend to bunch up.

2) Change a bunch of getInt calls to getFloat calls, but those are also bunched up together.