Sublime Text 2 : About Mark and BookMarks - sublimetext2

** Sublime Text 2 :Win 7 **
What's the difference between Edit -->Mark and Goto -->BookMarks ?
Why does Edit -->Mark can only set one Mark in my Sublime Text ?
Best regards.

From This helpful link
I find myself using Marks a few times a day to do large selections.
For instance if you have a big block of HTML it can be very tricky to
stay inside the proper scope if you’re trying to delete all the
contents of a very high level container. With Marks you can just put a
mark on the opening line of the container, hit cmd+shift+a to select
down to the bottom of the tag, and then hit cmd+K, cmd+a to select
everything back to your previous mark.

Related

After "a{display text}", then pasting the url, how can I get the cursor to go after the close </a>? Like $0 in a Sublime autocomplete

I'm using Emmet in Sublime Text 3.
After executing a{display text}, you get
display text
What I'm trying to do is get the cursor to jump to after the close </a>, after I've pasted in the url. I'm trying to simulate Sublime's autocomplete $0 behavior, like
display text$0
I am looking through snippets.json, but I'm not getting it. The only "a" entry is in the "abbreviations" object, and contains only the open tag:
"a": "<a href=\"\">",
I've not edited any Emmet tags before, and I thought this might be a good first one to try.
Any ideas on how this might be possible?
There's a built-in Emmet setting that does this for all tags:
This is in C:\Users\jeffy\AppData\Roaming\Sublime Text 3\Packages\Emmet\Emmet.sublime-settings
// If set to `true`, Emmet will automatically insert final tabstop
// at the end of expanded abbreviation
"insert_final_tabstop": false
I duplicated it to C:\Users\jeffy\AppData\Roaming\Sublime Text 3\Packages\User\Emmet.sublime-settings
and changed it to true. It does exactly as I want. Well, it still goes to the display text, even if there already is display text. Then it goes to the end. But close enough!

How to remove a div from the entire project?

I've got a project consisting of over 200 html files. There's a div repeated throughout most of these, looking like this:
<div class='foobar' id="abcdef123'></div>
I have found all uses of the class using the Find in Files function in Sublime Text 2 - now I want to remove them, i.e. completely delete any line containing that div (and its closing tag).
Is there an easy way to do it in Sublime Text 2?
EDIT: I have forgotten to mention that sometimes the div has additional classes and the ID is always different. How would I write a regexp to deal with that?
In Notepad++, open all 200 files and replace with the following regular expression.
<div class='foobar[^']*' id="[^']*"></div>
and replace it by nothing. I don't know Sublimetext2.

Can I wrap a text selection in a tag in phpstorm?

Suppose I have a text:
This is my text!
How beautiful it is!
And I want to wrap each line within a p-tag, is there an easier way than to navigate to each line and add them manually and have them close semi-automatically?
I want them to look like this:
<p>This is my text!</p>
<p>How beautiful it is!</p>
while having to do as less as possible.
Select your lines
Code | Surround With...
For Windows/Linux: Ctrl + Alt + T
For MacOS: Cmd + Alt + T
Choose "Emmet"
Type p* -- this will surround each line with <p> tag
NOTE: Empty lines will be wrapped as well so it is better remove them in advance.
Similar/related case.
P.S.
In current versions of IDE the dedicated "Surround with Emmet" action is available which allows you to bring that popup window in one key stroke instead of having going trough via intermediate Surround with... popup menu first.
That action has no shortcut defined by default, but you can easily change that and assign any desired shortcut in Settings/Preferences | Keymap -- just look for Other | Surround with Emmet action (hint: use search box to speed up your search).

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.

SublimeText2 - Wrap lines with quotes or tags skipping initial whitespaces

I know i can select a block of lines, and then split it into many selections, one per line, using Ctrl+Shift+L then just typing a quote it will wrap the line automatically or to wrap each line with htlm tags I know I can use ctrl+shift+w
The problem is that I would like to skip the initial whitespaces of each line and just adding a quote or a html tag at the begging of the first word.
ps: Im using SublimeText 2 with Vintage
Select a block, then press:
Ctrl+Shift+L, Home, Shift+End
Is that what you are looking for?
Select a block, then press:
Command+Shift+L, right-arrow, Command+Shift+left-arrow
(Note: I'm on a mac.)