Laptop #2

Closed
thomasave wants to merge 119 commits from laptop into master
1 changed files with 5 additions and 1 deletions
Showing only changes of commit 41822454a5 - Show all commits

View File

@ -20,8 +20,10 @@ return {
config = function(_, opts)
local notes_path = (os.getenv "HOME") .. "/Workspace/Notes"
local scan = require("plenary.scandir").scan_dir(notes_path, {add_dirs = true, depth = 1 })
local found = false
for _, v in ipairs(scan) do
local subdir = v:match("([^/]+)$")
found = true
if vim.fn.isdirectory(notes_path .. "/" .. subdir .. "/.obsidian") == 1 then
table.insert(opts.workspaces, {
name = subdir,
@ -34,7 +36,9 @@ return {
})
end
end
require("obsidian").setup(opts)
if found then
require("obsidian").setup(opts)
end
end,
opts = {
workspaces = {},