logoalt Hacker News

piekvorstlast Thursday at 11:18 AM4 repliesview on HN

This reminds me of an excerpt from an old Emacs manual:

    . . . if you forget which commands deal with windows, just type @b[ESC-?]@t[window]@b[ESC].
This weird command is presented with such a benevolent innocence as if it's the simplest thing in the world.

I think the better advice for command-line editing would be to set up the mouse.


Replies

mikkupikkulast Thursday at 6:08 PM

I have yet to see a shell that has mouse enabled line editing support. It should certainly be possible though.

I do prefer vi bindings at the same time though. Vi bindings and mouse support complement each other well, you don't have to choose one or the other, just use whichever feels most natural and convenient in that exact moment.

show 1 reply
gbaconlast Thursday at 10:01 PM

For a bit about the language, read `3bcw` as move `b`ackward by `3` words and `c`hange the `w`ord under the cursor.

The general form of `b` is `[count]b` where

    [count] An optional number that may precede the command to multiply
            or iterate the command.  If no number is given, a count of one    
            is used, unless otherwise noted.  Note that in this manual the
            [count] is not mentioned in the description of the command,
            but only in the explanation.  This was done to make the
            commands easier to look up.  If the 'showcmd' option is on,
            the (partially) entered count is shown at the bottom of the
            window.  You can use <Del> to erase the last digit (|N<Del>|).

    b       [count] words backward.  |exclusive| motion.
https://vimdoc.sourceforge.net/htmldoc/intro.html#[count]

https://vimdoc.sourceforge.net/htmldoc/motion.html#b

For `c` it’s

    ["x]c{motion} Delete {motion} text [into register x] and start
                  insert.  When  'cpoptions' includes the 'E' flag and
                  there is no text to delete (e.g., with "cTx" when the
                  cursor is just after an 'x'), an error occurs and
                  insert mode does not start (this is Vi compatible).
                  When  'cpoptions' does not include the 'E' flag, the
                  "c" command always starts insert mode, even if there
                  is no text to delete.

    {motion} A command that moves the cursor.  These are explained in
             |motion.txt|.  Examples:
                 w           to start of next word
                 b           to begin of current word
                 4j          four lines down
                 /The<CR>    to next occurrence of "The"
https://vimdoc.sourceforge.net/htmldoc/change.html#c

https://vimdoc.sourceforge.net/htmldoc/intro.html#{motion}

Ferret7446yesterday at 2:30 AM

I think you're confused by the markup. It looks like it's saying Alt-? (Alt and Esc are interchangeable due to terminal reasons) to open up the help search and then type 'window' to search for window commands. Sounds pretty simple to me

show 1 reply
JadeNBlast Thursday at 1:42 PM

> This weird command is presented with such a benevolent innocence as if it's the simplest thing in the world.

I think it's a question of context and familiarity. To a vim user, like me and, I assume, ahmedfromtunis, their examples do indeed seem simple and natural. Presumably, to an emacs user, the example you quote (if it's quoted literally—I don't use emacs and can't even tell) is just as natural, and assuming some comfort with emacs is presumably OK in a manual for the software!

show 2 replies