Laptop #2
|
@ -17,45 +17,31 @@ return {
|
|||
version = "*", -- recommended, use latest release instead of latest commit
|
||||
lazy = false,
|
||||
dependencies = { "nvim-lua/plenary.nvim" },
|
||||
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 })
|
||||
for _, v in ipairs(scan) do
|
||||
local subdir = v:match("([^/]+)$")
|
||||
if vim.fn.isdirectory(notes_path .. "/" .. subdir .. "/.obsidian") == 1 then
|
||||
table.insert(opts.workspaces, {
|
||||
name = subdir,
|
||||
path = notes_path .. "/" .. subdir,
|
||||
overrides = {
|
||||
daily_notes = {
|
||||
folder = "Daily",
|
||||
},
|
||||
},
|
||||
})
|
||||
end
|
||||
end
|
||||
require("obsidian").setup(opts)
|
||||
end,
|
||||
opts = {
|
||||
workspaces = {
|
||||
{
|
||||
name = "Lumentis",
|
||||
path = "~/Workspace/Notes/Lumentis",
|
||||
},
|
||||
{
|
||||
name = "Lumentis-Players",
|
||||
path = "~/Workspace/Notes/Lumentis-Players",
|
||||
},
|
||||
{
|
||||
name = "Personal",
|
||||
path = "~/Workspace/Notes/Personal",
|
||||
overrides = {
|
||||
daily_notes = {
|
||||
folder = "Daily",
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
name = "PhD",
|
||||
path = "~/Workspace/Notes/PhD",
|
||||
overrides = {
|
||||
daily_notes = {
|
||||
folder = "Daily",
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
name = "DnD",
|
||||
path = "~/Workspace/Notes/DnD",
|
||||
override = {
|
||||
daily_notes = {
|
||||
folder = ".",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
workspaces = {},
|
||||
note_id_func = function(title) return title end,
|
||||
daily_notes = {
|
||||
folder = "."
|
||||
},
|
||||
disable_frontmatter = true,
|
||||
ui = {
|
||||
hl_groups = {
|
||||
|
@ -63,6 +49,7 @@ return {
|
|||
}
|
||||
}
|
||||
},
|
||||
|
||||
keys = {
|
||||
{"<cr>", handle_enter, ft = "markdown" },
|
||||
{"<cr>", "<cmd>ObsidianLink<cr>", ft = "markdown", mode = "v"},
|
||||
|
@ -75,7 +62,4 @@ return {
|
|||
{"<leader>ju", "<cmd>ObsidianTomorrow<cr>"},
|
||||
{"<tab>", ":set nohlsearch<cr>/\\[[^\\[\\]]*\\]([^()]*)<cr>:let @/ = \"\"<cr>:set hlsearch<cr>", ft = "markdown", silent = true },
|
||||
},
|
||||
config = function (_, opts)
|
||||
require("obsidian").setup(opts)
|
||||
end
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue