From 78055e25b61e0d0b96485e87dad6b1885a18923b Mon Sep 17 00:00:00 2001 From: Imbus <> Date: Fri, 16 Aug 2024 16:26:10 +0200 Subject: [PATCH] Notes search --- lua/plugins/telescope.lua | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/lua/plugins/telescope.lua b/lua/plugins/telescope.lua index 743ede6..9ffbf96 100644 --- a/lua/plugins/telescope.lua +++ b/lua/plugins/telescope.lua @@ -89,6 +89,16 @@ return { -- Fuzzy Finder (files, lsp, etc) }) end, { desc = '[/] Fuzzily search in current buffer' }) + -- Vimwiki searches for notes in path specified by $NOTES environment variable + vim.keymap.set('n', 'sv', function() + local notes_path = os.getenv 'NOTES' + if not notes_path then + error 'Please set the $NOTES environment variable' + else + builtin.find_files { cwd = notes_path, prompt_title = 'Notes' } + end + end, { desc = '[S]earch [V]imWiki' }) + -- It's also possible to pass additional configuration options. -- See `:help telescope.builtin.live_grep()` for information about particular keys vim.keymap.set('n', 's/', function()