Sublime Forum

Replace/paste all selections in one click? Newbie question

#1

In this example, I want to replace all of the selected “2” with “4”. To my luck, when I highlighted a single 2, the program seems to have automatically highlighted all of the other single “2’s” that I want to replace with 4, which is promising, but it still says “1 character selected” at the bottom, and only pastes or replaces into that one character, despite it looking like all of those 2s are selected by the program. How do I make it so all of them are really highlighted and can be replaced in one click? Sometimes I have to replace upwards of 100 separately highlighted characters, all of which might be the same number or text, so I am looking for a faster way to do this.

Here is a snapshot example: s23.postimg.org/kdreh9j95/textproblem.jpg

0 Likes

#2

You selected a “2” and the program, selected the “2” and highlighted (to the contrary of selected) all the other occurrences.

if you want to replace every 2 with a 4, then just

  1. select “2”
  2. press ALT+F3 to select all occurrences of “2”
  3. Now just press “4”
  4. Done

if you want to replace the 2 near PRIM thing, then just be a bit smart in what you select, such selecting ‘PRIM_SPECULAR, 4,’ and then pressing ALT+F3

You can also select 1 by 1 by pressing ALT+D, and if you want to skip one do CTRL+K,+CTRL+D

very easy

0 Likes

#3

thanks, Tito, but if I press ALT+F3, it selects more than what is shown highlighted there, it will also select every other 2 in the document that it sees. Is there a function to select just what the program shows highlighted there in that pic?

0 Likes

#4

Yes, that is a problem I run into all the time, aside trying to be a bit smart when *selecting *just before of the ALT+F3 function … what I do is with another package that provides an improved “wordhighlight” github.com/SublimeText/WordHighlight you double click what you want to highlight and then press ALT+ENTER and that gonna select only what is highlighted.

0 Likes