Re: text editors
On Monday, March 25, 2019 07:05:14 AM tomas@xxxxxxxxxx wrote:
> On Mon, Mar 25, 2019 at 04:38:31AM +0000, 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.
> > mick
> What is "the document"? And what format is it in?
> I have the strong suspicion that the answer to the first would be
> "a configuration file of some sort" and to the second, it might
> be "plain text".
Because there have been some interesting ideas in this thread, I'll add one
more (which might not be interesting). ;-)
I share the thought that the file / document might be "a configuration file of
some sort" and have a suggestion that might be useful in that case, or if the
document is a program, and maybe even if it is just a text (not necessarily
plain) file that you open with a word processor.
The thought: put the part of the document that should not be modified in a read
only file, then "include" that file in another file that you allow to be edited
(read / write).
There are various ways to do this, depending on the computer language under
considereration (for example, #include in C / C++).
There are equivalent approaches in bash, but I forget them (in bash, it might
be a little more convoluted, like an external / 3rd file that assembles a new
file from the read-only and read / write files.
I even have a vague recollection that there is / was an "include a file"
facility in (Microsoft) Word. And, if so, because LIbre Office seems to make a
point of providing a feature complete "clone" (mcow) of Word, I suspect there
is an include facility there as well.