Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Find/Replace panel in Sublime Text disappears after Replace All

In Sublime, after I do one 'replace all', the find/replace text boxes at the bottom of the screen disappear. I often do multiple replace alls, so I want the boxes to stay there / persist until I explicitly close them. I feel like I have gotten this to work in the past, but can't find a way to get back to it.

like image 222
scharfmn Avatar asked Jan 18 '13 16:01

scharfmn


People also ask

How do you do replace all in sublime?

Or, if you want to find and replace text in a number of files at once, press Command + Shift + F or Control + Shift + H to open Sublime Text's Find in Files tool that can search and replace across as many files as you have open or select from its menu.

How do you replace multiple words in Sublime Text?

Alt+F3 gives a really simple way to do find and replace: Use it to select all occurrences of the current word or selection, then just start typing to replace or edit them all at once.


3 Answers

This is tested only in Sublime Text 3, but should work in ST2 as well:

  1. Select Preferences > Key Bindings -- Default.

  2. Search for ctrl+alt+enter and copy entire block.

  3. Select Preferences > Key Bindings -- User.

  4. Paste copied block anywhere and remove , "args": {"close_panel": true} part from it.

  5. Save Key Bindings -- User and test it (you don't need to restart Sublime Text).

Since you have modified just the key binding, you should remember, that expected behavior will work only if you execute Ctrl+Alt+Enter inside search & replace panel.

If you click Replace All button, the "old" behavior will be applied -- i.e. panel will be closed.

like image 121
trejder Avatar answered Oct 19 '22 04:10

trejder


On the latest version of sublime, these settings can be turned off as desired in your preferences.

// This determines whether the find panel is closed when the "Find All" // or "Replace All" buttons are pressed. Note this does not change the // keybinding behavior. "close_find_after_find_all": true, "close_find_after_replace_all": true,

simply go to Preferences->Settings and add this line in the right side window "close_find_after_replace_all": false,

enter image description here

like image 28
beginner Avatar answered Oct 19 '22 05:10

beginner


Update Dec-2021: See answer by user 'beginner'; will leave this for historical purposes but that answer should be the accepted solution; apparently the feature was finally added in build 4092.

I too was looking for this (7 years later!). I also looked through the settings and tried to search on sublime forums and google... but trejder's answer appears to be only option that currently exists.

Since I didn't see any requests for it, I went ahead and created a feature request over on the sublime forums for this.

Hopefully, it will either be accepted or some forum guru will tell me I'm an idiot and the feature already exists. Posting the link mainly so any other souls wandering in from search engines might be able to check if there have been any updates.

Cross your fingers :-)

like image 5
zpangwin Avatar answered Oct 19 '22 03:10

zpangwin