diff --git a/lua/core/plugin_config/init.lua b/lua/core/plugin_config/init.lua index 144d581..551456d 100644 --- a/lua/core/plugin_config/init.lua +++ b/lua/core/plugin_config/init.lua @@ -10,3 +10,4 @@ require("core.plugin_config.whichkey") require("core.plugin_config.indent-blankline") require("core.plugin_config.org") require("core.plugin_config.darklight") +require("core.plugin_config.obsidian") diff --git a/lua/core/plugin_config/obsidian.lua b/lua/core/plugin_config/obsidian.lua new file mode 100644 index 0000000..075c1d7 --- /dev/null +++ b/lua/core/plugin_config/obsidian.lua @@ -0,0 +1,23 @@ +require("obsidian").setup({ + workspaces = { + { + name = "vault", + path = "~/Sync/wiki", + }, + }, + completion = { + -- Set to false to disable completion. + nvim_cmp = true, + }, + daily_notes = { + -- Optional, if you keep daily notes in a separate directory. + folder = "diary", + -- Optional, if you want to automatically insert a template from your template directory like 'daily.md' + template = "Templates/daily_note" + }, + templates = { + subdir = "Templates", + -- A map for custom variables, the key should be the variable and the value a function + substitutions = {}, + }, +}) diff --git a/lua/core/plugin_config/whichkey.lua b/lua/core/plugin_config/whichkey.lua index 3e86d02..b7335d3 100644 --- a/lua/core/plugin_config/whichkey.lua +++ b/lua/core/plugin_config/whichkey.lua @@ -37,8 +37,8 @@ local keymap = { name = '+todo', j = { 'TodoLocList', 'List TODO:\'s in buffer' }, T = { 'TodoTelescope', 'Search TODO:\'s' }, - n = {function() require("todo-comments").jump_next() end, 'Jump to next TODO:' }, - N = {function() require("todo-comments").jump_prev() end, 'Jump to previous TODO:' }, + n = { function() require("todo-comments").jump_next() end, 'Jump to next TODO:' }, + N = { function() require("todo-comments").jump_prev() end, 'Jump to previous TODO:' }, }, w = { name = '+window', @@ -64,6 +64,25 @@ local keymap = { }, m = { 'DarkLightSwitch', 'Toggle dark mode' + }, + v = { + name = '+obsidian Vault', + i = {'e ~/Sync/wiki/index.md', 'Open Index'}, + o = {'ObsidianOpen', 'Obsidian Open'}, + n = {'ObsidianNew', 'New Note'}, + q = {'ObsidianQuickSwitch', 'Quick Switch with fzf'}, + f = {'ObsidianFollowLink', 'Follow Link'}, + b = {'ObsidianBacklinks', 'List Backlinks'}, + d = {'ObsidianToday', 'Open Daily Note'}, + y = {'ObsidianYesterday', 'Open Yesterdays Note'}, + t = {'ObsidianTomorrow', 'Open Tomorrows Note'}, + T = {'ObsidianTemplate', 'Open Template'}, + s = {'ObsidianSearch', 'Search Notes'}, + l = {'ObsidianLink', 'Link Current Selection'}, + L = {'ObsidianLinkNew', 'Link New Note from Current Selection'}, + w = {'ObsidianWorkspace', 'Switch Workspace'}, + p = {'ObsidianPasteImg', 'Paste Image'}, + r = {'ObsidianRename', 'Rename Note'}, } } -- Map window keys to leader w diff --git a/lua/core/plugins.lua b/lua/core/plugins.lua index 179467c..153e23a 100644 --- a/lua/core/plugins.lua +++ b/lua/core/plugins.lua @@ -37,7 +37,7 @@ local plugins = { -- fzf { 'nvim-telescope/telescope.nvim', - branch = "0.1.x", + --branch = "0.1.x", dependencies = { { 'nvim-lua/plenary.nvim' } } }, -- TODO @@ -78,6 +78,16 @@ local plugins = { "ranjithshegde/orgWiki.nvim", dependencies = { { 'nvim-orgmode/orgmode' } }, }, + -- Obsidian + { + "epwalsh/obsidian.nvim", + version = "*", + lazy = true, + ft = "markdown", + dependencies = { + "nvim-lua/plenary.nvim", + }, + }, -- Lightmode switcher 'eliseshaffer/darklight.nvim' }