Alternative syntax?

102 views
Skip to first unread message

Eric Weir

unread,
Oct 27, 2011, 9:11:02 AM10/27/11
to vimwiki
I've been in the process of transitioning from using standard word
processors for more or less academic writing -- OpenOffice and Nisus
Writer Pro, in particular -- to composing in Markdown/Multimarkdown,
compiling for LaTeX, then tweaking the LaTeX and printing with a LaTeX
front-end, in my case LyX.

I also have a good deal of experience with a browser-based wiki,
TiddlyWiki. Since moving to Vim several months ago I have been looking
for a Vim-based alternative to TiddlyWiki. For a while it looked like
SoyWiki http://danielchoi.com/software/soywiki.html might be it.

I've had vimwiki installed for a while and yesterday decided to start
checking it out. I sense it miight turn out to be more versatile than
SoyWiki. One thing I was able to do with SoyWiki that it appears can't
be done with vimwiki at the moment was to use Markdown/Multimarkdown
syntax and implement folding on Markdown/Multimarkdown headers.

I'm wondering if vimiwiki's commitment to Google wiki syntax is
absolutely irrevocable, whether it might be replaced with Markdown/
Multimarkdown syntax.

I suspect chances are slim, but I thought I'd check.

Thanks,

Eric Weir

Maxim Kim

unread,
Nov 22, 2011, 3:42:47 AM11/22/11
to vim...@googlegroups.com
Hi,

There is basic markdown support in vimwiki (I am not sure if it is in 1.2 though)

Stu Andrews is the one who use it extensivly.

Check :h vimwiki-option-syntax.



Eric Weir

unread,
Nov 22, 2011, 5:01:22 AM11/22/11
to vim...@googlegroups.com

Thanks, Maxim. My needs are basic at the moment, but a part of my writing, which is becoming a bigger part, requires footnotes and citations.

I'll check out the help.

------------------------------------------------------------------------------------------
Eric Weir
Decatur, GA USA
eew...@bellsouth.net


Eric Weir

unread,
Nov 24, 2011, 2:21:32 PM11/24/11
to vim...@googlegroups.com
On Nov 22, 2011, at 3:42 AM, Maxim Kim wrote:

Would this be the way to get markdown syntax in vimwiki?

let g:vimwiki_list = [{'path': '~/ericweir/', 'syntax': 'markdown'}]

If so, will I get folding on headers?

Thanks,
------------------------------------------------------------------------------------------
Eric Weir
Decatur, GA

"Style is truth." 

- Ray Bradbury

Etienne B. Roesch

unread,
Nov 24, 2011, 5:55:55 PM11/24/11
to vim...@googlegroups.com
Hi there,

Add  let g:vimwiki_folding = 1  to your .vimrc, and you'll get folding.
See  :h vimwiki  for more information, Section 6, including keyboard shortcuts for toggle folding.

Etienne

Eric Weir

unread,
Nov 24, 2011, 6:59:20 PM11/24/11
to vim...@googlegroups.com

On Nov 24, 2011, at 5:55 PM, Etienne B. Roesch wrote:

Add  let g:vimwiki_folding = 1  to your .vimrc, and you'll get folding.
See  :h vimwiki  for more information, Section 6, including keyboard shortcuts for toggle folding.

Thanks, Etienne. I'm unclear. I'm currently using the default syntax, which I believe is mediawiki. In any case, with it I have folding.

I was wondering whether, if I switched to markdown syntax I would still have folding. Are you saying this will give me folding, or that it'll give me folding with markdown syntax? 

Or does it matter? If the folding method is syntax, does the particular flavor of syntax matter?

Regards,
------------------------------------------------------------------------------------------
Eric Weir
Decatur, GA 

"What does it mean...that the world is so beautiful?" 

- Mary Oliver 






Etienne B. Roesch

unread,
Nov 25, 2011, 6:11:39 AM11/25/11
to vim...@googlegroups.com
Hi Eric,

As I am not a developer, but just an avid user who hasn't used all the options available, I am not sure what to answer: I don't know if some syntaxes will include folding by default.

I use both mediawiki and default syntax (which I am pretty sure are different), on two different wikis, and they do not include folding by default. I added the line  let g:vimwiki_folding = 1  to .vimrc, and that forces folding for both my wikis.

To use mediawiki syntax, you'd have to specify that you want this syntax in your wiki definitions. Below is reproduced the content of my vimwiki section, from by .vimrc. Beware that some lines are commented (with ").

Hope that helps!


""""
" VimWiki
""""

let wiki_1 = {}
let wiki_1.path = '~/Dropbox/MyWiki'
"let wiki_1.syntax = 'media'
let wiki_1.nested_syntaxes = {'python': 'python', 'c++': 'cpp'}
let wiki_2 = {}
let wiki_2.path = '~/Dropbox/MyPublicWiki'
let wiki_2.syntax = 'media'
let wiki_2.nested_syntaxes = {'python': 'python', 'c++': 'cpp', 'shell': 'sh'}
let g:vimwiki_list = [wiki_1, wiki_2]

