Nested abbreviation expansion with emmet in sublime text - sublimetext2

In sublime text with emmet plugin I can write
To get
But if I want to generate some lorem or other tag
after pressing tab I go to the next list item
how can I avoid this?

You can use CTRL+E to expand lorem3, instead of TAB.

When you expand abbreviation (especially like ul>li*3), Emmet generates tabstops (fields in terms of Sublime Text) in some important places assuming that you’re likely want to fill-up data in them (attribute values, tag contents etc.). So after you expand abbreviation you’re actually moving between tabstops with Tab/Shift-Tab. It’s a pity that ST does not displays decorations for tabstops.
You can simply press Esc key to quit tabstops mode and use Tab for expanding abbreviations.

Related

Hide one line in Sublime Text 3

I have one line in a html file containing a base64 representation of an image. This line spans thousands of lines in the editor, which is a huge hassle when always scrolling past it.
Is there a good way in ST3 of hiding this line?
Select the text you want to hide, then from the Edit menu -> Code Folding -> Fold.
Note that folding is not stored in the session, and reopening the file or ST will display the text unfolded again.
You could also take a look at plugins designed to help you with this: https://packagecontrol.io/packages/Base64%20Fold
you can simply press ctrl+shift+{ and to revert back just press ctrl+shift+}

Preventing Sublime to Search Automatically

I am working on a XML document that contains huge amounts of data. Whenever I want to make a search regarding to a specific keyword (let's assume a 4-letter-word) by typing just the first letter, the sublimetext 2 automatically stars searching thus freezes for a fair amount of time which is quite disturbing.
Is there any way for me to prevent sublimetext doing so? For example, it may wait for me till I press the "enter", or it may start searching after 3 letters are typed.
The Sublime Text find panel has a little toggle button called "Highlight matches". When this is enabled, Sublime searches instantly as you type. When it is disabled, Sublime won't search until you press Enter or click one of the Find buttons.
Here is a screenshot of ST3 showing the button:
Build 3105, Default theme:
Build 3156, Adaptive theme with orange accent:

Move cursor across html tags in text editor

How can I move the cursor across HTML tags in a text editor like Sublime Text or anything else instead of pressing ctrl+arrow (not a direct move) keys so many times?
Is there any shortcut available?, if not, how can I create one for Sublime Text editor?
Here is how I want to move the cursor.
<html>
<p>
"a"
</p>
<div>
"b"
</div>
</html>
I want move the cursor from position a to b using a shortcut.
I'm not familiar with Sublime but I have heard that it's very similar to Textmate, it may actually be based on Textmate, I'm not sure.
I am familiar with Textmate 1.5 though, and it does have a feature like this which allows you to setup tab triggers and templates by using the built in Bundle Editor.
note: it's worth noting that there is a newer version of Textmate available. I believe the current version is 2.0 but I tried it and decided to stick with 1.5 because 2.0 implemented some major changes and I preferred to stick with what I was familiar and happy with.
A very basic example of how tab triggers can be used in Textmate would be..
<table border="0" cellpadding="$1" cellspacing="0"><tr><td height="$2"><table border="0" cellpadding="0" cellspacing="0"><tr><td></td></tr></table></td></tr></table>
This is a simple table spacer that I use in emails rather than using transparent shims. By nesting a table within a table it will prevent it from collapsing and works as a cross-compatible alternative to transparent gif images for email layouts.
By setting this up in Textmate, all I have to do is type tspace followed by a Tab and this code automatically populates at the position of the cursor. Subsequent Tab's will jump the cursor to each $ notation, which is Textmate's own syntax.
So tspace + Tab generates the code, + Tab jumps to $1 where I then fill in the appropriate value, + Tab jumps to $2 where I fill in the appropriate value + Tab jumps to the end of the code block.
note: you can also set it up where any placeholder is repeated so if I notate $1 in more than one location, it will automatically populate everywhere that variable is, the first time I fill it in.
This is only the most basic of examples. There are other similar features in Textmate, and they are only limited by how complex you set them up to be.
Though, as I mentioned, I'm not familiar with Sublime, I did look into it briefly and found this article which outlines the exact same functionality that I've described and how it works within Sublime.

Sublime Text 2 multiple selections editing in vintage mode

Is there there a way to edit files across multiple selections in vintage mode?
I hit cmd + D (this is under a Mac) to select instances of string in the file, but I can't figure out how edit the selections.
This is under Sublime Text 2.
I haven't tested this on a Mac, but on Linux using CTRL-D puts you in visual mode. When you're in visual mode c allows you to change the highlighted text, putting you into insert mode much like vim would.
I struggled to figure this out myself. I came to find that simply selecting a word with Ctrl+D and then pressing c isn't a complete solution. It will only select the first occurrence of a word. In order to select and change them all I have found that I need to execute the following sequence:
Place the cursor at the beginning of the desired word
Ctrl+D to highlight the word
Ctrl+F to open the Find box pre-populated with the desired word
Alt+Enter to select all of the matching words
c to make the changes
Esc to return to COMMAND MODE
There are several posts all over the Internet (including the documentation on the Sublime Text website) which states that pressing Alt+F3 will select all of the matching words. This does not work for me on openSUSE/KDE. Pressing Alt+F3 will instead open the window menu for minimizing, maximizing, etc. In fact, if you hover over the Find All button after opening the Find box it will display Alt-text indicating Alt+Enter.
Usually I just press shift+up/down/right/left, then you will find that you can select whatever you want. It works on Mac sublime 3.

Keyboard shortcut Sublime Text 2?

Does the keyboard shortcut for moving from editor to console back and forth in Sublime Text 2 exist? If so what is it?
For a Python Code block you can use Ctrl+` (The single quote on the tilde key). There are some other useful shortcuts here:
Useful Shortcuts
Not sure if this helps with other scenarios.