From 3b810ce84e5a160b260baf1b839a4e08707684c5 Mon Sep 17 00:00:00 2001 From: Morten Olsen Date: Tue, 27 Jan 2026 09:03:00 +0100 Subject: [PATCH] add obsidian config --- lua/plugins/obsidian.lua | 65 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 65 insertions(+) create mode 100644 lua/plugins/obsidian.lua diff --git a/lua/plugins/obsidian.lua b/lua/plugins/obsidian.lua new file mode 100644 index 0000000..367c763 --- /dev/null +++ b/lua/plugins/obsidian.lua @@ -0,0 +1,65 @@ +return { + { + "epwalsh/obsidian.nvim", + version = "*", + lazy = true, + ft = "markdown", + dependencies = { + "nvim-lua/plenary.nvim", + }, + opts = { + workspaces = { + { + name = "second-brain", + path = "~/Projects/private/second-brain", + }, + }, + + notes_subdir = "00 Inbox", + new_notes_location = "notes_subdir", + + daily_notes = { + folder = "90 Daily", + date_format = "%Y/%m/%Y-%m-%d", + template = nil, + }, + + templates = { + subdir = "99 Templates", + date_format = "%Y-%m-%d", + time_format = "%H:%M", + }, + + completion = { + nvim_cmp = true, + min_chars = 2, + }, + + mappings = { + ["gf"] = { + action = function() + return require("obsidian").util.gf_passthrough() + end, + opts = { noremap = false, expr = true, buffer = true }, + }, + [""] = { + action = function() + return require("obsidian").util.smart_action() + end, + opts = { buffer = true, expr = true }, + }, + }, + }, + keys = { + { "On", "ObsidianNew", desc = "New Note" }, + { "Oo", "ObsidianSearch", desc = "Search Notes" }, + { "Os", "ObsidianQuickSwitch", desc = "Quick Switch" }, + { "Ob", "ObsidianBacklinks", desc = "Backlinks" }, + { "Ot", "ObsidianToday", desc = "Today's Note" }, + { "Oy", "ObsidianYesterday", desc = "Yesterday's Note" }, + { "Ol", "ObsidianLinks", desc = "Links" }, + { "Of", "ObsidianFollowLink", desc = "Follow Link" }, + { "Op", "ObsidianTemplate", desc = "Insert Template" }, + }, + }, +}