I've just started using Sublime Text 2, coming from emacs.
I have a region of text selected. Within that region, I'd like to replace all text instances of '0' with '255'.
How do I do this kind of text replacement?
I've just started using Sublime Text 2, coming from emacs.
I have a region of text selected. Within that region, I'd like to replace all text instances of '0' with '255'.
How do I do this kind of text replacement?
I know this has been answered many times, and all are correct, but I though I would add another:
Similar to the Ctrl - D method to select individual occurrences of the current selection, you can select all occurrences in the file with Alt+F3 when using Windows or Linux (CMD+CTRL+G in Mac world).
This is helpful for mass-changes.
This frustrated the heck out of me, and none of the above answers really got me what I wanted. I finally found the answer I was looking for, on a mac if you do ⌘ + option + F it will bring up a Find-Replace bar at the bottom of your editor which is local to the file you have open.
There is an icon option which when hovered over says "In Selection" that you can select to find and replace within a selection. I've pointed to the correct icon in the screenshot below.
Hit replace all, and voila, all instances of
'0'
will be replaced with'255'
.Note: this feature is ONLY available when you use ⌘ + option + F.
It does NOT appear when you use ⌘ + shift + F.
Note: this will replace all instances of
'0'
with'255'
. If you wanted to replace0
(without the quotes) with255
, then just put0
(without quotes) and255
in theFind What:
andReplace With:
fields respectively.Note:
option key is also labeled as the alt key.
⌘ key is also labeled as the command key.
Some of the answers here haven't really helped.
People are showing you how to find stuff, but now how to replace it.
I just had a look, and it looks like it's Ctrl+H for replace, then you get the find dialog as well as a replace dialog. This worked for me.
ST2 has a feature for changing multiple selections at once.
If this method selects an instance that you want to skip, press the key for Find->Quick Skip Next.
*Look at the Find menu on the menu bar to find the correct shortcut key for your system. For vanilla Windows, the menu tells you that Find->Quick Add Next is Ctrl+D and Find->Quick Skip Next is Ctrl+K,Ctrl+D.
First, select the portion of the text containing the bits you want to change. On Windows (sorry) it's Ctrl + H or
Find > Replace...
This opens up the Find/Replace boxes at the bottom of the file. Enter your details then clickReplace All
(or Ctrl + Alt + Enter)Windows
1- Find: CTRL + F
2- Select-in: Alt + Enter
Now you can change all the selection in one shot like "seen-on-tv" ST homepage Spot.
Credit goes to : https://superuser.com/a/921806/342825