Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.debian.user > #206560 > unrolled thread
| Started by | mick crane <mick.crane@gmail.com> |
|---|---|
| First post | 2019-03-25 05:40 +0100 |
| Last post | 2019-03-30 12:20 +0100 |
| Articles | 20 on this page of 118 — 29 participants |
Back to article view | Back to linux.debian.user
text editors mick crane <mick.crane@gmail.com> - 2019-03-25 05:40 +0100
Re: text editors Cindy-Sue Causey <butterflybytes@gmail.com> - 2019-03-25 06:00 +0100
Re: text editors Jude DaShiell <jdashiel@panix.com> - 2019-03-25 06:10 +0100
Re: text editors Erik Christiansen <dvalin@internode.on.net> - 2019-03-25 06:40 +0100
Re: text editors mick crane <mick.crane@gmail.com> - 2019-03-25 09:00 +0100
Re: text editors Erik Christiansen <dvalin@internode.on.net> - 2019-03-25 11:20 +0100
Re: text editors mick crane <mick.crane@gmail.com> - 2019-03-25 11:40 +0100
Re: text editors Dan Hitt <dan.hitt@gmail.com> - 2019-03-25 07:00 +0100
Re: text editors john doe <johndoe65534@mail.com> - 2019-03-25 07:40 +0100
Re: text editors <tomas@tuxteam.de> - 2019-03-25 12:10 +0100
Re: text editors rhkramer@gmail.com - 2019-03-25 12:50 +0100
Re: text editors rhkramer@gmail.com - 2019-03-25 13:10 +0100
Re: text editors Étienne Mollier <etienne.mollier@mailoo.org> - 2019-03-25 21:20 +0100
Re: text editors deloptes <deloptes@gmail.com> - 2019-03-25 22:10 +0100
Re: text editors Teemu Likonen <tlikonen@iki.fi> - 2019-03-25 13:30 +0100
Re: text editors mick crane <mick.crane@gmail.com> - 2019-03-26 08:40 +0100
Re: text editors Teemu Likonen <tlikonen@iki.fi> - 2019-03-26 16:50 +0100
Re: text editors John Hasler <jhasler@newsguy.com> - 2019-03-26 18:00 +0100
Re: text editors Håkon Alstadheim <hakon@alstadheim.priv.no> - 2019-03-26 21:20 +0100
Re: text editors Erik Christiansen <dvalin@internode.on.net> - 2019-03-27 03:30 +0100
Re: text editors rhkramer@gmail.com - 2019-03-27 13:10 +0100
Re: text editors <tomas@tuxteam.de> - 2019-03-27 14:30 +0100
Re: text editors John Hasler <jhasler@newsguy.com> - 2019-03-27 15:10 +0100
Re: text editors <tomas@tuxteam.de> - 2019-03-27 15:40 +0100
Re: text editors rlharris@oplink.net - 2019-03-27 17:30 +0100
Re: text editors rlharris@oplink.net - 2019-03-28 18:40 +0100
keyboard macros (was: Re: text editors) rhkramer@gmail.com - 2019-03-28 19:00 +0100
Re: keyboard macros John Hasler <jhasler@newsguy.com> - 2019-03-28 19:30 +0100
Re: keyboard macros Cindy-Sue Causey <butterflybytes@gmail.com> - 2019-03-28 20:00 +0100
Re: keyboard macros rlharris@oplink.net - 2019-03-28 19:50 +0100
Re: keyboard macros John Hasler <jhasler@newsguy.com> - 2019-03-28 20:10 +0100
xfce launchers rlharris@oplink.net - 2019-04-03 18:40 +0200
Re: xfce launchers Mike Kupfer <mkupfer@alum.berkeley.edu> - 2019-04-04 07:20 +0200
Re: xfce launchers rlharris@oplink.net - 2019-04-04 07:40 +0200
Re: text editors Erik Christiansen <dvalin@internode.on.net> - 2019-03-29 06:20 +0100
Re: text editors deloptes <deloptes@gmail.com> - 2019-03-28 03:40 +0100
Re: text editors John Hasler <jhasler@newsguy.com> - 2019-03-28 03:50 +0100
Re: text editors deloptes <deloptes@gmail.com> - 2019-03-28 08:00 +0100
Re: text editors <tomas@tuxteam.de> - 2019-03-28 09:20 +0100
Re: text editors <tomas@tuxteam.de> - 2019-03-28 10:40 +0100
Re: text editors deloptes <deloptes@gmail.com> - 2019-03-28 21:10 +0100
Emacs without knowing any Lisp (was: text editors) Ben Finney <bignose@debian.org> - 2019-03-29 02:50 +0100
Re: Emacs without knowing any Lisp (was: text editors) Bill Wood <william.wood3@comcast.net> - 2019-03-29 06:50 +0100
Re: text editors John Hasler <jhasler@newsguy.com> - 2019-03-28 14:10 +0100
Re: text editors <tomas@tuxteam.de> - 2019-03-28 14:50 +0100
Re: text editors David Wright <deblis@lionunicorn.co.uk> - 2019-03-28 14:30 +0100
Re: text editors John Hasler <jhasler@newsguy.com> - 2019-03-28 15:20 +0100
Re: text editors <tomas@tuxteam.de> - 2019-03-28 15:30 +0100
Re: text editors deloptes <deloptes@gmail.com> - 2019-03-28 21:30 +0100
Re: text editors deloptes <deloptes@gmail.com> - 2019-03-29 00:40 +0100
Re: text editors Erik Christiansen <dvalin@internode.on.net> - 2019-03-29 06:30 +0100
Re: text editors Teemu Likonen <tlikonen@iki.fi> - 2019-03-29 09:00 +0100
Re: text editors Erik Christiansen <dvalin@internode.on.net> - 2019-03-29 10:20 +0100
Re: text editors Erik Christiansen <dvalin@internode.on.net> - 2019-03-29 12:40 +0100
Re: text editors Stefan Monnier <monnier@iro.umontreal.ca> - 2019-03-29 18:00 +0100
Re: text editors deloptes <deloptes@gmail.com> - 2019-03-29 19:50 +0100
Re: text editors John Hasler <jhasler@newsguy.com> - 2019-03-29 20:10 +0100
Re: text editors deloptes <deloptes@gmail.com> - 2019-03-30 00:10 +0100
Re: text editors Gene Heskett <gheskett@shentel.net> - 2019-03-30 00:30 +0100
Re: text editors John Hasler <jhasler@newsguy.com> - 2019-03-30 01:20 +0100
Re: text editors deloptes <deloptes@gmail.com> - 2019-03-30 01:40 +0100
Re: text editors David Wright <deblis@lionunicorn.co.uk> - 2019-03-30 04:30 +0100
Re: text editors deloptes <deloptes@gmail.com> - 2019-03-30 09:30 +0100
What does all this mean? was Re: text editors David Wright <deblis@lionunicorn.co.uk> - 2019-03-30 17:20 +0100
Re: text editors Erik Christiansen <dvalin@internode.on.net> - 2019-03-30 05:30 +0100
Re: text editors Bob Bernstein <poobah@ruptured-duck.com> - 2019-03-30 02:20 +0100
Re: text editors John Hasler <jhasler@newsguy.com> - 2019-03-30 02:30 +0100
Re: text editors David Wright <deblis@lionunicorn.co.uk> - 2019-03-30 01:50 +0100
Re: text editors deloptes <deloptes@gmail.com> - 2019-04-01 12:10 +0200
Re: text editors <tomas@tuxteam.de> - 2019-04-01 12:10 +0200
Re: text editors Gene Heskett <gheskett@shentel.net> - 2019-04-01 12:50 +0200
Re: text editors David Wright <deblis@lionunicorn.co.uk> - 2019-04-01 16:40 +0200
Re: text editors Nicholas Geovanis <nickgeovanis@gmail.com> - 2019-04-01 16:00 +0200
Re: text editors "Thomas Schmitt" <scdbackup@gmx.net> - 2019-04-01 16:30 +0200
Re: text editors deloptes <deloptes@gmail.com> - 2019-04-01 16:50 +0200
Re: text editors Curt <curty@free.fr> - 2019-04-01 17:40 +0200
Re: text editors Nicholas Geovanis <nickgeovanis@gmail.com> - 2019-04-01 18:20 +0200
Re: text editors "Thomas Schmitt" <scdbackup@gmx.net> - 2019-04-01 19:50 +0200
Re: text editors John Hasler <jhasler@newsguy.com> - 2019-04-01 18:40 +0200
Re: text editors deloptes <deloptes@gmail.com> - 2019-04-01 16:50 +0200
Re: text editors <tomas@tuxteam.de> - 2019-04-01 17:10 +0200
Re: text editors deloptes <deloptes@gmail.com> - 2019-03-29 11:00 +0100
Re: text editors John Hasler <jhasler@newsguy.com> - 2019-03-29 13:00 +0100
Re: text editors deloptes <deloptes@gmail.com> - 2019-03-28 21:20 +0100
Re: text editors deloptes <deloptes@gmail.com> - 2019-03-29 10:50 +0100
Re: text editors Erik Christiansen <dvalin@internode.on.net> - 2019-03-29 11:50 +0100
Re: text editors David Wright <deblis@lionunicorn.co.uk> - 2019-03-28 17:20 +0100
Re: text editors John Hasler <jhasler@newsguy.com> - 2019-03-28 17:50 +0100
Re: text editors Curt <curty@free.fr> - 2019-03-28 18:20 +0100
Re: text editors Dekks Herton <dekkzz78@gmail.com> - 2019-03-29 10:40 +0100
Re: text editors David Wright <deblis@lionunicorn.co.uk> - 2019-03-29 20:30 +0100
Re: text editors Jude DaShiell <jdashiel@panix.com> - 2019-03-30 03:20 +0100
Re: text editors David Wright <deblis@lionunicorn.co.uk> - 2019-04-01 18:40 +0200
Re: text editors Dekks Herton <dekkzz78@gmail.com> - 2019-03-29 10:40 +0100
Re: text editors Teemu Likonen <tlikonen@iki.fi> - 2019-03-27 20:40 +0100
Re: text editors Stefan Monnier <monnier@iro.umontreal.ca> - 2019-03-28 01:30 +0100
Re: text editors Dan Purgert <dan@djph.net> - 2019-03-27 12:10 +0100
Re: text editors Teemu Likonen <tlikonen@iki.fi> - 2019-03-28 07:30 +0100
Re: text editors <tomas@tuxteam.de> - 2019-03-28 11:40 +0100
Re: text editors "tomas@tuxteam.de" <tomas@tuxteam.de> - 2019-03-28 12:30 +0100
Re: text editors "tomas@tuxteam.de" <tomas@tuxteam.de> - 2019-03-28 13:00 +0100
Re: text editors Pierre Fourès <pierre.foures@gmail.com> - 2019-03-28 17:50 +0100
Re: text editors deloptes <deloptes@gmail.com> - 2019-03-28 21:40 +0100
Re: text editors mick crane <mick.crane@gmail.com> - 2019-03-27 10:00 +0100
Re: text editors Curt <curty@free.fr> - 2019-03-27 11:20 +0100
Re: text editors Teemu Likonen <tlikonen@iki.fi> - 2019-03-27 16:50 +0100
Understanding (some) Lisp (was: Re: text editors) rhkramer@gmail.com - 2019-03-28 17:10 +0100
Re: Understanding (some) Lisp Teemu Likonen <tlikonen@iki.fi> - 2019-03-28 17:20 +0100
Re: text editors Ben Finney <bignose@debian.org> - 2019-03-26 03:30 +0100
Re: text editors Teemu Likonen <tlikonen@iki.fi> - 2019-03-26 06:30 +0100
Re: text editors Tony Rowe <ay986@chebucto.ns.ca> - 2019-03-26 23:40 +0100
Re: text editors Stefan Monnier <monnier@iro.umontreal.ca> - 2019-03-28 01:30 +0100
Re: text editors John Hasler <jhasler@newsguy.com> - 2019-03-28 03:00 +0100
Re: text editors <tomas@tuxteam.de> - 2019-03-28 09:20 +0100
Re: text editors mick crane <mick.crane@gmail.com> - 2019-03-27 12:10 +0100
Re: text editors Erik Christiansen <dvalin@internode.on.net> - 2019-03-29 07:30 +0100
Re: text editors Erik Christiansen <dvalin@internode.on.net> - 2019-03-29 09:30 +0100
Re: text editors mick crane <mick.crane@gmail.com> - 2019-03-30 12:20 +0100
Page 1 of 6 [1] 2 3 4 5 6 Next page →
| From | mick crane <mick.crane@gmail.com> |
|---|---|
| Date | 2019-03-25 05:40 +0100 |
| Subject | text editors |
| Message-ID | <xFpyW-1ZJ-5@gated-at.bofh.it> |
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 -- Key ID 4BFEBB31
[toc] | [next] | [standalone]
| From | Cindy-Sue Causey <butterflybytes@gmail.com> |
|---|---|
| Date | 2019-03-25 06:00 +0100 |
| Message-ID | <xFpSi-26e-3@gated-at.bofh.it> |
| In reply to | #206560 |
On 3/25/19, mick crane <mick.crane@gmail.com> 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. I don't know of that, and I tried an "apt-cache search", too.. As I marked your thread "unread" to save in case something crosses my path, it occurred to me that maybe you could at least find a way to do something like colorize it? Or in the meantime of finding something to lock that down, maybe you could throw in one or more comments... that yell "Don't to do that!" I've done that one... :) Cindy :) -- Cindy-Sue Causey Talking Rock, Pickens County, Georgia, USA * runs with birdseed *
[toc] | [prev] | [next] | [standalone]
| From | Jude DaShiell <jdashiel@panix.com> |
|---|---|
| Date | 2019-03-25 06:10 +0100 |
| Message-ID | <xFq1X-2oL-1@gated-at.bofh.it> |
| In reply to | #206561 |
Even if it's not possible to colorize that block, hash marks could be used on beginnings of lines to make those lines comments. Then save the document. Then grep -v "^#" file >file2 That should remove your protected block from the saved file. Now, edit file2. When finished, go into the original file and copy that block out and paste it where you want it into file2. Then overwrite the original save file with file2. On Mon, 25 Mar 2019, Cindy-Sue Causey wrote: > Date: Mon, 25 Mar 2019 00:52:49 > From: Cindy-Sue Causey <butterflybytes@gmail.com> > To: Debian Users <debian-user@lists.debian.org> > Subject: Re: text editors > Resent-Date: Mon, 25 Mar 2019 04:53:04 +0000 (UTC) > Resent-From: debian-user@lists.debian.org > > On 3/25/19, mick crane <mick.crane@gmail.com> 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. > > > I don't know of that, and I tried an "apt-cache search", too.. > > As I marked your thread "unread" to save in case something crosses my > path, it occurred to me that maybe you could at least find a way to do > something like colorize it? > > Or in the meantime of finding something to lock that down, maybe you > could throw in one or more comments... that yell "Don't to do that!" > I've done that one... :) > > Cindy :) > --
[toc] | [prev] | [next] | [standalone]
| From | Erik Christiansen <dvalin@internode.on.net> |
|---|---|
| Date | 2019-03-25 06:40 +0100 |
| Message-ID | <xFquZ-2AV-1@gated-at.bofh.it> |
| In reply to | #206560 |
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 Erik
[toc] | [prev] | [next] | [standalone]
| From | mick crane <mick.crane@gmail.com> |
|---|---|
| Date | 2019-03-25 09:00 +0100 |
| Message-ID | <xFsGu-3SO-3@gated-at.bofh.it> |
| In reply to | #206563 |
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 > > Erik 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. mick -- Key ID 4BFEBB31
[toc] | [prev] | [next] | [standalone]
| From | Erik Christiansen <dvalin@internode.on.net> |
|---|---|
| Date | 2019-03-25 11:20 +0100 |
| Message-ID | <xFuRX-5pa-7@gated-at.bofh.it> |
| In reply to | #206569 |
On 25.03.19 07:53, mick crane wrote:
> not heard about folding.
It can be very handy. I have around 420 pages of notes in one file. They
present as a one-page contents table with section page counts. While
cursoring down and then across opens a chosen fold, there are several
folding levels to the bottom. Hierarchical groping and digging is an
inefficient constraint suffered by GUIs; it is much quicker to just use
vim's '/' to search for a keyword. Given capitalised headings and
keywords, suffixed with a ':' for the major section on that topic, the
right line in 28532 lines is quickly found, and the required folds
opened automatically.
> I'm not very good at this.
Give it 30 years. Experience creeps up on you.
> kind of related I'm having difficulty copy and pasting.
> If on windows [sorry] and in putty session for Debian no gui vi, if
Commiserations. I'd be sorry too if I had to use windows. (Avoided it
entirely during 30 years in IT - took a fat redundancy package when
windows finally caught up, and retired.
> highlight text with mouse then it is automatically saved to windows
> clipboard for pasting but then in putty cannot scroll past bottom of screen.
Sounds like a putty limitation? I'll admit to only ever having copied to
an X11 clipboard, so can't offer relevant experience. I've never used
gvim - plain vim in an xterm works fine with the X11 clipboard, so long
as I remember to turn off autoindent before pasting, to avoid a
stairstep paste. (I have the F12 key mapped to toggle vim's "paste"
attribute, so a single key handles both on and off.)
> If set marks and then yank to other mark text is yanked but is not in
> windows clipboard buffer for pasting.
Have you checked whether the yank goes into the "* (clipboard) register?
Check also the "+ register, in case the windows clipboard is looking
there instead. A post on the vim-use ML might elicit more info related
to your environment. Back in 2011, Gary Johnson had a "Copy and paste
problem" which was fixed for windows with "set clipboard^=unnamed".)
:help 'clipboard'
:help :set^=
I tend to just use a mouse drag to grab text to the X11 clipboard for
pasting into something GUI.
> 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.
Check " :set clipboard ? "
IIUC, it should include unnamed and unnamedplus for problem-free
communication with the windows clipboard - inferring from a couple of
archive posts from 2011,12. Including unnamedplus isn't good for the
linux clipboard, though.
If all else fails, the vim-use mailing list is a darned sight more
knowledgeable on vim/windows stuff.
Erik
[toc] | [prev] | [next] | [standalone]
| From | mick crane <mick.crane@gmail.com> |
|---|---|
| Date | 2019-03-25 11:40 +0100 |
| Message-ID | <xFvbk-5vQ-3@gated-at.bofh.it> |
| In reply to | #206572 |
On 2019-03-25 10:12, Erik Christiansen wrote: > On 25.03.19 07:53, mick crane wrote: >> not heard about folding. > > It can be very handy. I have around 420 pages of notes in one file. > They > present as a one-page contents table with section page counts. While > cursoring down and then across opens a chosen fold, there are several > folding levels to the bottom. Hierarchical groping and digging is an > inefficient constraint suffered by GUIs; it is much quicker to just use > vim's '/' to search for a keyword. Given capitalised headings and > keywords, suffixed with a ':' for the major section on that topic, the > right line in 28532 lines is quickly found, and the required folds > opened automatically. > >> I'm not very good at this. > > Give it 30 years. Experience creeps up on you. > >> kind of related I'm having difficulty copy and pasting. >> If on windows [sorry] and in putty session for Debian no gui vi, if > > Commiserations. I'd be sorry too if I had to use windows. (Avoided it > entirely during 30 years in IT - took a fat redundancy package when > windows finally caught up, and retired. > >> highlight text with mouse then it is automatically saved to windows >> clipboard for pasting but then in putty cannot scroll past bottom of >> screen. > > Sounds like a putty limitation? I'll admit to only ever having copied > to > an X11 clipboard, so can't offer relevant experience. I've never used > gvim - plain vim in an xterm works fine with the X11 clipboard, so long > as I remember to turn off autoindent before pasting, to avoid a > stairstep paste. (I have the F12 key mapped to toggle vim's "paste" > attribute, so a single key handles both on and off.) > >> If set marks and then yank to other mark text is yanked but is not in >> windows clipboard buffer for pasting. > > Have you checked whether the yank goes into the "* (clipboard) > register? > Check also the "+ register, in case the windows clipboard is looking > there instead. A post on the vim-use ML might elicit more info related > to your environment. Back in 2011, Gary Johnson had a "Copy and paste > problem" which was fixed for windows with "set clipboard^=unnamed".) > > :help 'clipboard' > :help :set^= > > I tend to just use a mouse drag to grab text to the X11 clipboard for > pasting into something GUI. > >> 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. > > Check " :set clipboard ? " > > IIUC, it should include unnamed and unnamedplus for problem-free > communication with the windows clipboard - inferring from a couple of > archive posts from 2011,12. Including unnamedplus isn't good for the > linux clipboard, though. > > If all else fails, the vim-use mailing list is a darned sight more > knowledgeable on vim/windows stuff. > > Erik tried "set clipboard=unnamed" and that. ":%y *" is supposed to copy to buffer and ":%y +" also says unrecognized register or something" ": reg" shows "" "0 ": "% so I don't know. obviously buffers are on different machines and maybe putty just buffers what's on the screen. Just wondered why it didn't work. mick -- Key ID 4BFEBB31
[toc] | [prev] | [next] | [standalone]
| From | Dan Hitt <dan.hitt@gmail.com> |
|---|---|
| Date | 2019-03-25 07:00 +0100 |
| Message-ID | <xFqOl-2IQ-1@gated-at.bofh.it> |
| In reply to | #206560 |
[Multipart message — attachments visible in raw view] — view raw
On Sun, Mar 24, 2019 at 9:38 PM mick crane <mick.crane@gmail.com> 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 > > Hi Mick, Actually, you can do this, at least in emacs, and this can be done in a terminal, at least in an xterm. If you're using emacs as an app, then it is just a matter of highlighting the region, then choosing Edit > Text Properties > Special Properties > Read Only (This is described in stack overflow, https://emacs.stackexchange.com/a/46066, where i learned about it.) However, you want to do it in a terminal, which is a good thing i think. In this case, you probably have to access the menu things without a mouse. But in xterm, at least, you can follow this procedure. First, if you do not see the menu along the top, do M-x menu-bar-mode. (If you can see the menu, don't do M-x menu-bar-mode, because it toggles.) Then, at least in xterm, you can do F10 (or function-F10) to get into the menus and use the arrow keys to move around, and do the Edit > Text Properties thing. Note that i do not know how to do this in xfce4-terminal, which is what debian gives me, because F10 gets me into the xfce4-terminal. But i don't know what terminal you are using, so don't know if that's an issue for you or not. Anyhow good luck, and it's a good question invho. dan
[toc] | [prev] | [next] | [standalone]
| From | john doe <johndoe65534@mail.com> |
|---|---|
| Date | 2019-03-25 07:40 +0100 |
| Message-ID | <xFrr3-3ci-3@gated-at.bofh.it> |
| In reply to | #206560 |
On 3/25/2019 5:38 AM, 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. Not strictly an answer but I would track the good file for example in Git. That way, you can always return back to a working state. $ git checkout -- . -- John Doe
[toc] | [prev] | [next] | [standalone]
| From | <tomas@tuxteam.de> |
|---|---|
| Date | 2019-03-25 12:10 +0100 |
| Message-ID | <xFvEm-5Vy-7@gated-at.bofh.it> |
| In reply to | #206560 |
[Multipart message — attachments visible in raw view] — view raw
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". In that case, I guess the straight answer to your question above is "no". And with the possibility that, perhaps, this (hypothetical) editor won't be the only interface to your file, it might be wise to consider another angle from which to attack the problem. A version control system which allows you to easily revert to a previous version of your file should anything go wrong. Or a post-commit script charged of ensuring certain constraints before "activating" your new version of the file (cf. visudo for inspiration). Just two examples to perhaps get you started. You can nevertheless get every civilised editor to do the trick (vim, Emacs will easily comply) -- but perhaps you won't be solving your problem... Cheers -- t
[toc] | [prev] | [next] | [standalone]
| From | rhkramer@gmail.com |
|---|---|
| Date | 2019-03-25 12:50 +0100 |
| Message-ID | <xFwh4-68B-5@gated-at.bofh.it> |
| In reply to | #206575 |
On Monday, March 25, 2019 07:05:14 AM tomas@tuxteam.de 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.
[toc] | [prev] | [next] | [standalone]
| From | rhkramer@gmail.com |
|---|---|
| Date | 2019-03-25 13:10 +0100 |
| Message-ID | <xFwAq-6ux-7@gated-at.bofh.it> |
| In reply to | #206576 |
On Monday, March 25, 2019 07:47:31 AM rhkramer@gmail.com wrote: > 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. Ahh, yes, after a little bit of googling, I found (and remember) that Word had (and presumably still has) a master document concept -- which is essentially the same as the include file concept. Then, looking at ODF (Open Document Format), which is either the default or at least one of the formats supported by Libre Office, also supports a master document format.
[toc] | [prev] | [next] | [standalone]
| From | Étienne Mollier <etienne.mollier@mailoo.org> |
|---|---|
| Date | 2019-03-25 21:20 +0100 |
| Message-ID | <xFEeB-2CO-1@gated-at.bofh.it> |
| In reply to | #206576 |
On 3/25/19 12:47 PM, rhkramer@gmail.com wrote: > 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. Good Day rhkramer, Perhaps I missed some points, but wouldn't `.`, or `source`, command do the trick, instead of building a script dynamically? readonly.sh: # Don't touch that! PATH="/opt/thirparty/bin:$PATH" CPATH="/opt/thirparty/include:$CPATH" LD_LIBRARY_PATH="/opt/thirparty/lib:$LD_LIBRARY_PATH" export PATH CPATH LD_LIBRARY_PATH main.sh: #! /bin/bash set -e # Loading environment from read only file . readonly.sh printf 'Using libraries in %s\n' "$LD_LIBRARY_PATH" do_stuff_with_thirdparty_program If I need some configuration, or a sort of shell functions library, this is something I would consider. Kind Regards, -- Étienne Mollier <etienne.mollier@mailoo.org> All opinions are my own.
[toc] | [prev] | [next] | [standalone]
| From | deloptes <deloptes@gmail.com> |
|---|---|
| Date | 2019-03-25 22:10 +0100 |
| Message-ID | <xFF10-38I-21@gated-at.bofh.it> |
| In reply to | #206588 |
Étienne Mollier wrote: > If I need some configuration, or a sort of shell functions > library, this is something I would consider. +1
[toc] | [prev] | [next] | [standalone]
| From | Teemu Likonen <tlikonen@iki.fi> |
|---|---|
| Date | 2019-03-25 13:30 +0100 |
| Message-ID | <xFwTL-6AO-7@gated-at.bofh.it> |
| In reply to | #206560 |
[Multipart message — attachments visible in raw view] — view raw
mick crane [2019-03-25 04:38:31Z] 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.
GNU Emacs has text properties which can be added to any piece of text.
One of the properties is named "read-only". I made two functions to
handle the situation you described.
Put these function to you Emacs's init file (~/.emacs or
~/.emacs.d/init.el):
(defun read-only-region (beg end)
"Makes a region in the current buffer read only, from buffer
position BEG to END. If this function is called interactively use
the current hightlighted region."
(interactive "r")
(add-text-properties beg end '(read-only t)))
(defun remove-read-only ()
"Remove all read only text properties from the current buffer."
(interactive)
(let ((inhibit-read-only t))
(remove-text-properties (point-min) (point-max)
'(read-only t))))
Select some text in a buffer and execute command "Alt+x
read-only-region". That area becomes read only. To remove all read only
text areas from the current buffer execute command "Alt+x
remove-read-only".
--
/// Teemu Likonen - .-.. <https://keybase.io/tlikonen> //
// PGP: 4E10 55DC 84E9 DFF6 13D7 8557 719D 69D3 2453 9450 ///
[toc] | [prev] | [next] | [standalone]
| From | mick crane <mick.crane@gmail.com> |
|---|---|
| Date | 2019-03-26 08:40 +0100 |
| Message-ID | <xFOQF-zq-9@gated-at.bofh.it> |
| In reply to | #206580 |
On 2019-03-25 12:29, Teemu Likonen wrote: > mick crane [2019-03-25 04:38:31Z] 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. > > GNU Emacs has text properties which can be added to any piece of text. > One of the properties is named "read-only". I made two functions to > handle the situation you described. > > Put these function to you Emacs's init file (~/.emacs or > ~/.emacs.d/init.el): > > > (defun read-only-region (beg end) > "Makes a region in the current buffer read only, from buffer > position BEG to END. If this function is called interactively use > the current hightlighted region." > (interactive "r") > (add-text-properties beg end '(read-only t))) > > (defun remove-read-only () > "Remove all read only text properties from the current buffer." > (interactive) > (let ((inhibit-read-only t)) > (remove-text-properties (point-min) (point-max) > '(read-only t)))) > > > Select some text in a buffer and execute command "Alt+x > read-only-region". That area becomes read only. To remove all read only > text areas from the current buffer execute command "Alt+x > remove-read-only". there it is then, although I've so far managed to avoid Emacs since heard it is more of an operating system than an editor. mick -- Key ID 4BFEBB31
[toc] | [prev] | [next] | [standalone]
| From | Teemu Likonen <tlikonen@iki.fi> |
|---|---|
| Date | 2019-03-26 16:50 +0100 |
| Message-ID | <xFWuR-5bN-5@gated-at.bofh.it> |
| In reply to | #206601 |
[Multipart message — attachments visible in raw view] — view raw
mick crane [2019-03-26 07:35:11Z] wrote: > there it is then, although I've so far managed to avoid Emacs since > heard it is more of an operating system than an editor. There are those who know Emacs, and there are those who know decades old jokes about Emacs. -- /// Teemu Likonen - .-.. <https://keybase.io/tlikonen> // // PGP: 4E10 55DC 84E9 DFF6 13D7 8557 719D 69D3 2453 9450 ///
[toc] | [prev] | [next] | [standalone]
| From | John Hasler <jhasler@newsguy.com> |
|---|---|
| Date | 2019-03-26 18:00 +0100 |
| Message-ID | <xFXAC-5O3-15@gated-at.bofh.it> |
| In reply to | #206629 |
mick crane wrote: > there it is then, although I've so far managed to avoid Emacs since > heard it is more of an operating system than an editor. Teemu Likonen writes: > There are those who know Emacs, and there are those who know decades > old jokes about Emacs. And there are those who avoid learning what Emacs is actually like because they have heard decades old jokes about it. -- John Hasler jhasler@newsguy.com Elmwood, WI USA
[toc] | [prev] | [next] | [standalone]
| From | Håkon Alstadheim <hakon@alstadheim.priv.no> |
|---|---|
| Date | 2019-03-26 21:20 +0100 |
| Message-ID | <xG0I9-7RX-5@gated-at.bofh.it> |
| In reply to | #206635 |
Den 26.03.2019 17:52, skrev John Hasler: > mick crane wrote: >> there it is then, although I've so far managed to avoid Emacs since >> heard it is more of an operating system than an editor. > Teemu Likonen writes: >> There are those who know Emacs, and there are those who know decades >> old jokes about Emacs. > And there are those who avoid learning what Emacs is actually like > because they have heard decades old jokes about it. Seriously though: The old "arguments" against emacs are moot theese days. You can run Linux/Apache/Mysql on your wrist-watch, so launching an entire OS to edit a file would be OK, /if/ emacs was an entire OS. The semi-serious argument about much of emacs being run as an interpreted language is also moot, when people build entire operating-systems in Javascript, and that is not just OK, it is the best thing since sliced bread. Emacs is NOT an OS, though, and learning just the editing commands is very simple. Just follow the built-in help, or do the built-in tutorial. Then, when you need some arcane feature you can just google it, or learn elisp and code it up yourself. Having all kinds of interactive sessions available in editable buffers is really nice. Searching&sorting, cutting&pasting from shells to new command-lines, scripts or emails becomes very easy, so keeping what you find out and building upon your previous experiences is that much easier. Favourite emacs command: M-x shell Favourite emacs module: tramp
[toc] | [prev] | [next] | [standalone]
| From | Erik Christiansen <dvalin@internode.on.net> |
|---|---|
| Date | 2019-03-27 03:30 +0100 |
| Message-ID | <xG6ue-2NW-3@gated-at.bofh.it> |
| In reply to | #206635 |
On 26.03.19 11:52, John Hasler wrote: > mick crane wrote: > > there it is then, although I've so far managed to avoid Emacs since > > heard it is more of an operating system than an editor. > > Teemu Likonen writes: > > There are those who know Emacs, and there are those who know decades > > old jokes about Emacs. > > And there are those who avoid learning what Emacs is actually like > because they have heard decades old jokes about it. IME, the real reason why we won't consider the other editor is because of the time and energy spent learning the first good one we came across, and the grating frustration and lost productivity of dropping to the bottom of the learning curve to switch to horse of a different colour but similar performance. The "typing chords" vs modality difference essentially becomes moot once you adapt to your choice. Probably. Erik
[toc] | [prev] | [next] | [standalone]
Page 1 of 6 [1] 2 3 4 5 6 Next page →
Back to top | Article view | linux.debian.user
csiph-web