Highlight and annotate plaintext

15 views
Skip to first unread message

Julius Hamilton

unread,
Jun 8, 2021, 7:54:57 AM6/8/21
to vim...@googlegroups.com
Hey,

Does anyone know a good command line tool for highlighting and annotating plain text documents? Not syntax highlighting via pattern matching. Just going through a document with a cursor, and highlighting it for the purpose of note-taking. Plus adding comments would be good, but optional.

Thanks very much,
Julius



Philip Rhoades

unread,
Jun 9, 2021, 5:51:54 AM6/9/21
to vim...@googlegroups.com, Julius Hamilton
Julius,
By definition you can't put extra information into "plain text" files.
Some decades on DOS we used to put extra info like this at the end of
the file preceded by a CTRL-Z - so it would like a "plain text" file to
the OS but there was "invisible" appended information that do nice
things with the text.

I don't know if anyone does anything resembling this now - off the top
of my head, in *nix you could have the plain text file associated with
another file eg:

PlainTextFile.txt

with and attributes file:

PlainTextFile.attrib

? - if this could work, you just need to find someone who is interested
in writing the software for it . . of course this highlighting etc would
only display sensibly in this new software . .

Regards,

Phil.

> Thanks very much,
> Julius
>
> --
> --
> You received this message from the "vim_use" maillist.
> Do not top-post! Type your reply below the text you are replying to.
> For more information, visit http://www.vim.org/maillist.php
>
> ---
> You received this message because you are subscribed to the Google
> Groups "vim_use" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to vim_use+u...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/vim_use/CAGrXgp33b6Zg8WwucDwXmTWA2eU0aXNwFakFrwbTYex0T1_sag%40mail.gmail.com
> [1].
>
>
> Links:
> ------
> [1]
> https://groups.google.com/d/msgid/vim_use/CAGrXgp33b6Zg8WwucDwXmTWA2eU0aXNwFakFrwbTYex0T1_sag%40mail.gmail.com?utm_medium=email&utm_source=footer

--
Philip Rhoades

PO Box 896
Cowra NSW 2794
Australia
E-mail: ph...@pricom.com.au

russur...@verizon.net

unread,
Jun 9, 2021, 10:07:42 AM6/9/21
to julk...@gmail.com, vim...@googlegroups.com
Hi,

You made me remember and find this. Check this out, it is a way to put editing comments into a plain text file like markdown.

Russ


--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+u...@googlegroups.com.

Christian Brabandt

unread,
Jun 9, 2021, 10:33:33 AM6/9/21
to vim...@googlegroups.com
For Vim, perhaps this plugin does it:
https://www.vim.org/scripts/script.php?script_id=2208

Best,
Christian
--
"Wir gestehn lieber unsre moralischen Irrtümer, Fehler und
Gebrechen, als unsre wissenschaftlichen."
-- Goethe, Maximen und Reflektionen, Nr. 965

rwmit...@gmail.com

unread,
Jun 9, 2021, 1:41:13 PM6/9/21
to vim_use
I would have agreed with Phillip's initial assessment.
Goes to show there is always something new to learn.
And you never know when asking a question, how many other people might be interested in the answers.

meine

unread,
Jun 10, 2021, 6:40:11 AM6/10/21
to vim...@googlegroups.com
There are some pages on the net that describe making comments in
'StackOverflow Markdown', and one of them found the trick to make
comments in your tekst, that are not visible in print:

https://alvinalexander.com/technology/markdown-comments-syntax-not-in-generated-output/

I trief this in Vim with a plain markdown file, where the following line
is skipped when you make a pdf with pandoc:

[//]: # (This syntax works like a comment, and won't appear in any output.)

Didn't find out yet what part dides visibility in the pdf version, but
it works.

//meine

meine

unread,
Jun 10, 2021, 6:45:13 AM6/10/21
to vim...@googlegroups.com
On Thu, Jun 10, 2021 at 12:39:34PM +0200, meine wrote:
> On Tue, Jun 08, 2021 at 01:54:39PM +0200, Julius Hamilton wrote:
> > Hey,
> >
> > Does anyone know a good command line tool for highlighting and annotating
> > plain text documents? Not syntax highlighting via pattern matching. Just
> > going through a document with a cursor, and highlighting it for the purpose
> > of note-taking. Plus adding comments would be good, but optional.

The explanation here is better:

https://stackoverflow.com/questions/4823468/comments-in-markdown

[citation]: If you want a comment that is strictly for yourself (readers of the converted document should not be able to see it, even with "view source") you could (ab)use the link labels (for use with reference style links) that are available in the core Markdown specification:

http://daringfireball.net/projects/markdown/syntax#link

That is:

[comment]: <> (This is a comment, it will not be included)
[comment]: <> (in the output file unless you use it in)
[comment]: <> (a reference style link.)

Or you could go further:

[//]: <> (This is also a comment.)

To improve platform compatibility (and to save one keystroke) it is also possible to use # (which is a legitimate hyperlink target) instead of <>:

[//]: # (This may be the most platform independent comment)

For maximum portability it is important to insert a blank line before and after this type of comments, because some Markdown parsers do not work correctly when definitions brush up against regular text.

In general, this approach should work with most Markdown parsers, since it's part of the core specification. (even if the behavior when multiple links are defined, or when a link is defined but never used, is not strictly specified).
Reply all
Reply to author
Forward
0 new messages