Skip to content

Commit 6b890fd

Browse files
committed
fix: search selection pattern under visual mode.
1 parent 893c504 commit 6b890fd

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

lua/keymap/tool.lua

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ local map_cr = bind.map_cr
33
local map_cu = bind.map_cu
44
local map_cmd = bind.map_cmd
55
local map_callback = bind.map_callback
6+
local vim_path = require("core.global").vim_path
67
local et = bind.escape_termcode
78
require("keymap.helpers")
89

@@ -125,7 +126,17 @@ local plug_map = {
125126
:with_noremap()
126127
:with_silent()
127128
:with_desc("tool: Find patterns"),
128-
["v|<leader>fs"] = map_cu("Telescope grep_string")
129+
-- ["v|<leader>fs"] = map_cu("Telescope grep_string")
130+
-- :with_noremap()
131+
-- :with_silent()
132+
-- :with_desc("tool: Find word under cursor"),
133+
["v|<leader>fs"] = map_callback(function()
134+
local opts = {}
135+
if vim.fn.getcwd() == vim_path then
136+
opts["additional_args"] = { "--no-ignore" }
137+
end
138+
require("telescope-live-grep-args.shortcuts").grep_visual_selection(opts)
139+
end)
129140
:with_noremap()
130141
:with_silent()
131142
:with_desc("tool: Find word under cursor"),

0 commit comments

Comments
 (0)