Reputation: 655
I want to do multiple select and edit within a specified selection in Sublime Text 2. The following screenshot illustrates the situation:
When I select "element" and press Alt + F3 (in Windows) I can simultaneously edit all instances of element. However what I would like to do is to be able to edit all instances of element only within container-a while leaving element within container-b untouched. I tried first selecting a specific area but then as soon as I attempt to select "element" my first selection disappears.
Is this possible to achieve in Sublime Text 2?
Upvotes: 4
Views: 1497
Reputation: 447
(Sorry my approach is very similar, but just a tiny thing to make it very slightly faster.)
Before you start, have the setting "auto_find_in_selection
" to true, (This is probably only for SublimeText 3). This will have the "In Selection" button automatically done in most cases.
slurp_find_string
). This causes the word to be used in find box.Upvotes: 1
Reputation: 102852
You can simply use the Find in Selection
option in the Find
panel. Select the text that you want to search in:
then hit CtrlF to open the Find
panel. Type in the text you want to find (such as element
), then, in the group of buttons to the left of the text area, click the second button from the right - In Selection
(highlighted in red):
Finally, either hit AltEnter or click Find All
to select all the instances of element
in the selected area:
and you're good to go.
Upvotes: 3
Reputation: 1790
Press Ctrl+D to select one more element and then one more again until you have selected all elements in container-a.
Upvotes: 1