"map <leader>tt <Plug>VimwikiToggleListItem
"map <C-T> <Plug>VimwikiToggleListItem
let g:vimwiki_folding = 1
let g:vimwiki_use_calendar = 1

Eric Weir

unread,
Nov 25, 2011, 9:28:30 AM11/25/11
to vim...@googlegroups.com
On Nov 25, 2011, at 6:11 AM, Etienne B. Roesch wrote:

As I am not a developer, but just an avid user who hasn't used all the options available, I am not sure what to answer: I don't know if some syntaxes will include folding by default.

Thanks, Etienne. Sounds like we're in the same boat, though I'm very new at vimwiki -- maybe a month or so -- and even vim -- maybe nine months. 

I use both mediawiki and default syntax (which I am pretty sure are different), on two different wikis, and they do not include folding by default. I added the line  let g:vimwiki_folding = 1  to .vimrc, and that forces folding for both my wikis.

You're right. I checked my .vimrc, and I do have the command for folding for vimwiki in it. I'd forgotten that I did that. And you're right about the default syntax and mediawiki being different. The vimwiki documentation says the default syntax is a subset of Google's wiki syntax.

To use mediawiki syntax, you'd have to specify that you want this syntax in your wiki definitions. Below is reproduced the content of my vimwiki section, from by .vimrc. Beware that some lines are commented (with ").

I'm gonna try adapting your way of specifying mediawiki syntax to specifying markdown syntax. It's different from the method I asked about.

Thanks again,
------------------------------------------------------------------------------------------
Eric Weir
Decatur, GA

"A writer is a person for whom writing is more difficult 
than it is for other people." 

- Thomas Mann






Eric Weir

unread,
Nov 25, 2011, 1:59:58 PM11/25/11
to vim...@googlegroups.com

On Nov 25, 2011, at 9:28 AM, Eric Weir wrote:

On Nov 25, 2011, at 6:11 AM, Etienne B. Roesch wrote:

To use mediawiki syntax, you'd have to specify that you want this syntax in your wiki definitions. Below is reproduced the content of my vimwiki section, from by .vimrc. Beware that some lines are commented (with ").

I'm gonna try adapting your way of specifying mediawiki syntax to specifying markdown syntax. It's different from the method I asked about.

Well, I put the following in my.vimrc:

let wiki.syntax = 'markdown'

And also this to get 'wiki' recognized as a markdown filetype

autocmd BufRead,BufNewFile *.wiki :set ft=markdown

I didn't get markdown syntax. At least markdown headers were not highlighted as in other fileypes that are recognized as markdown. 

I also lost folding in vimwiki files. I still have it in other filetypes, e.g., markdown. I commented out one at a time each of the two lines I added. Either one by itself renders folding defunct in vimwiki. 

Folding was enabled throughout by:

let g:vimwiki_folding=1

So, how do I get markdown syntax with folding on markdown headers? I have both with other filetypes

Thanks,
------------------------------------------------------------------------------------------
Eric Weir
Decatur, GA

"A man should be in the world as though he were not in it 
so that it will be no worse because of his life." 

- Wendell Berry 

Etienne B. Roesch

unread,
Nov 26, 2011, 8:43:06 AM11/26/11
to vim...@googlegroups.com
Hi Eric,

I am sorry, I think you have reached the extent of my knowledge about vimwiki...

Etienne

Eric Weir

unread,
Nov 26, 2011, 9:08:46 AM11/26/11
to vim...@googlegroups.com

On Nov 26, 2011, at 8:43 AM, Etienne B. Roesch wrote:

I am sorry, I think you have reached the extent of my knowledge about vimwiki...

Thanks, Etienne. Yes, we do seem to be in the same boat.

Regards,
------------------------------------------------------------------------------------------

"Human coexistence and social life constitute the good common to us all 
from which and thanks to which all cultural and social goods derive." 

- Zygmunt Bauman

Eric Weir

unread,
Nov 26, 2011, 11:55:15 AM11/26/11
to vim...@googlegroups.com

On Nov 26, 2011, at 9:08 AM, Eric Weir wrote:

On Nov 26, 2011, at 8:43 AM, Etienne B. Roesch wrote:

I am sorry, I think you have reached the extent of my knowledge about vimwiki...

Thanks, Etienne. Yes, we do seem to be in the same boat.

In sense from your earlier responses, though, that you have more experience with vimwiki than I do. I'd be interested in hearing how you use it.

I'm using it to keep notes on writing projects, to draft segments of a larger writing project, and I also use the diary. I find folding very helpful in the note taking. 

Regards,
------------------------------------------------------------------------------------------
Eric Weir
Decatur, GA

"What is man without the beasts? If all the beasts were gone, 
men would die from a great loneliness of spirit." 

- Chief Seattle






Reply all
Reply to author
Forward
0 new messages