nano-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Nano-devel] [RFC] Re-execute last command


From: Marco Diego Aurélio Mesquita
Subject: Re: [Nano-devel] [RFC] Re-execute last command
Date: Sat, 7 Oct 2017 01:51:35 -0300

On Fri, Oct 6, 2017 at 10:49 PM, Brand Huntsman <address@hidden> wrote:
> On Fri, 6 Oct 2017 21:53:01 -0300
> Marco Diego Aurélio Mesquita <address@hidden> wrote:
>
>> I want to use nano as a small IDE (actually I didn't want to tell it
>> because it may sound silly). Now, suppose you want to compile and run
>> a C source file (say test.c); you can do it easily by hitting ^-R-X,
>> type "gcc test.c && ./a.out" and press Enter. If you modify the code
>> and want to test it again, you have to hit ^-R-X-Up-Enter. You have to
>> do it again every single time you want to re-run it. I want to reduce
>> that to ^-R-R.
>
> What if you go to insert a file or run a command and accidentally tap R twice 
> and get ^-R-R?
>

That may not be a problem if nano is set to add the output of the
command in a new buffer.

> As for a nano IDE, won't that dump the output from gcc into the source file?

Not necessarily.

>Would be better if nano had the ability to load user-defined key bindings that 
>run commands and display output in an immutable buffer. It opens the buffer, 
>displays command after a prompt-like character, then displays command output, 
>and next command is appended to the already open buffer. The buffer can be 
>closed like any other buffer and all output is discarded.
>

Sounds good but is a bit more advanced (complicated) than what I had in mind.

> Command bindings could be defined in nanorc and maybe have conditional
> text file paths so commands are only loaded for certain file types or
> files in certain directories.

Assign a command to a keybinding would be great for what I want.

> Maybe commands have short names and can
> be accessed like search history with the last used command shown in the
> prompt. Just one key binding is needed to open the prompt and ENTER
> runs last command. It might be easier for users to find named commands
> in a list then to remember which key binding or number they assigned a
> command to.

Now that is almost exactly the idea I had in mind. Named commands that
can be chosen in a prompt or run through a keybinding. Please take a
look at gedit's external tools plugin. That is the level of
flexibility that I'd like to have.

> Maybe you can switch the prompt mode to allow typing new
> commands and it has a saved history like execute history. It would
> remember which mode it was in and display last command in the prompt,
> use down arrow to clear prompt if you need to type a new command. Or a
> setting could enable showing last command in prompt or not, maybe even
> add a setting to show last command in the current execute prompt,
> ^-R-X-Enter instead of ^-R-X-Up-Enter.
>

Showing that last command in the current execute prompt was rejected.
Don't know if it would be accepted if it was disabled by default and
only enabled through a setting in nanorc.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]