8

I want to work between two vimwiki directories: a private vimwiki and a public vimwiki.

How do I get multiple vimwikis in the gvim Vimwiki > Open index > menu?

In my ~/.vimrc I have the two wikis defined:

" vimwiki 
let wiki_1 = {}
let wiki_1.path = '~/vimwiki'
let wiki_1.path_html = '~/vimwiki_html'
let wiki_2 = {}
let wiki_2.path = '~/private'
let wiki_2.path_html = '~/private_html'
let g:vimwiki_list = [wiki_1, wiki_2]

In vim and gvim, when I press \ws I can see the two options, as I expect:

1   ~/vimwiki/                                         
2 * ~/private/
Select Wiki (specify number):

However, in gvim the menu only shows one entry, the tilde ( ~ )

gvim menu item Vimwiki > "Open Index" submenu item

What am I missing?

2 Answers 2

10

I was missing a trailing slash on both wiki_?.path values.

I corrected my ~/.vimrc as follows:

" vimwiki 
let wiki_1 = {}
let wiki_1.path = '~/vimwiki/'
let wiki_1.path_html = '~/vimwiki_html/'

let wiki_2 = {}
let wiki_2.path = '~/private/'
let wiki_2.path_html = '~/private_html/'

let g:vimwiki_list = [wiki_1, wiki_2]

After a trailing slash is added, the correct entries show up in the gvim Vimwiki > Open index > menu

gvim Vimwiki Open index menu with options matching Leaderws

What threw me was that in vim and gvim when I pressed \ws I got the result I expected, yet the gvim menu showed a different set of wikis. Both methods show the same result set now.

3

Great tip with the slash and the \ws, thx!

I have entered the following into my .vimrc (). Hope it helps someone:

" Markdown for multiple vimwiki's
"
let g:vimwiki_list = [{'path': '~/Documents/myWiki/', 'syntax': 'markdown', 'ext': '.md'},
                     \ {'path': '~/Documents/myScripts.wiki/', 'syntax': 'markdown', 'ext': '.md'}]

And \ws:

1   /Users/username/Documents/myWiki/
2   /Users/username/Documents/myScripts.wiki/
Select Wiki (specify number):

I run vim version 8.2.200 on Mac

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.