Sublime Text: Multiple Select in a Selection - sublimetext2

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?

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.

Press Ctrl+D to select one more element and then one more again until you have selected all elements in container-a.

(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.
(if you are already under the word) use Ctrl+E (command slurp_find_string). This causes the word to be used in find box.
select the region you want (Ctrl+Shift+J should work nicely in your case)
Hit Ctrl+F, you will find all settings are right ("In Selection" on, your word in box already)
Just hit Alt+Enter and you are there.

For Mac, select what you want and then you can use --> cmd+ctrl+g

Related

SSRS(rdl file) How to add multiple expressions to one text box

When choosing a textbox in rdl design file - you can add expression. But how do I add multiple expressions to the same textbox?
Click in the text box until you get the cursor (usually 1st click
will select the text box, the 2nd will place the cursor in it).
Next, right-click the cell and choose Create Placeholder
Set the expression for the placeholder as you would for a textbox.
Now you can also type literals into the text box and then right-click again when you need another place holder
Repeat as required...
I often use this for things like page numbers with a total that might look like this...
Note: You can format each piece of text individually too using this method.

Close tags dropping below highlighted line

I have minimal experience with HTML script so this may all go horribly wrong here.
Alright so I have a very simple yet very time consuming task of taking complete papers and converting them into HTML script. I'm using Sublime Text 3 with Emmet plugin.
Basically,
This is the first header
This is the first paragraph that needs to be tagged
This is the second header
This is the second paragraph that needs to be tagged
So super simple I need to put header tags on the headers and paragraph tags on the paragraphs.
What I have been doing is holding Ctrl and manually highlighting the desired text as it is all rather random. Problem is that takes forever to manually highlight the text like that.
I am aware of other ways to highlight such as Ctrl + L for the line. Problem is my close tags end up under the highlighted line.
Example:
<h2>This is the first header
</h2><p>This is the first paragraph that needs to be tagged
</p>
It's not a big deal but it makes the code harder to go through later and really chaotic.
The same problem persists if I click the corresponding number of the line.
Seeing as I have hundreds of pages to enter and even more headers, paragraphs, and pictures to properly tag; I'm looking for a solution to the tag dropping below the line or a faster method to entering text.
So, is there a fast method for entering text from a word document to Sublime text and quickly get the corresponding tags? e.g. <h2>,<h3>,<p>,<ul>,<li> and so on.
Any help will save my sanity, thanks.
When you select a line with CtrlL, it automatically selects the entire line, and moves the cursor down to the first position on the following line. There are two ways around this. The first is to place the cursor in the first position on the line you want to select, then just hit ShiftEnd and the line will be selected, with the cursor now sitting in the last position on that same line. Alternatively, use CtrlL, then hit Shift← (left arrow) to move the cursor from the first position on the next line to the last position on the selected line. Either way, you can now hit the key combo in Emmet for inserting a tag pair, and you're all set.

Looking for an addon to automatically select all instances of selected word in the current page

I am looking for an addon to install so that when you select a word in a webpage ( by clicking) it automatically highlights all the instances of that selected words in that text. There used to be this
highlightall addon but it no longer works for recent version of Firefox! It was ver handy as all you had to do is to select that word and all instances get highlighted
Such an addon would be very helpful when reading a code as you can simply select a variable name and it would select everywhere that variable has been used in the code so you could understand the program better.
Ok man I made the addon and released it at AMO. I called HiliteOnSelection I linkified it.
Use it tell me how it works tell me how you would like to change it etc. I appreciate feedback.
More than 50 bounty would have been nice too, a side effect was I learned a lot so it's cool.
If you press ctrl+f and then click highlight all it will do it.
If you want to copy it heres the code for highlihgt all:
function toggleHighlight(aHighlight) {
if (!this._dispatchFindEvent("highlightallchange"))
return;
let word = this._findField.value;
// Bug 429723. Don't attempt to highlight ""
if (aHighlight && !word)
return;
this.browser._lastSearchHighlight = aHighlight;
this.browser.finder.highlight(aHighlight, word);
}
here it is on mxr
if you need more help let me know
Well, my code is quite complex because it performs several advanced services, but if you're asking how to highlight a word of text, the easiest way is to add a style attribute around the word. For example:
This hot dog needs more mustard.
... would become...
This hot <span style="color:#FFFF60">dog</span> needs more mustard.
The above would highlight "dog" in the sentence. The above assumes white text on black background, where yellow is a good highlight color. If the text is black on white background, that #FFFF60 should probably be something like #40FFC0 or #40FF40 or #4040FF or whatever you find looks good.
When you want to remove the highlight, you can delete the <span> element. In my case I usually put the style="color:#FFFF60" in some other existing element, so I don't delete the element to remove the highlight, I delete the style attribute I added to the element.
By the way, the reason I change text color to highlight terms is because that does not change the size of the word, and therefore the text never reflows (and screws up formatting). You could probably change background color to highlight, but I never tried that.
To find all instances of a certain word, I don't know, but probably the TreeWalker is part of the solution.
Ok C Graphics man here's the code
Ok its real easy you don't even have to write another function. Here's the code to highlight any word in the current tab.
gBrowser.selectedTab.linkedBrowser.finder.highlight(true, 'YOUR_WORD_HERE')
if you want to unighlight then set the first argument to false.
You can do this in any tab just have to supply the browser element within the tab.
like this code here will highlight everything in the first tab:
gBrowser.tabContainer.childNodes[0].linkedBrowser.finder.highlight(true, 'YOUR_WORD_HERE');

How can I do a column select across the entire file?

Is there a way I can use the middle click or maybe (Ctrl+Alt+Up) to a particular column across all lines in a long file? Currently, I am middle-clicking and then dragging this to the end of the screen and waiting for it to select all lines.
Specifically, for long files, how would I select one particular column across the entire file?
This should do it:
Ctrl+A - select all.
Ctrl+Shift+L - split selection into lines.
Then move all cursors with left/right, select with Shift+left/right. Move all cursors to start of line with Home.
OS X
You can click the following and drag to create a selection of one or more columns of characters:
Left mouse button + option
Middle mouse button
To add to an existing selection, hold command while doing the above.
To subtract from an existing selection, hold command + shift while doing the above
Windows
You can click the following and drag to create a selection of one or more columns of characters:
Right Mouse Button + shift
Middle Mouse Button
To add to an existing selection, hold Ctrl while doing the above.
To subtract from an existing selection, hold Alt while doing the above.
In Mac OS X, replace Ctrl with CMD key. So it'll be,
CMD+A - select all.
CMD+Shift+L - split selection into lines.
Then move all cursors with left/right, select with Shift+left/right. Move all cursors to start of line with Home.

Hide arrow in standard dropdown?

Is there a a way to hide the arrow in a standard dropdown select fieldset?
Fiddle link
I have an autocomplete system where you fill in the organisation number of a company and it finds the info based on a database. I'd like to have the select box, but without the arrow..
I need it to do this as it's a double function form, either you can fill in your ORG nr or just manually type it in, pretty simple, probably used all over the internet.
Thanks :)
Kyle,
Usually autocomplete systems use input text elements instead of a select element. This creates what you are trying to achieve. Google is a classic example of this.
If you want, you can take a look at jQuery's autocomplete plugin to get another example and some code ideas, or whatever. http://docs.jquery.com/Plugins/Autocomplete
It's not easy, but you can fake it by putting a button above a Select that has its size property set to a value greater than 0.
Have the Select hidden and positioned absolutely under the button. Clicking the button shows the list. Selecting the list changes the text on the button and re-hides the Select.
This way you need a text box, because you cannot type anything in <select> tag.
And put an onclick event to this box to open autocomplete with all possible values.