+4
Completed

Find and replace only in the current file

Andy Toy 12 years ago updated by Marty Powell 8 years ago 5
It would be nice to be able to run a find and replace only in the selected tab. While having the ability to run a replacement of text on many files is nice, usually you do not need to. I do webdev and you come across a lot of index.php files, having to close out of all the 'open files' with the same name just to be able to run a replace on things inside the current file is more than a bit of a pain. It would also be nice to be able to step threw the find results one at a time and choose if you wanted to replace them.

Answer

Answer
Completed
You can use the Find/Replace menu item for this
Answer
Completed
You can use the Find/Replace menu item for this
+1
Sorry, I really should have gone threw the options in the menu (I simply tried ctrl-shift-f by default). Thanks for the quick reply and modifiable keyboard shortcuts!
+10

Thanks for answering Andy, but why shouldn't that be included in the options for the "full" find and replace see image


+9

(Mac keyboard shortcuts, ST 2.0.2)


cmd-shift-f (in menu, Find > Find in Files) brings up the 'Find / Where / Replace' tool as pictured, which applies to all open files


cmd-alt-f (in menu, Find > Replace...) brings up a more traditional 'Find / Replace' that only targets the currently focussed file


So, use cmd-alt-f (Replace...) instead of cmd-shift-f (Find in Files) to avoid this problem.

+6

The windows shortcut is ctrl+h