Sublime Forum

Keyboard shortcut for "Replace" button in "Find in Files"

#1

I’m using ST3 on OS X with a laptop keyboard (a “return” key but no “enter” key) and I can’t seem to figure out how to use the keyboard to trigger the “Replace” button in the “Find in Files” dialog. I’ve read all the existing discussions in the forum and none of the suggestions work, since they’re all for Windows, earlier versions of ST, or presume the existence of a dedicated “enter” key.

I can use Cmd-return to trigger “Find” but every combination of modifier keys+return I’ve tried just adds a line break to whichever text input has focus. There are no tooltips on the three buttons on the right side of the dialog box that would provide a hint. It’s also not possible to tab to those buttons, since tab just cycles through the text inputs.

1 Like

#2

The command is replace_next. Default keybinding:

{ "keys": "super+alt+e"], "command": "replace_next" },

0 Likes

#3

No, that’s not the right command, replace_next only operates within the current file even when the “Find in Files” dialog is open. I’m talking about the behavior you get from clicking the “Replace” button, which then asks you to confirm “Replace N occurences in M files”.

0 Likes

#4

There is no keyborad shortcut for this that I know because was just checking but if you have keyboard maestro (or something similar) then the replace button is always in the bottom right corner of the window so can set a keyboard shortcut command in keyboard maestro to click the bottom right corner in sublime where the replace button is and just hit enter or escape to either replace or cancel, respectively in the panel that comes up asking to replace occurences. Solution I came up with since you are using OS X as well.

0 Likes

#5

Two years later and this is still a problem :frowning:

Can’t believe I have to use the mouse for something simple as this.

0 Likes

#6
0 Likes

#7

I documented the missing toggle commands in issue 1447 and with more detail in the ST forum.

All of the toggle commands can now be assigned key bindings.

As far as I can tell the Replace key in the Find in Files panel is now the only find/replace action that can not be assigned a key binding. I tried using the same trial-and-error approach as I used to discover the ‘missing’ toggle commands, but had no luck.

0 Likes