Sublime Text: How to select an everything contained in an HTML element? - sublimetext2

I'm running Sublime Text 2 on OS X.
<table>
...
</table>
If my cursor is at the beginning of the opening table tag is it possible to automatically select everything down to (and including) the ending tag? I have the Emmet plugin installed but can't figure out if this is possible.
Using Emmet ⌘+⇧+k selects both the beginning and ending tag but not the text in between those tags (which is my goal).

I use Ctrl+, in Windows. It should be Ctrl+D in OS X.
Emmet Documentation

Related

VScode autosuggest - way to tell what tags abbreviation means?

Atom text editor showing 'td' is 'table data'
vscode emmet abbreviation for p element
Is there a way in VScode's autosuggest to have it explain what each element is, like how it does in Atom? For example, showing 'p' is 'Paragraph' when the letter 'p' is typed. I just want a way to have it show what the abbreviation means in the autosuggest (autosuggest is working aside from that). Is there an extension or something I need to enable?
just install extensions in vsCode
Ex:1. HTML CSS support
2.IntelliSense for CSS class names in HTML
3.HTML boilerplate ...etc..
ex:if you are working on REACT, you need to install React extensions,

Visual studio code: how to automatically change the matching closing tag

In visual studio code when changing the start tag type (e.g., from <div> to <span>) I want the editor to automatically change the matching closing tag. How can I do that?
Start VS Code, go to Plugins and search for Auto Rename Tag. Install, reload, done. This plugin:
https://marketplace.visualstudio.com/items?itemName=formulahendry.auto-rename-tag
You can use the Rename Symbol command to do this.
Select (or click to put the caret anywhere inside) the opening tag
Hit F2
Enter the new tag name and press Enter
Opening and closing tags will both be renamed.
Alternatively, you can press Shift + Enter at step 3 to preview changes and then Shift + Enter again to apply them.
Since VSCode 1.44, you can enable automatic updating of matching tags like this:
Go to File menu, Preferences and Settings
Search for editor.linkedEditing
Enable "Linked Editing"
Here is an example of how it works:
As mentioned by #TwistedSim, you can achieve this using Ctrl + D
F2 works in (js|jsx).
If you happen to have IntelliJ Keybindings installed you can achieve the same with SHIFT + F6.
CNTRL+D didn't work for me at all. I'm on a Mac at the moment.

Sublime Text: Accept Suggested Autocomplete Without Expanding it

In Sublime Text, I have installed Emmet so that I can do zen coding. Now, the problem is that when I'm typing, and get an autocomplete suggestion, as soon as I accept that autocomplete suggestion (either by entering tab, enter, or even pressing space bar), the suggested tag is expanded; this causes me not to be able to continue the zen coding.
To give you an example, say I want to insert a <select> with 6 <option> child elements. If I enter select>opt, then autocomplete suggests option, but as soon as I accept option, that expands to select<option></option>.
What I want is to accept option, but that it won't expand to <option></option>.
Is there anyway to accomplish this?
Actually, the answer is very simple. In your example, when you get the autocomplete suggestions for option, you will get 2 of them. One is the tag, the other is text. Use Ctrl+Space to go through all the suggestions, and select the text version of option and not the tag version.
In Sublime Text completions consists of a 2-tuple containing the showed string and the inserted characters/snippet. I don't think know whether it is possible to just insert the showed string. However if you search for any way, there is a way to establish: modify the source code of the html tag completion file.
Install PackageResourceViewer, then press ctrl+shift+p write PackageResourceViewer: Open Resource. Select HTML >>> html_completions.py.
If you save the file it will shadow (not overwrite) the original completions file. Hence just remove it to get the original behavior.
In this file:
in line 15 replace return (tag + '\tTag', tag + '>$0</' + tag) by return (tag + '\tTag', tag).
in line 245 replace completion_list = [(pair[0], '<' + pair[1]) for pair in completion_list] by completion_list = [(pair[0], pair[1]) for pair in completion_list]
Now it should insert the tag names instead of the whole tags.

Automatically update the closing tag when open tag changes with Sublime Text 2 on Mac OS X

See the H2 tags? How can I change them all to p tags without manually going from line to line. cmd+d is not viable because of the varying lengths of the inner content.
I found something called Emmet Plugin which I installed but can't get it to work. (Followed steps and confused by docs http://docs.emmet.io/actions/go-to-pair/).
Thanks for the help.
--UPDATE--
Not using a regex. Just to clarify I want something that will automatically update the closing tag if I change the open tag.
You need “Rename Tag” action:
https://github.com/sergeche/emmet-sublime#available-actions
Alt + F3 works for me. I'm using the Emmet plugin, though.
I use Emmet and CTRL+SHIFT+' does not work for me.
I changed the key shortcut of the command.
Preferences -> Key Bindings -> User
Content:
[
{ "keys": ["ctrl+shift+;"], "command": "rename_tag" }
]
Here are some solutions which does not require any plugins.
All solutions works on sublime2, sublime3 and atom
Using Multiple Cursors (press shift-alt and down arrow)
Using Ctrl-D (if you want to restrict the update to some elements only)
Using ALT-F3 (to update all instances of h2 -> p)
PS: For those who does not have the tags in same line, of they do have then all the contents are of different number of lines method 1 will not work both other methods will still work
If you have emmet installed: Cmd+Shift+K on mac, Ctrl+Shift+ on windows
Just use regexp. They are supported by Sublime Text 2 (in the CTRL + H).

Surround selection with html tag

Is there any eclipse shortcut/trick/plugin/whatever that will allow me to select a section of text and surround it with an arbitrary html/xml tag when using the html editor.
Something like this textmate video
EDIT: not sure If my Eclipse setup is the same as yours, but...
I have the HTML Editor installed, and if I switch to the Java perspective, I can use Edit -> Quick Fix and then choose Surround with new element to get exactly the effect in your video. (On a Mac, the shortcut for this is ⌘1).
Hope this is helpful.
In the C++ editor, you can try Source -> Surround With... -> Configure Templates to add the tag you want.
The following works and allows for entering random/arbitrary tags:
Select the desired text that you want wrap.
Go to 'Edit > Quick Fix' or press 'Ctrl + 1'.
In the new menu that appears select 'Surround with new element'
However there is an annoyance, please upvote Bug 494169