Web lists-archives.com

Re: text editors

On 2019-03-25 05:29, Erik Christiansen wrote:
On 25.03.19 04:38, mick crane wrote:
Is there any text editor, preferably in a terminal that has the facility to
protect lines in the document, not the document itself ?
I've got 2 blocks of "code" that look similar and I keep editing the wrong
one and then it doesn't work.

The only thing I can think of, using vim (haven't used anything else for
30 years), is to turn on folding, and include a warning in a comment on
the first line of the block. Whether folding is on blank lines (simple
paragraph/block folding), or foldmethod=marker, the first line line is
displayed while folded.

Having to unfold the block, with only the warning and a short initial
line of code or block identifier visible, ought to be sufficiently
alerting if the blood level in the caffeine stream is not too high.

Putting the warning in "foldtext" wouldn't work, because then it'd
appear on all folded paragraphs - unless you used foldmethod=manual, and
only folded the troublesome blocks.

In extremis, you could write a vimscript function to do all sorts of
weird stuff on folding, but I think it would be a bit of work to put a
password on unfolding.

:help folding

not heard about folding.
I'm not very good at this.
kind of related I'm having difficulty copy and pasting.
If on windows [sorry] and in putty session for Debian no gui vi, if highlight text with mouse then it is automatically saved to windows clipboard for pasting but then in putty cannot scroll past bottom of screen. If set marks and then yank to other mark text is yanked but is not in windows clipboard buffer for pasting. In visual mode I can highlight all text with go to mark but that is not in windows buffer either. I tried all different commands to try to get text into windows buffer but nothing seems to work.
Key ID    4BFEBB31