···
-
require("obsidian").setup({
-
-- Overrides the 'gf' mapping to work on markdown/wiki links within your vault.
-
return require("obsidian").util.gf_passthrough()
-
opts = { noremap = false, expr = true, buffer = true },
-
return require("obsidian").util.toggle_checkbox()
-
opts = { buffer = true },
-
-- Smart action depending on context, either follow link or toggle checkbox.
-
return require("obsidian").util.smart_action()
-
opts = { buffer = true, expr = true },
-
disable_frontmatter = true,
-
wiki_link_func = "use_path_only",
···
+
local function find_vault_path()
+
local cwd = vim.loop.cwd()
+
if vim.fs.basename(path) == "vault" then
+
path = vim.fs.dirname(path)
+
local vault_path = find_vault_path()
+
if vault_path ~= nil then
+
require("obsidian").setup({
+
-- Overrides the 'gf' mapping to work on markdown/wiki links within your vault.
+
return require("obsidian").util.gf_passthrough()
+
opts = { noremap = false, expr = true, buffer = true },
+
return require("obsidian").util.toggle_checkbox()
+
opts = { buffer = true },
+
-- Smart action depending on context, either follow link or toggle checkbox.
+
return require("obsidian").util.smart_action()
+
opts = { buffer = true, expr = true },
+
disable_frontmatter = true,
+
wiki_link_func = "use_path_only",