Sublime Forum

Send args to find_in_files panel

#1

current key binding for find_in_files is:
{ “keys”: “ctrl+shift+f”], “command”: “show_panel”, “args”: {“panel”: “find_in_files”} },

Request is to add params to show_panel to fill in the “where”, “replace”, “find” . For common replacements, we could tie to a key binding, or searching within a known directory (without having to pick it).

like this:
{ “keys”: “ctrl+shift+f”], “command”: “show_panel”, “args”: {“panel”: “find_in_files”, “Where”:} },

0 Likes

Find all with supplied search value to hotkey
#2

+1

0 Likes

#3

+1

0 Likes

#4

To set the “where” field just pass “where” (all lowercase letters) in the args. Prior to version 2134 the arg was named “location”, as you can see in the source of Sidebar Enhancements plugin.

E.g:

{ "keys": "ctrl+shift+f"], "command": "show_panel", "args": {"panel": "find_in_files", "where":"<current file>"} }

If you open a sublime-workspace file and you look for the “find_state” key, you can see the other arguments you can pass, like “case_sensitive” or “regex”, and so on.

Unfortunately I don’t know the argument to populate the “find” field.
I’ve tried “find”, “search”, “key”, “what” but I had no luck.

If someone knows it, please help, thanks.

4 Likes

#5

+1

What I want to do is somehow put the selected text into the find: field

0 Likes

#6

+1 too
Should be a way to jam text into panels

0 Likes

#7

I’ve asked a question on SO in case somebody knows how to populate the find field, but my guess is that it isn’t possible without the ST devs implementing it in a future build.

2 Likes

#8

Fingers crossed they will add it.

0 Likes