select text and hint other same text - sublimetext2

When I select Button, other line "Button" surrounded by rectangle, like this:
When I select Button, other line "Button" don't have rectangle, like this:
word_separators remove ".:"
"word_separators": "/\\()\"'-,;<>~!##$%^&*|+=[]{}`~?"
how to control rectangle

This has nothing to do with plugins. The auto-highlighting functionality only works for selecting whole words, meaning they are surrounded by word boundaries (\b in regex-speak). When you remove . and : from "word_separators", those characters are no longer treated as word boundaries, and Button in the line
ccui.Button:create(string,string,string,int)
is no longer selected. Easy fix: add . and : back to "word_separators", so you get something like this:

Related

Vim Join opened Html tags to same line

So I've started using snippets with vim, now sometimes I like the closing tag to be put on a newline but other times I like the closing tag to be on the same line.
After typing a html tag and pressing the autocomplete key it's formatted as shown below, with the cursor position shown by the caret symbol
<td>
^
</td>
Currently, if I want both tags on the same line I have to move the cursor up a line and repeatedly hit Shift+J to join the lines, but this takes multiple key strokes
Is there a fast way (without moving the cursor from it's current position), to join the two lines together to look like, from the above code snippet
<td>^</td>
You can utilize Vim's built-in inner tag text object to delete (dit) or change (cit) the whitespace / text inside the tags. (This assumes the tags are indented; without indent, you still need a J to join the end tag to the current line.)
or:
:.,/td>/j
meaning from the current line (.) to (,) search for "td>" (/td>/) join the lines (j)

Truly selecting in HTML tags in Vim

In an HTML doc say I have this:
<p>
fdhjfkdj hfkjdfhkjdfhkjdh dfhdkf kjdh kjdhkjdhk
fhkdj hdjfhjkdh kjdh kjdf jkdhf d
jfdfhkdjfhkjdf
fjdj fhkd fdhfkjd hfkjdfhkjdf kdhfd
fdhjkfjk dhjdfhkjdf kjdfhdk fhdk
</p>
If I do the normal vit command in vim it'll select the text inside if I yank it, but if I try to do anything such as tab over or run gqit affects the entire <p>. For example, doing vit then gq ends up looking something like
<p> fdhjfkdj hfkjdfhkjdfhkjdh dfhdkf kjdh kjdhkjdhk lkd sldj lks jlkdf
jlsdkf jlsdf jdl dlsjl fhkdj hdjfhjkdh kjdh kjdf jkdhf d jfdfhkdjfhkjdf fjdj
fhkd fdhfkjd hfkjdfhkjdf kdhfd fdhjkfjk dhjdfhkjdf kjdfhdk fhdk </p>
Indenting it wont indent the text, but the whole tag. How do I truly select on the the text inside so I can run commands on it like the ones above?
That's because the inner HTML of the paragraph starts immediately after the starting <p> tag, so it includes the newline character immediately after it (which you'll also see after vit). As you've recognized, reformatting and indenting are line-based, so that single character counts.
To make the text object work like you want, you need to move to the start of the selection (o), then reduce it to the next line (easiest with j; for indenting and formatting, the exact start column isn't important, anyway). So the sequence for reformatting would be:
vitojgq
If you want something quicker, you need to write your own text object. Have a look at my CountJump plugin, or the textobj-user plugin; they can help with defining one.

Missing whitespace in combobox

My code:
<select><option value='3'>0000000000000001 11121</option></select>
I want to get combo box with spaces between two numbers, however all I get is the same as this:
<select><option value='3'>0000000000000001 11121</option></select>
Can someone advice how to get additional whitespace.
well you can put inside your tag like this:
<select><option value='3'>0000000000000001 11121</option></select>
White spaces aren't interpreted by html
It is essentially a standard space, the primary difference being that a browser should not break (or wrap) a line of text at the point that this occupies.
JSFIDDLE
You need to fill area not with space symbol but with .
is the entity used to represent a non-breaking space.
So try this:
<select><option value='3'>0000000000000001 11121</option></select>
To add spaces to your text, you can use the character entity.
Try this:
<select><option value='3'>0000000000000001 11121</option>
</select>
Demo

Sublime Text 2 - Problems with HTML automatic indentation

Every time I type an opening html tag (like <div>) then press the Enter key, the cursor automatically inserts an indention on the next line. However I don't want it to be indented since I still have to write the closing tag (actually I press the enter twice and write the closing tag in the third line so I can have an empty line in between). Now I have to press the back button to align the cursor with the opening tag.
I am aware of Sublime Text 2's autocomplete like when you type '<' and Ctrl + Space, a list
of available elements would appear. And when you select one item from the list, the editor would
provide you of both the opening and the closing tag. However, I'm not used to that kind of typing.
So is there a way to turn off this annoying feature of Sublime Text 2
You can disable auto-indentation by setting auto_indent to false.
In order to do this for the HTML syntax only, go to Preferences/Settings – More/Syntax Specific – User and insert the following contents:
{
"auto_indent": false
}
This will make the cursor to jump back at column 0 after hitting return.
To make it stay at the column of the opening tag, re-enable auto_indent and tweak the indentation settings in Packages/HTML/Miscellaneous.tmPreferences. If you aren’t into regular expressions, try to get rid of this file completely.
You can also just type the closing </div> tag and sublime text will automatically un-indent it for you.

TLF text word-wrap

suppose I have added a TLF text named 'testTLF' to my app and it can contain 6 characters per each line and word-wrap is also enabled ... now I append this text to it:
testTLF.appendText("abc(ijklm");
the problem is that it doesn't fulfill each line with 6 characters but it shows something like this:
abc
(ijklm
while what I want is this:
abc(ij
klm
In the Properties panel, expand the "Advanced Character" section and change the value of Break to Any.