From 4024b40dec1253dc04de876d0c356bfab63e9a0e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sergio=20La=C3=ADn?= Date: Fri, 17 Nov 2023 14:40:35 +0100 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20feat(nvim):=20new=20obsidian=20defa?= =?UTF-8?q?ult=20options=20added?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../plugins/extras/editor/docs/obsidian.lua | 49 ++++++++++++++++++- 1 file changed, 48 insertions(+), 1 deletion(-) diff --git a/.config/nvim/lua/plugins/extras/editor/docs/obsidian.lua b/.config/nvim/lua/plugins/extras/editor/docs/obsidian.lua index 0b62e8a6..01a7a981 100644 --- a/.config/nvim/lua/plugins/extras/editor/docs/obsidian.lua +++ b/.config/nvim/lua/plugins/extras/editor/docs/obsidian.lua @@ -1,6 +1,6 @@ return { "epwalsh/obsidian.nvim", - event = { "BufReadPre */obsidian-vault/*.md" }, + event = { "BufReadPre" .. vim.fn.expand("~") .. "Documentos/Obsidian/obsidianVault/root/**.md" }, keys = { { "gf", @@ -32,6 +32,53 @@ return { time_format = "%H:%M", }, + backlinks = { height = 10, wrap = true }, + + -- Optional, by default when you use `:ObsidianFollowLink` on a link to an external + -- URL it will be ignored but you can customize this behavior here. + follow_url_func = function(url) + -- Open the URL in the default web browser. + vim.fn.jobstart({ "xdg-open", url }) -- linux + end, + + -- Optional, set to true if you use the Obsidian Advanced URI plugin. + -- https://github.com/Vinzent03/obsidian-advanced-uri + use_advanced_uri = false, + + -- Optional, set to true to force ':ObsidianOpen' to bring the app to the foreground. + open_app_foreground = false, + + -- Optional, by default commands like `:ObsidianSearch` will attempt to use + -- telescope.nvim, fzf-lua, and fzf.nvim (in that order), and use the + -- first one they find. By setting this option to your preferred + -- finder you can attempt it first. Note that if the specified finder + -- is not installed, or if it the command does not support it, the + -- remaining finders will be attempted in the original order. + finder = "telescope.nvim", + + -- Optional, determines whether to open notes in a horizontal split, a vertical split, + -- or replacing the current buffer (default) + -- Accepted values are "current", "hsplit" and "vsplit" + open_notes_in = "current", + + daily_notes = { + folder = "journal/daily", + date_format = "%Y-%m-%d", + }, + + completion = { + nvim_cmp = true, + min_chars = 2, + -- Where to put new notes created from completion. Valid options are + -- * "current_dir" - put new notes in same directory as the current buffer. + -- * "notes_subdir" - put new notes in the default notes subdirectory. + new_notes_location = "current_dir", + + -- Whether to add the output of the node_id_func to new notes in autocompletion. + -- E.g. "[[Foo" completes to "[[foo|Foo]]" assuming "foo" is the ID of the note. + prepend_note_id = false, + }, + note_frontmatter_func = function(note) -- This is equivalent to the default frontmatter function. local out = { id = note.id, aliases = note.aliases, tags = note.tags }