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: Brand Huntsman
Subject: Re: [Nano-devel] [RFC] Re-execute last command
Date: Fri, 6 Oct 2017 19:49:19 -0600

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?

As for a nano IDE, won't that dump the output from gcc into the source file? 
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.

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. 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. 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.

I wouldn't use the feature though as I have a dedicated terminal window to run 
make and other commands for any project I'm working on. And ^-R-X-Up-Up-Enter 
would be my normal use case for execute history (cycling between two commands).




reply via email to

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