From 172338dbc347f04856d2d93cbef82a66cd9b9e94 Mon Sep 17 00:00:00 2001 From: srdusr Date: Sat, 18 Feb 2023 23:47:26 +0200 Subject: Add function to find scripts "find_scripts()" --- lua/plugins/telescope.lua | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/lua/plugins/telescope.lua b/lua/plugins/telescope.lua index 70eae7a..efbbf28 100644 --- a/lua/plugins/telescope.lua +++ b/lua/plugins/telescope.lua @@ -297,6 +297,19 @@ function M.find_configs() } end +function M.find_scripts() + require("telescope.builtin").find_files { + hidden = false, + prompt_title = " Find Notes", + path_display = { "smart" }, + search_dirs = { + "~/.local/bin/scripts", + }, + layout_strategy = "horizontal", + layout_config = { preview_width = 0.65, width = 0.75 }, + } +end + function M.grep_notes() local opts = {} opts.hidden = false -- cgit v1.2.3 From 167b8cfba1e57e49a49ae0b292dda1689f6db41a Mon Sep 17 00:00:00 2001 From: srdusr Date: Sat, 18 Feb 2023 23:48:09 +0200 Subject: Add Telescope function/binding to search for scripts in script directory --- lua/user/keys.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/lua/user/keys.lua b/lua/user/keys.lua index 7496b65..3f1157a 100644 --- a/lua/user/keys.lua +++ b/lua/user/keys.lua @@ -263,6 +263,7 @@ map("n", "fk", "lua require('telescope.builtin').keymaps()") map("n", "fn", [[lua require'plugins.telescope'.find_notes()]]) -- find notes map("n", "fgn", [[lua require'plugins.telescope'.grep_notes()]]) -- search notes map("n", "f.", [[lua require'plugins.telescope'.find_configs()]]) -- find configs +map("n", "fs", [[lua require'plugins.telescope'.find_scripts()]]) -- find notes map("n", "fm", "lua require('telescope').extensions.media_files.media_files({})") -- find media files map("n", "fi", "lua require('telescope').extensions.notify.notify({})") -- find media files -- cgit v1.2.3 From 73f31dabc03cd963e6e6c22bb53ffe56ad7fc855 Mon Sep 17 00:00:00 2001 From: srdusr Date: Sat, 18 Feb 2023 23:49:18 +0200 Subject: Adjust "find_scripts" hidden value to true --- lua/plugins/telescope.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/plugins/telescope.lua b/lua/plugins/telescope.lua index efbbf28..6cd41ae 100644 --- a/lua/plugins/telescope.lua +++ b/lua/plugins/telescope.lua @@ -299,7 +299,7 @@ end function M.find_scripts() require("telescope.builtin").find_files { - hidden = false, + hidden = true, prompt_title = " Find Notes", path_display = { "smart" }, search_dirs = { -- cgit v1.2.3