http://www.perlmonks.org?node_id=34693


in reply to RE: Editor tricks.
in thread Editor tricks.

vi and emacs both have named registers that you can use to store and recall text. I don't know how to use vi but I know they're there.

emacs does lots of other wonderful things that I can't/haven't figured out how to do in vi. emacs figures out the line ending and uses it transparently, if it gets it wrong you can override it.

Nuance

Replies are listed 'Best First'.
RE: RE: RE: Editor tricks.
by Petruchio (Vicar) on Sep 30, 2000 at 13:35 UTC
    nuance: "vi and emacs both have named registers that you can use to store and recall text. I don't know how to use vi but I know they're there."

    Hitting the double quote in command mode tells vi that the next letter you enter is going to be the name of the buffer that you'll be refering to. For instance:

    "aD

    will cut everything from the cursor to the end of the line, and throw it in buffer a. To paste it in again, you'd say:

    "ap

    The :map command binds a key to a macro... like so:

    :map q xp

    which will make the q key cut the letter the cursor's presently on and paste it after the next one, effectively transposing them.

    Some of the other things you mention make me think. It's about time I went back and learned some more stuff, to make my editing more pleasant. It's easy to just roll along after a certain point, using what you know.