[Top][All Lists]

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

Re: [Help-nano] block comment

From: Benno Schulenberg
Subject: Re: [Help-nano] block comment
Date: Sun, 01 Nov 2015 12:15:05 +0100

On Sat, Oct 31, 2015, at 06:04, higuita wrote:
>       I would like to know if nano can do comment block operations, like
>       selecting several lines and then "comment out" all those
>       lines.

Hm.  You can do that by using a regex search-and-replace on
a selected piece of text.  I know, that is a lot of keystrokes,
but what you're asking (prefixing lines with some character)
is quite specific -- indenting on the other hand is used in
any kind of text.

What nano needs is the ability to define and execute macros,
so that you can assign the above long string of keystrokes
to a certain key combo.  Lacking that, it would be nice if
nano could execute an external program on a selected piece
of text.  It can already run a spell checker on such a piece
of text; maybe this can be generalized to be able to run any
kind of program...

Hmmm.  Maybe you can "abuse" the speller to do what you want.
Write a little sed script that prefixes a given file with the
required character, then add 'set speller ""' to
your .nanorc, and then ^T should do what you want.


-- - Or how I learned to stop worrying and
                          love email again

reply via email to

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