Laptop #2
|
@ -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
|
||||
if found then
|
||||
require("obsidian").setup(opts)
|
||||
end
|
||||
end,
|
||||
opts = {
|
||||
workspaces = {},
|
||||
|
|
Loading…
Reference in New Issue