diff --git a/lua/t0xa/core/keybindings.lua b/lua/t0xa/core/keybindings.lua index 341f03f..b33c87a 100644 --- a/lua/t0xa/core/keybindings.lua +++ b/lua/t0xa/core/keybindings.lua @@ -6,5 +6,6 @@ vim.keymap.set("n", "or", "ObsidianRename", { silent = true, no vim.keymap.set("n", "ol", "ObsidianToggleCheckbox", { silent = true, noremap = true, desc="Obsidian: toggle checkbox" }) vim.keymap.set("n", "on", "ObsidianNew", { silent = true, noremap = true, desc="Obsidian: new file" }) vim.keymap.set("n", "otoc", "ObsidianTOC", { silent = true, noremap = true, desc="Obsidian: open TOC" }) +vim.keymap.set("n", "ofl", "ObsidianFollowLink", { silent = true, noremap = true, desc="Obsidian: follow link" }) -- Oil keybinds vim.keymap.set("n", "-", "Oil", { desc = "Open parent directory" }) diff --git a/lua/t0xa/plugins/obsidian.lua b/lua/t0xa/plugins/obsidian.lua index 257f680..06603bf 100644 --- a/lua/t0xa/plugins/obsidian.lua +++ b/lua/t0xa/plugins/obsidian.lua @@ -1,19 +1,19 @@ return { - "epwalsh/obsidian.nvim", - version = "*", -- recommended, use latest release instead of latest commit - lazy = true, - ft = "markdown", - dependencies = { - -- Required. - "nvim-lua/plenary.nvim", - }, - opts = { - workspaces = { - { - name = "personal", - path = os.getenv("OBSIDIAN_NOTES_PATH"), - }, - }, + "epwalsh/obsidian.nvim", + version = "*", -- recommended, use latest release instead of latest commit + lazy = true, + ft = "markdown", + dependencies = { + -- Required. + "nvim-lua/plenary.nvim", + }, + opts = { + workspaces = { + { + name = "personal", + path = os.getenv("OBSIDIAN_NOTES_PATH"), + }, + }, templates = { folder = "Templates", date_format = "%d.%m.%Y", @@ -24,5 +24,9 @@ return { ui = { enable = false }, - }, + follow_url_func = function(url) + print("Hello from URL") + vim.fn.jobstart({ "xdg-open", url }) + end, + }, }