vimwiki / vimwiki

Personal Wiki for Vim
http://vimwiki.github.io/
Other
8.78k stars 628 forks source link

VimwikiMakeDiaryNote path issues on Windows #1320

Open derekthecool opened 1 year ago

derekthecool commented 1 year ago

Prior to submitting a new issue make sure to complete these steps:

        -- Personal Wiki Setup
        local personal = {
            path = OS.home .. '/.mywiki/personal/',
            syntax = 'markdown',
            ext = '.md',
            auto_diary_index = 1,
            list_margin = 0,
        }

        -- Work Wiki Setup
        local work = {
            path = OS.home .. '/.mywiki/work/',
            syntax = 'markdown',
            ext = '.md',
            auto_diary_index = 1,
            list_margin = 0,
        }

        -- Apply the different Wiki's into the setup vimwiki_list
        vim.g.vimwiki_list = { personal, work }

        -- Allow automatic syntax check for code blocks
        vim.g.automatic_nested_syntaxes = 1

From looking through the code it seems this function vimwiki#vars#get_wikilocal might be the function that is getting the path incorrectly. However, I'm such a vimscript noob that I can't even find where this function is defined. I see it is referenced in 24 different files. Can anyone share where that function is defined?

I would love to help create a fix for this, but need a nudge in the right direction.

tinmarino commented 1 year ago

Hi @derekthecool,

I cannot reproduce on Linux, will have a look on Windows.

The vimwiki#vars#get_wikilocal is defined in autoload/vimwiki/vars.vim.

You can troubleshoot the interesting (wiki local) variable (path) running the command :VimwikiVar path.

tinmarino commented 1 year ago

Do you set the configuration variable before loading vimwiki? It seems that your configuration is the default one (~/vimwiki), so vimwiki may not have taken into account your config at loading, which is expected if you configure it too late.

Try putting it at the top of your vimrc