Vimwiki line break

1,143 views
Skip to first unread message

Ping

unread,
Mar 3, 2013, 7:27:22 AM3/3/13
to vim...@googlegroups.com
I'm recently trying to systematically testing vimwiki to see if it can be tuned to my daily work
One problem: in its default syntax how to make a line break without inserting an empty line after each line?
I have a big block of texts (output from a shell cmd for example) need to retain its original format, but using current preformat text syntax ( {{{}}} ) will lose the ability to links.

ping

unread,
Mar 3, 2013, 8:40:42 AM3/3/13
to vim...@googlegroups.com
I spend 2 more hours tested it out again:

with this text:


host> show configuration interfaces ge-0/0/0
enable;
hold-time up 4000 down 0;
gigether-options {
no-auto-negotiation;
802.3ad ae1;
}
optics-options {
warning low-light-warning {
syslog;
}
}

by default it will be rendered as:

<p>
host&gt; show configuration interfaces ge-0/0/0
enable;
hold-time up 4000 down 0;
gigether-options {
</p>
<blockquote>
no-auto-negotiation;
802.3ad <a href="ae1.html">ae1</a>;
</blockquote>
<p>
}
optics-options {
</p>
<blockquote>
warning low-light-warning {
syslog;
}
</blockquote>
<p>
}
</p>


it looks indent with four chars in the following line will generate a
new paragraph (so a new line break effectively)?

and , I just realized, a <br> will help to introduce a line break:
so If I change them to:

host> show configuration interfaces ge-0/0/0 <br>
enable;<br>
hold-time up 4000 down 0;<br>
gigether-options {<br>
no-auto-negotiation;<br>
802.3ad ae1;<br>
}<br>
optics-options {<br>
warning low-light-warning {<br>
syslog;<br>
}<br>
}<br>

I'll archive the target:

<p>
host&gt; show configuration interfaces ge-0/0/0 <br>
enable;<br>
hold-time up 4000 down 0;<br>
gigether-options {<br>
</p>
<blockquote>
no-auto-negotiation;<br>
802.3ad <a href="ae1.html">ae1</a>;<br>
</blockquote>
<p>
}<br>
optics-options {<br>
</p>
<blockquote>
warning low-light-warning {<br>
syslog;<br>
}<br>
</blockquote>
<p>
}<br>
</p>

but that is a lot of work to "modify my original text blocks"...

so my questions are now:

is there a better way to:
1) retain original text format, without changing anything in the text
itselfs,
2) and still have the ability to put some "link" in the text?
if technically not possible, is there any option to customize the <br>
insertion, to sth
simpler (looks better in vim) , like 2 trailing spaces?


still learning vimwiki ....
thanks!




ping

unread,
Mar 3, 2013, 8:52:31 AM3/3/13
to vim...@googlegroups.com
more researching, in the manual:

g:vimwiki_list_ignore_newline

This is HTML related.
Convert newlines to <br />s in multiline list items.

Value Description
0 Newlines in a list item are converted to <br />s.
1 Ignore newlines.

Default: 1

This is great, convert all newlines to <br>, but this options looks
only for list,
ideally, can we get another option to enable this also to normal texts?





ping

unread,
Mar 3, 2013, 1:25:12 PM3/3/13
to vim...@googlegroups.com
sorry if my previous email looks confusing.
so the question is simply, how to retain the line break?

I modified a bit code in html.vim, and , it looks simply add this after
line 944 will have the line break retained:

if !g:vimwiki_ignore_newline
call add(lines, '<br />')
endif

this proves to me extremely important for me to use vimwiki to handle my
daily logs.
not sure you will consider to add it.



essential, I'm seeking for a solution to:
1) conveniently insert hyper link between pieces of texts
* perfect now

2) retain the original format and looks of the text, as original as possible

* not good.

the problems are, current version wiki, following elements breaks in the
html output:

a) line break,
b) 4 chars indent,

I think I just solved a) via those code change, but for b), how to
solve? (recursive quote blocks?)


just clarity, here is the example (config/log) file that I need to handle:

{master}
hostA> show configuration interfaces ge-0/0/0

Stuart Andrews

unread,
Mar 8, 2013, 7:29:49 AM3/8/13
to vim...@googlegroups.com

Ping,

First of all, one of the benefits of using a markup language is that it is "lightweight": easy to read and write. Of course, this comes at a price, and certain text formatting is not easily accomplished. On the other hand, it also helps to prioritize and structure the information that one includes in their documents.

For more complicated document structures, you can add tags like <br>, or there's always full-fledged html.

Sorry I can't be of greater assistance,
- Stu
> --
> You received this message because you are subscribed to the Google Groups "vimwiki" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to vimwiki+u...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>

Lochlan Masters

unread,
Mar 27, 2013, 10:53:07 PM3/27/13
to vim...@googlegroups.com
I have a similar problem, I add a list item to the beginning of each block of text. If you don't have a new line in the block the breaks will continue on every line.

Lochlan Masters

unread,
Mar 29, 2013, 1:03:08 AM3/29/13
to vim...@googlegroups.com
Sorry, if you don't have a new empty line the breaks are automatically added.
Reply all
Reply to author
Forward
0 new messages