diff --git a/lua/ht/core/globals.lua b/lua/ht/core/globals.lua index c0b30648..27157942 100644 --- a/lua/ht/core/globals.lua +++ b/lua/ht/core/globals.lua @@ -1,12 +1,21 @@ local M = {} -local default_vault_path = "~/Documents/Main" +local default_vault_path = { + "~/Documents/Main", + "~/Projects/obsidian-data/Main", +} local function resolve_obsidian_vault() if vim.g.obsidian_vault_path then return vim.fn.resolve(vim.fn.expand(vim.g.obsidian_vault_path)) end - return vim.fn.resolve(vim.fn.expand(default_vault_path)) + for _, path in ipairs(default_vault_path) do + local p = vim.fn.resolve(vim.fn.expand(path)) + if vim.fn.isdirectory(p) == 1 then + return p + end + end + return vim.fn.resolve(vim.fn.expand(default_vault_path[1])) end local function resolve_has_obsidian_vault()