From d6c3fc703eb472643a6b0f47d83c134bc0b05b0f Mon Sep 17 00:00:00 2001 From: aleidk Date: Sat, 27 Jan 2024 16:36:53 -0300 Subject: [PATCH] Add obsidian.nvim as markdown tool resolve #9 --- config/nvim/lazy-lock.json | 1 + config/nvim/lua/aleidk/plugins/markdown.lua | 56 +++++++++++++++++++++ 2 files changed, 57 insertions(+) create mode 100644 config/nvim/lua/aleidk/plugins/markdown.lua diff --git a/config/nvim/lazy-lock.json b/config/nvim/lazy-lock.json index d4e18a3..a62442c 100644 --- a/config/nvim/lazy-lock.json +++ b/config/nvim/lazy-lock.json @@ -47,6 +47,7 @@ "nvim-ts-autotag": { "branch": "main", "commit": "6be1192965df35f94b8ea6d323354f7dc7a557e4" }, "nvim-ts-context-commentstring": { "branch": "main", "commit": "92e688f013c69f90c9bbd596019ec10235bc51de" }, "nvim-web-devicons": { "branch": "master", "commit": "5de460ca7595806044eced31e3c36c159a493857" }, + "obsidian.nvim": { "branch": "main", "commit": "b101ad8988eb1452dabb6138763877a1794a1966" }, "plenary.nvim": { "branch": "master", "commit": "50012918b2fc8357b87cff2a7f7f0446e47da174" }, "pretty-fold.nvim": { "branch": "master", "commit": "a7d8b424abe0eedf50116c460fbe6dfd5783b1d5" }, "smart-splits.nvim": { "branch": "master", "commit": "c8a9173d70cbbd1f6e4a414e49e31df2b32a1362" }, diff --git a/config/nvim/lua/aleidk/plugins/markdown.lua b/config/nvim/lua/aleidk/plugins/markdown.lua new file mode 100644 index 0000000..87f2900 --- /dev/null +++ b/config/nvim/lua/aleidk/plugins/markdown.lua @@ -0,0 +1,56 @@ +return { + { + "epwalsh/obsidian.nvim", + version = "*", + lazy = true, + ft = "markdown", + dependencies = { + "nvim-lua/plenary.nvim", + "hrsh7th/nvim-cmp", + }, + keys = { + { + "fo", + "ObsidianSearch", + desc = "Find note in vault", + }, + }, + opts = { + notes_subdir = "notes", + open_app_foreground = false, + workspaces = { + { + name = "personal", + path = "~/Repos/Private/docs", + }, + { + name = "blog", + path = "~/Repos/Projects/blog-content", + }, + }, + finder_mappings = { + new = "", + }, + completion = { + -- 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", + -- Control how wiki links are completed with these (mutually exclusive) options: + -- + -- 1. Whether to add the note ID during completion. + -- E.g. "[[Foo" completes to "[[foo|Foo]]" assuming "foo" is the ID of the note. + -- Mutually exclusive with 'prepend_note_path' and 'use_path_only'. + prepend_note_id = false, + -- 2. Whether to add the note path during completion. + -- E.g. "[[Foo" completes to "[[notes/foo|Foo]]" assuming "notes/foo.md" is the path of the note. + -- Mutually exclusive with 'prepend_note_id' and 'use_path_only'. + prepend_note_path = true, + -- 3. Whether to only use paths during completion. + -- E.g. "[[Foo" completes to "[[notes/foo]]" assuming "notes/foo.md" is the path of the note. + -- Mutually exclusive with 'prepend_note_id' and 'prepend_note_path'. + use_path_only = false, + }, + }, + }, +}