Home Download Buy Blog Forum Support

Find/Replace All Text on Page via Keyboard

Find/Replace All Text on Page via Keyboard

Postby Phrogz on Mon Aug 01, 2011 6:42 pm

I often want to "replace this string here with that string there everywhere". In TextMate, I can:
1. Select Find String
2. Cmd-E
3. Select Replace String
4. Cmd-Shift-E
5. Cmd-Ctrl-F (Replace All)

Sublime has Ctrl-E and Ctrl-Shift-E (yay!), but I can't find a way to perform Replace All from the keyboard. If I follow the steps above but substitute "Ctrl-H" for Step 5, the currently-selected-text (the replacement string) becomes the Find string when the pane comes up. Ouch! And in Sublime Text 2, Ctrl-Enter no longer performs the Replace All.

How can I most easily invoke Replace All (ideally without even needing to open the find/replace pane)?
Phrogz
 
Posts: 18
Joined: Tue Mar 02, 2010 4:21 pm

Re: Find/Replace All Text on Page via Keyboard

Postby C0D312 on Mon Aug 01, 2011 7:00 pm

To replace all from the "find and replace" panel: press alt + enter

for a reference of all keyboard shortcuts for the find and replace panel, check out this post: viewtopic.php?f=3&t=2555&start=0&hilit=replace+all
C0D312
 
Posts: 1063
Joined: Sun Jul 10, 2011 3:23 am

Re: Find/Replace All Text on Page via Keyboard

Postby jps on Mon Aug 01, 2011 10:46 pm

Another option:

1. Select the text
2. Press Control+Command+G (Find/Find All Using Selection)
3. Type the replacement text, and everything will be updated simultaneously
jps
Site Admin
 
Posts: 3077
Joined: Wed Mar 19, 2008 12:33 pm

Re: Find/Replace All Text on Page via Keyboard

Postby jammi on Tue Aug 02, 2011 8:43 pm

jps wrote:Another option:

1. Select the text
2. Press Control+Command+G (Find/Find All Using Selection)
3. Type the replacement text, and everything will be updated simultaneously


Yep, this is very good stuff. A quick "replace all" suitable for many common cases, like renaming a variable.
jammi
 
Posts: 6
Joined: Sat Jul 30, 2011 12:43 am

Re: Find/Replace All Text on Page via Keyboard

Postby Phrogz on Wed Aug 03, 2011 11:04 pm

jps wrote:Another option:

1. Select the text
2. Press Control+Command+G (Find/Find All Using Selection)
3. Type the replacement text, and everything will be updated simultaneously


This looks like a great workflow to get used to. What's the keyboard shortcut/command for this on Windows under Sublime 2?
Phrogz
 
Posts: 18
Joined: Tue Mar 02, 2010 4:21 pm

Re: Find/Replace All Text on Page via Keyboard

Postby jps on Wed Aug 03, 2011 11:50 pm

It's Alt+F3 on Windows and Linux - there's an entry for it in the Find menu.
jps
Site Admin
 
Posts: 3077
Joined: Wed Mar 19, 2008 12:33 pm


Return to Technical Support

Who is online

Users browsing this forum: No registered users and 18 guests