diff --git a/.config/nvim/after/plugin/telescope.lua b/.config/nvim/after/plugin/telescope.lua index 948c0b5d..de8a2f80 100644 --- a/.config/nvim/after/plugin/telescope.lua +++ b/.config/nvim/after/plugin/telescope.lua @@ -70,10 +70,18 @@ local function find_undercursor_in_buffer() initial_mode = "normal", } end +local function grep_undercursor() + builtin["live_grep"] { + layout_config = { height = 0.8 }, -- Already have word, no need to think + default_text = vim.fn.expand(""), + initial_mode = "normal", + } +end -- Better than builtin / vim.keymap.set("n", "/", builtin["current_buffer_fuzzy_find"]) vim.keymap.set("n", "w", find_undercursor_in_buffer) +vim.keymap.set("n", "W", grep_undercursor) -- Use / as prefix to avoid collision in bindings vim.keymap.set("n", "/f", builtin["find_files"])