Replies: 2 comments 1 reply
-
|
When I have a link that doesn't exist, that often means the file got moved. Would it make sense to have an interface that looks like this? I'd probably choose (3) below more often than not. One issue with the above is when the norg workspace is massive so generating the list in (3) may take time in that case. It seems like there is possibly some sql caching work being done in anticipation of gtd/zettelkasten that could possibly be leveraged. I am not involved with GTD/zettelkasten though so that may not be a thing. |
Beta Was this translation helpful? Give feedback.
-
|
I figured out that there is a flag for the vim.api.nvim_create_autocmd({ "BufWritePre" }, {
callback = function(event)
if event.match:match("^%w%w+://") then
return
end
local file = vim.loop.fs_realpath(event.match) or event.match
vim.fn.mkdir(vim.fn.fnamemodify(file, ":p:h"), "p")
end,
}) |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Write a link like this:
{:$/dir/file:}[Description]
where the directory 'dir' doesn't exist in the current workspace.
When following the link the file opens in a new buffer and it can be edited as expected. When the file is saved there is an error that the file can't be created. Creating the directory manually and saving the file again solves the problem.
Is it something that I'm missing here?
I'm a recent nvim convert and have previously used vim and vimwiki for a long time. Vimwiki creates missing directories in this situation.
Beta Was this translation helpful? Give feedback.
All reactions