Sublime with Emmet: Highlight text in a tabstop inside a custom snippet - sublimetext2

When using the Emmet plugin in Sublime Text, if you type a ! and then hit tab it outputs an HTML5 template. I noticed that inside this template, the <title> tag not only has a tabstop, but it also has the title text highlighted to allow for quick replacement.
I'm aware the pipe character (|) sets up tabstops for the cursor, but is it possible to highlight a group of characters inside your own custom snippet file?

Ha! Found it.
To highlight text inside a tabstop in your own customized snippet, you need to use the TextMate format for tabstops (i.e. ${1}).
To do the highlighting, place a colon after the number and just before the text to highlight. So for example, you could do something like this: ${1:This text will be highlighted}. The next time you expand your customized snippet, the editor will highlight all text inside the tabstop.
If you have multiple tabstops that use this technique, then Sublime will highlight each group of text as you tab over it.

Related

ATOM text editor text colour change due to hash

In my HTML document I am trying to use HTML emojis in a span as follows:
Now, you can see that the emoji &#128200 makes for some reason the lines ahead of it orange. When I remove the hash it looks normal as the following:
How can I normalize the text editor colour with still using the hash in the emoji, because at the moment all lines ahead are all orange.
you need too put semicolon at end of emoji

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.

inline code as a "word" in sublime text

Is it possible to make sublime text consider all code within backticks to be a single word? I am including inline code in a markdown document, and it keeps breaking when I wrap a paragraph and inserts a newline in the midst of a code chunk. For example
This is the text I am writing and `r this_is_some_code`
If the line is long, and a newline falls between `r and the final backtick, then the code doesn't work correctly. Is it possible to make that whole region be considered a single word? then it would not wrap at the ruler at all.

Best practices: displaying text that was input via multi-line text box

I have a multi-line text box. When users simply type away, the text box wraps the text, and it's saved as a single line. It's also possible that users may enter line breaks, for example when entering a "bulleted" lists like:
Here are some suggestions:
- fix this
- remove that
- and another thing
Now, the problem occurs when I try to display the value of this field. In order to preserve the formatting, I currently wrap the presentation in <pre> - this works to preserve user-supplied breaks, but when there's a lot of text saved as a single line, it displays the whole text block as single line, resulting in horizontal scrolling being needed to see everything.
Is there a graceful way to handle both of these cases?
The easiest way of dealing with this is turning all line breaks \n into <br> line breaks. In PHP for example, this is done using the nl2br() function.
If you want something a bit more fancy - like the list you quote getting converted into an actual HTML <ul> for example - you could consider a simple "language" like Markdown that SO uses. It comes with natural, simple rules like
# Heading 1
## Heading 2
### Heading 3
* Unordered List item
* Unordered List item
1. Numbered List item
2. Numbered List item
etc....
You can use the php function nl2br() It transforms line breaks into elements
Convert newline characters to <br /> tags explicitly, and let the browser word-wrap the text normally. That preserves the breaks the visitor entered, without harming other paragraphs.
You could replace line breaks with HTML line breaks.
Replace "\r\n" or "\n" (depending on the browser and platform, check first for longer one) with <br/>.
I would normally replace all CR/LF with LF, and then replace all LF with <br />. You can then render this text inside any HTML container you want and let it flow naturally.