Sublime Forum

Replace text using keyboard

#1

Hi, can you help me with this? I want to use the keyboard to replace text in a selection.

My text is like this

hello
hello
hello
hello
hello
hello

and I want the “e” to be “a” in line 2 to 4, so I select them

hello
hello <- selected
hello <- selected
hello <- selected
hello
hello

and now, how would I go on to get the “e” replaced by “a”, using the keyboard? When I press ctrl-h, “In selection” is not activated, and it seems like there is no keyboard short-cut either, only mouse click will do.

Am I doing it wrong?

Thank you

0 Likes

#2

Use “Find & Replace” and make sure “In selection” is on.

Sublime_FindReplace

0 Likes

#3

Thank you, but I did so, Sublime later deactivated it. Does Sublime really want me to click the button every time? Who replaces something in the complete text anyway when programming?
Regards

0 Likes

#4

Yes you do need to click the button each time, although you can make a custom keybinding for the toggle_in_selection command.

Alternatively you can use cmd+d/ctrl+d to multi-select the instances you want and make the edit that way. This is what I personally use all the time.

1 Like