nano-devel
[Top][All Lists]
Advanced

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

Re: [Nano-devel] [PATCH] new feature: option -e, for specifying commands


From: Brand Huntsman
Subject: Re: [Nano-devel] [PATCH] new feature: option -e, for specifying commands to execute at startup
Date: Thu, 30 Aug 2018 17:02:04 -0600

On Thu, 30 Aug 2018 12:18:17 -0300
Marco Diego Aurélio Mesquita <address@hidden> wrote:

> > Why do you want another stream editor?  Is sed not good enough as
> > a stream editor?
> 
> Nano could have a more intuitive command language than sed.

You mean more verbose and interactive?

sed -i 's:foo:bar:g' file
vs
nano -e '${replace}foo${enter}bar${enter}' file
# and then manually pressing YN for each instance

It would be great if you want an interactive search&replace, but that could be 
an extension of the cli search feature. If cli search is adopted, it should 
support replace. But -s is already used by speller and -w used by nowrap, so 
perhaps -f for find. It should also support something similar to sed, and have 
the first character be a non-alpha separator, or an alpha toggle such as 'r' or 
'c' for regex and case-sensitive.

nano -f ':foo:' file
nano -f 'c:foo:' file
nano -f ':foo:bar:' file
nano -f 'rc:^foo:bar:' file

Oh and -e is listed as "Ignored, for compatibility with Pico.".




reply via email to

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