Sublime Forum

General question about the Find command

#1

I’m wondering if there’s a setting/preference I haven’t found yet that would allow me to change the behavior of Cmd+F.

In ST2, Cmd+F acts as a toggle for the Find UI. In most other editors I’ve used, when the FInd UI is already open, Cmd+F doesn’t hide Find, it re-focuses it and selects the entire value so you can overtype and begin searching for something else. This is the default behavior in TextMate and Coda, for example.

So, in ST2, I frequently invoke find, type something, hit cmd+F again, expecting to search for another term, but I’ve actually hidden Find and now I’m screwing up my file…

I found this in the default .sublime.keymap…

{ “keys”: “super+f”], “command”: “show_panel”, “args”: {“panel”: “find”} },

…but I’m not sure how I can tweak that to get what I want. I’ll go look on the wiki now, but thought I’d ask here first in case it’s quicker. Thanks.

0 Likes

#2

I don’t know if the “toggle” parameter works for all panels, but you can try:

{ "keys": "ctrl+backquote"], "command": "show_panel", "args": {"panel": "console", "toggle": true} },
0 Likes

#3

Thanks. Doesn’t work for find, apparently.

0 Likes

#4

Wait, don’t you want it to not toggle? What happens if you set toggle to false?
I’d try it but apparently when I press cmd+f the find panel does exactly what you want: it refocuses. Not sure what I’m doing different.

0 Likes

#5

I actually tried both true and false.

0 Likes

#6

[quote=“adzenith”]Wait, don’t you want it to not toggle? What happens if you set toggle to false?
I’d try it but apparently when I press cmd+f the find panel does exactly what you want: it refocuses. Not sure what I’m doing different.[/quote]

Build 2126?

0 Likes

#7

True, dev build 2133 works as you describe.

0 Likes

#8

Ah, that must be it then. I can’t resist those cutting-edge dev builds!

0 Likes

#9

Not sure exactly which build this was introduced in. The behaviour in 2133 is much improved, but still not quite there for me.

I’d like to be able to hit Cmd-F, type an initial string, Cmd-F, type another string. Currently the second string is just typed after the first string because the initial string is not selected with the second press of Cmd-F.

It works fine if you hit Cmd-F, do something in the buffer, then hit Cmd-F again, but not very well for multiple quick searches.

0 Likes

#10

I’d like this too.

0 Likes

#11

Fixed in 2134!

0 Likes