QEDIT, which I mentioned several posts above, can do a lot (but not all) of this. It has keystroke-macro recording (which can easily be saved to a macro file as well), and everything else you mention except I don’t think it has a way to do arithmetic with the text like you are doing here. ETA: QEDIT has all three of those block modes too (character, line, and rectangle).
It does have a much more extensive command set than just the ones that are mapped to keys, which you can map to keys if you want. Emacs and I’m sure vim likewise. Even TECO had an extensive command set for use in macros that you would never use interactively.
I like vi because I can make vi sit up and do tricks. I’m another programmer who learned vi thirty-mumblemumble* years ago and have been using it ever since.
I would classify editors into editors for free-flowing text (like documents) and editors for structured text (like code and data files). Vi is horrid for free-flowing text, but it works very well for structured text.
If I have to say that there is any advantage to vi, it is that while it has a steep initial learning curve, once you “get” how it is put together, it’s very easy to figure out how to do all sorts of things in it, even if you don’t have specific instructions. Compare that to Microsoft Word, where it is very easy to understand how to do most anything you would want to do with it, but the other stuff is almost impossible to figure out.
In the end, the best editor is
[ol]
[li]available[/li][li]right for the kind of file you’re editing[/li][li]you know well[/li][/ol]
Vi wins hands down on #1, and the other two are going to be dependent on you and what you are doing.
BTW, with vi, I’ve done the following:
[ul]
[li]sorted files in situ (with all the power of unix sort), sometimes leaving part of the file out of the sort. And then you can undo it if it wasn’t the right thing to do after all.[/li][li]with one pass, changed 95% of function calls from one name to another and swapped the first two arguments (this was converted to a sed script and applied to the entire system we were converting to a different c compiler)[/li][li]found and changed all instances in a csv file where the xth field had a Ctrl-M character in the middle of the field, which was causing Excel to hork.[/li][li]typed in a sql*plus command in the file and replaced it with the output of the command - usually “desc table” that ended up in a comment.[/li][li]put “rulers” into data files to analyze columnar data[/li][li]put exactly 23 spaces between quotes without giving myself a headache.[/li][/ul]
Can you sort 5 lines in the middle of the file without affecting the rest of the file, and without having to pull the lines into another file or program?
How about ISPF on mainframes? I used that for over 10 years and even used SPF-PC when I moved off mainframes to Windows.
These days I use whatever seems right for the job. Our linux servers have no graphical environments so vi is the only choice and I’m pretty comfortable with it but no power user. For a big coding session I’ll use Eclipse for Java or Visual Studio for C or C#. On windows if I just need to pop open a file for a quick edit I’ll use either vi or Notepad++.
True, but the appliances we sell only have vi installed, not even vim. For me I learned vi first and got comfortable with it before trying emacs. Vi did what I needed so didn’t put any effort into emacs.