[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Nano-devel] [PATCH] possible new feature: allow binding a key to a
From: |
Marco Diego Aurélio Mesquita |
Subject: |
Re: [Nano-devel] [PATCH] possible new feature: allow binding a key to a string |
Date: |
Thu, 1 Feb 2018 17:41:49 -0300 |
On Thu, Feb 1, 2018 at 4:05 PM, Benno Schulenberg <address@hidden> wrote:
> In this way a single keystroke can produce a fragment of text or a
> series of commands, or a mix of the two. It is like a prerecorded
> macro.
>
> This fulfills https://savannah.gnu.org/bugs/?52931.
>
> [ If you would like to see this feature get included, say "Yeah!". ]
>
Yeah!
But, there are things that I think should be discussed now.
First, I'd like to have something like abbreviations in nano. By
abbreviation I mean "type a few chars and it gets replaced by
something else". Like been able to type "\for" and a macro is played
that replaces it by "for ( ;;)" and conveniently positions the cursor.
The feature in the patch would then just became a single keystroke
abbreviation.
Second, this feature is very very similar to pre-recorded macros. Now,
suppose I create a macro to select the char under the cursor and
perform a search. Now, suppose that some days later I change some of
my keybidings. The result: the pre-recorded macro no longer works.
Every keybinding change would force me to review or update all my
macros. But... I've been thinking on a solution for this problem: a
command prompt for nano; just like in "ne". In "ne", by pressing "ESC
:" I get a prompt where I can type commands that "ne" can directly
execute. So, what I propose is that a command prompt should be
implemented in nano (just like ne's one) and the keybiding to invoke
this should be unrebindable. This way we could have macros that do not
depend on the way keys are bound.
What do you think?