Sublime Forum

Windows - Keyboard shortcut for Find and Replace in Selection?

#1

It seems ST4 doesn’t have a keyboard shortcut to activate “in selection” when using Find and Replace:
image

So every time I want to activate “in Selection”, I want to use the mouse.

How to bind a key for this?

0 Likes

#2

The "toggle_in_selection" command does that.

0 Likes

#3

I’ve got the following bindings in my User/Default.sublime-keymap to close the gap of missing default bindings.

	// Sublime Text Find & Replace Widget
	{
		"keys": ["alt+h"],
		"command": "toggle_highlight",
		"context": [
			{"key": "panel_type", "operand": "find"}, {"key": "panel_has_focus"}
		]
	},
	{
		"keys": ["alt+s"],
		"command": "toggle_in_selection",
		"context": [
			{"key": "panel_type", "operand": "find"}, {"key": "panel_has_focus"}
		]
	},

Maybe they are safe enough to be shipped with ST?

Note: I’ve heard rumors about all alt+<letter> bindings to be candidates for trouble with certain keyboard layouts or languages, because they are sometimes used to type “normal” letters.

3 Likes

#4

There is already an open issue for it

2 Likes