Global indent

Christian Gollwitzer auriocus at gmx.de
Sat Aug 23 12:17:51 EDT 2014


Am 23.08.14 16:19, schrieb Joshua Landau:
> (Since this is already an editor war...)
>
> On 23 August 2014 10:41, Christian Gollwitzer <auriocus at gmx.de> wrote:
>> Sometimes I impress my colleagues with what they call "magic", i.e. creating
>> special repeated lists of numbers by a few keystrokes in gvim, and that has
>> triggered the request from them to learn a bit of (g)vim.
>
> I have yet to be truly impressed by Vim, in that Sublime Text with a
> few extensions seems to do the same things just as easily. I find that
> Vim and Emacs users consistently underrate the powers of these
> editors, presumably because they've never put nearly as much effort
> into them as they have into their Vim or Emacs.

I never looked into Sublime, because it costs money. But no doubt it is 
a powerful editor, judging from comments of other people.

>
> For example, to make a numbered list in (my) Sublime Text (fully
> custom shortcuts ahead):
>
> Alt-1 Alt-0 Alt-0   to repeat the next command 100 times

 > [ ... some keystrokes ...]
>
> Ctrl-Shift-q        to repeat macro
>
> Compare with Vim:
> http://stackoverflow.com/questions/4224410/macro-for-making-numbered-lists-in-vim
>

I'd actually do this in gvim to put numbers at each line:

- Select text (by mouse, or v + cursor movements)
- ! awk '{print NR ". " $0}'

Yes, it is cheating, it pipes the selected text through an external 
tool. But why should I do the tedious exercise of constructing an editor 
macro, when an external tool like awk can do the same so much easier?

	Christian



More information about the Python-list mailing list