3

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?

4

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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