[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Nano-devel] [PATCH v2] docs: give suggestions for alternative key b
From: |
Brand Huntsman |
Subject: |
Re: [Nano-devel] [PATCH v2] docs: give suggestions for alternative key bindings in the sample nanorc |
Date: |
Sat, 13 Oct 2018 00:52:19 -0600 |
On Sat, 13 Oct 2018 00:13:30 -0500
David Ramsey <address@hidden> wrote:
> Brand Huntsman:
> > I don't know about the usefulness of a markfile function but
> > marktofilestart, marktofileend, markblock, marktoblockstart,
> > marktoblockend, markline, marktolinestart and marktolineend could be
> > useful. These can all be done with string macros but the cursor
> > position is lost when undoing, the functions could preserve it.
>
> What I was trying to do was implement a function/binding for something
> that would require more than two keystrokes to accomplish otherwise.
The point wasn't to reduce keystrokes, but to preserve cursor position when
undoing. If you create "shift-Home shift-Home ^K" or "shift-End ^K" macros, and
then accidentally use them, an undo will put cursor at start or end of the
line. A marktolinestart could save cursor, move to start of line, and then mark
back to the saved cursor. The others would work the same way, but markfile,
markblock and markline wouldn't actually be needed since cursor must be moved
to one of the ends, and the original cursor couldn't be preserved.
> > I don't know what cutrestoffile is used for, but it could be
> > implemented with a "marktofileend cut" string macro.
>
> Am I the only one who often has to deal with files where everything
> after the cursor position needs to be removed?
Ignore me on that, I actually use ^6^Home^K and ^6^End^K all the time. For
large areas of text, I'd rather use two separate keys to mark a file/block and
cut, than use a single key to do both.
The cutrestoffile function preserves the cursor when undoing, but a
cuttofilestart macro wouldn't. The mark functions would not only allow
cuttofile* macros, but any other action as well. They allow macros to do more,
so functions like cutrestoffile wouldn't need to be implemented in code. One
person could use two keys for marktofileend and cut, and another could have a
single key for "marktofileend cut". And both get the same undo benefits.
- [Nano-devel] [PATCH v2] docs: give suggestions for alternative key bindings in the sample nanorc, Benno Schulenberg, 2018/10/09
- Re: [Nano-devel] [PATCH v2] docs: give suggestions for alternative key bindings in the sample nanorc, David Ramsey, 2018/10/13
- Re: [Nano-devel] [PATCH v2] docs: give suggestions for alternative key bindings in the sample nanorc, David Ramsey, 2018/10/14
- Re: [Nano-devel] [PATCH v2] docs: give suggestions for alternative key bindings in the sample nanorc, David Ramsey, 2018/10/14
- Re: [Nano-devel] [PATCH v2] docs: give suggestions for alternative key bindings in the sample nanorc, David Ramsey, 2018/10/15