Change directory to wiki as per user's preference
As suggested by @CatalinPlesu here, the user should be able decide whether to change the directory to the location of the wiki.
@CatalinPlesu Can you please check if this works? I will merge this change after your confirmation or add changes if you have suggestions.
@serenevoid Hi, for me it doesn't work right now, but my setup is a bit different, i don't keep the notes in home dir, but in /home/mnt/catalin/notes/wiki1
I actually encountered a similar problem without looking at your issue, that is why i created this pr
I suggets updating a function like this:
utils.get_wiki_path = function(path)
if path ~= nil then
local default_dir = vim.fs.joinpath(vim.loop.os_homedir(), "wiki")
return default_dir
end
if vim.loop.fs_realpath(path) then
return path
else
return vim.fs.joinpath(vim.loop.os_homedir(), path)
end
end
and on that line to call like this: vim.api.nvim_set_current_dir(utils.get_wiki_path(config.path))
and discard taht pr
Aah, I see. I avoided separate paths to avoid complications. But this seems like a simpler solution. In this case, kiwi won't be able to create the directory for the users. They'll have to create all the necessary directories themselves.