Any way to add comments at the end of a line?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Any way to add comments at the end of a line?

programandala.net

I usually add the Vim default folding marks ({{{) to my documents. In
order to make the titles of the folded sections visible, I duplicate
them in the comment:

----

// Chapter title {{{2
== Chapter title

bla bla

// Subchapter title {{{3
=== Subhapter title

bla bla

----

In fact I wrote a simple Vim script to create that comments.

I wonder if there's any way to add a comment at the end of a line, say
`///` or whatever, making things simpler, like in programming languages:

----

== Chapter title /// {{{2

bla bla

=== Subchapter title /// {{{3

bla bla

----

It could be useful in other contexts as well, e.g. table rows.

I tried even `ifdef::` with an unexistent attribute in order to hide the
folding marks from the processor, but of course it doesn't work there,
it's processed as part of the title:

----

== Chapter title ifdef::x[{{{2]

bla bla

=== Subchapter title ifdef::x[{{{3]

bla bla

----


--
Marcos Cruz
http://programandala.net