Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #76894

Re: Global indent

Date 2014-08-23 15:09 -0500
From Tim Chase <python.list@tim.thechases.com>
Subject Re: Global indent
References (1 earlier) <bt6fv9djhcv0h5jauao5dij7urmgteoa53@4ax.com> <20140822125414.1fe9eb5c@rg.highlandtechnology.com> <lt88f0$2oq$1@ger.gmane.org> <mailman.13310.1408742051.18130.python-list@python.org> <53f85f6a$0$29966$c3e8da3$5496439d@news.astraweb.com>
Newsgroups comp.lang.python
Message-ID <mailman.13351.1408824664.18130.python-list@python.org> (permalink)

Show all headers | View raw


On 2014-08-23 19:31, Steven D'Aprano wrote:
> Sorry, but I have no idea what you mean by "orthogonal set of verbs
> and nouns in an editing language". Can you explain?

In the context of vi/vim, an "orthogonal set of verbs and nouns in an
editing language" mean that you have a collection of verbs
(such as d=delete, v=visual/highlight, y=yank/copy, c=change, zf=fold,
gU=transform-to-uppercase, gu=transform-to-lowercase, g~=swap-case,
g?=ROT13, "="=reformat, etc) and nouns (often called "motions" as most
of them can be used to move the cursor in normal-mode) such as
b=back, }=next-paragraph-boundary, {=previous-paragraph-boundary,
"*"=next-match-of-the-word-under-the-cursor, etc.

They're orthogonal because learning a new verb allows you to apply it
to all of the nouns/motions you already know; and learning a new
noun/motion lets you use it with any of the verbs you know.  And you
can prefix any command (verb+noun) with a count which increases the
power further.

Thus, learning one new thing has a multiplying effect.

> I find that between find/replace and Block Selection editing, I
> can't really say I've missed either the lack of editing macros or
> these orthogonal verbs, whatever they are. Occasionally I move a
> large editing job into Python, but I wouldn't want to learn a
> separate language for that.

Much of the power comes in the repeatability of last action.  Once
the editor understands that your last action meant
"transform-to-uppercase from the cursor to the end of the line", you
can move anywhere else in the document and instruct the editor to do
the same thing with a single command (in vi/vim, that's the period).
Drew Neil's _Practical Vim_ spends quite a bit of ink covering the
implications of repeatability.

[from another message from Steven]
> When I'm programming, actual fingers on keys is just a small
> proportion of the time spent. Most of my time is reading, thinking
> and planning, with typing and editing a distant fourth, and I not
> only don't mind moving off the keyboard onto the mouse, but
> actually think that's a good thing to shift my hands off the
> keyboard and use a different set of muscles. So I'm not especially
> receptive to arguments that Vim or Emacs will make me more
> productive.

I agree that a much smaller percentage of my time is spent actually
entering text and a far greater amount of time is spent navigating
(reading/thinking/planning) the document.  Most vi/vim users spend
their time in normal mode where that navigation is quick and can all
be done from a keyboard.  I find that 


[and from yet another message from Steven]
> You need a tutorial for a text editor???
> 
> If that's supposed to prove how easy Emacs is, you have failed
> miserably.

Indeed, both vim and emacs provide tutorials precisely because they
are NOT so easy to get started with.  But while I might not need
instruction for a hand-saw to remove a small tree, if I had multiple
trees to cut down, I might want a chainsaw and seek to read the
instructions to get the most out of my investment.  And if I had a
LOT of trees to cut down, I might make a major investment
https://www.youtube.com/watch?v=LYKg0gbRFns and read the heck out of
the instructions.

I happen to use vi/vim because it works just about everywhere (and
even comes installed from the factory on most *nix-likes), but as long
as people are using an editor that is sufficient to meet their needs,
I'm content to live in amicable harmony.  It's when your needs exceed
what your editor can provide that I start to recommend
editor-shopping.  I can't help you if you choose something other than
Vim, but I can encourage complainers to use a more powerful editor.

[and yet one other message from Steven]
> Besides, the standard text editor is ed:

THERE is the truth ;-)  (and...it's far more powerful than Notepad)

-tkc





Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Global indent Seymore4Head <Seymore4Head@Hotmail.invalid> - 2014-08-22 14:19 -0400
  Re: Global indent Skip Montanaro <skip@pobox.com> - 2014-08-22 13:34 -0500
  Re: Global indent "Neil D. Cerutti" <neilc@norwich.edu> - 2014-08-22 14:44 -0400
  Re: Global indent Dan Stromberg <drsalists@gmail.com> - 2014-08-22 12:21 -0700
  Re: Global indent Seymore4Head <Seymore4Head@Hotmail.invalid> - 2014-08-22 15:46 -0400
    Re: Global indent Rob Gaddi <rgaddi@technologyhighland.invalid> - 2014-08-22 12:54 -0700
      Re: Global indent Marko Rauhamaa <marko@pacujo.net> - 2014-08-22 23:11 +0300
        Re: Global indent Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2014-08-23 19:08 +1000
          Re: Global indent Marko Rauhamaa <marko@pacujo.net> - 2014-08-23 12:32 +0300
          Re: Global indent Christian Gollwitzer <auriocus@gmx.de> - 2014-08-23 11:41 +0200
            Re: Global indent Joshua Landau <joshua@landau.ws> - 2014-08-23 15:19 +0100
              Re: Global indent Christian Gollwitzer <auriocus@gmx.de> - 2014-08-23 18:17 +0200
                Re: Global indent Joshua Landau <joshua@landau.ws> - 2014-08-23 21:57 +0100
                Re: Global indent Rustom Mody <rustompmody@gmail.com> - 2014-08-23 14:55 -0700
                Re: Global indent Joshua Landau <joshua@landau.ws> - 2014-08-24 20:24 +0100
            Re: Global indent Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2014-08-24 00:56 +1000
              Re: Global indent Christian Gollwitzer <auriocus@gmx.de> - 2014-08-23 18:09 +0200
              Re: Global indent Anders Wegge Keller <wegge@wegge.dk> - 2014-08-23 22:43 +0200
                Re: Global indent Marko Rauhamaa <marko@pacujo.net> - 2014-08-24 01:50 +0300
            Re: Global indent Tim Chase <python.list@tim.thechases.com> - 2014-08-23 15:18 -0500
          Re: Global indent Rustom Mody <rustompmody@gmail.com> - 2014-08-23 07:49 -0700
          Re: Global indent [levity] Peter Pearson <pkpearson@nowhere.invalid> - 2014-08-23 17:17 +0000
      Re: Global indent "Neil D. Cerutti" <neilc@norwich.edu> - 2014-08-22 16:16 -0400
      Re: Global indent Dan Stromberg <drsalists@gmail.com> - 2014-08-22 14:14 -0700
        Re: Global indent Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2014-08-23 19:31 +1000
          Re: Global indent Tim Chase <python.list@tim.thechases.com> - 2014-08-23 15:09 -0500
      Re: Global indent Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2014-08-23 18:19 +1000
        Re: Global indent alister <alister.nospam.ware@ntlworld.com> - 2014-08-23 10:17 +0000
          Re: Global indent Gene Heskett <gheskett@wdtv.com> - 2014-08-23 10:32 -0400
    Re: Global indent Chris Angelico <rosuav@gmail.com> - 2014-08-23 06:20 +1000
    Re: Global indent Mark Lawrence <breamoreboy@yahoo.co.uk> - 2014-08-22 21:59 +0100
    Re: Global indent mm0fmf <none@mailinator.com> - 2014-08-23 12:50 +0100
  Re: Global indent Simon Ward <simon@bleah.co.uk> - 2014-08-22 20:22 +0100
  Re: Global indent Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2014-08-23 18:12 +1000
  Re: Global indent Seymore4Head <Seymore4Head@Hotmail.invalid> - 2014-08-23 11:10 -0400

csiph-web