diff --git a/after/plugin/telescope.lua b/after/plugin/telescope.lua index 67cdaa4..b82bc0c 100644 --- a/after/plugin/telescope.lua +++ b/after/plugin/telescope.lua @@ -1,5 +1,17 @@ local builtin = require('telescope.builtin') vim.keymap.set('n', 'ff', builtin.find_files, {}) + vim.keymap.set('n', 'fs', function() - builtin.grep_string({ search = vim.fn.input("Find: ") }); + local searchstring + vim.ui.input({ prompt = 'Grep: ' }, function(input) + searchstring = input + end); + + if (searchstring == nil or searchstring == '') then + return + end + + builtin.grep_string({ search = searchstring }); end) + +vim.keymap.set('v', 'fs', builtin.grep_string);