PhpStorm add Angle brackets with tab - phpstorm

I start with PhpStorm but I don't understand why it adds angle bracket every time I press Tab.
In a html file (| cursor position) I type a then [Tab]. I get I write I have | and then if I write this[Tab] I have <this>|</this>!
No matter where I write to an htlm file, I have this behavior! In a php file, it simply doesn't make a tab. I reset the settings by deleting file ~/Library/Preferences/PhpStrom2017.2. But it's always the same.

If you want to get rid of this behaviour for HTML files you can do this.
Settings | Emmet | HTML | Enable XML/HTML Emmet
-- disable this option.

Related

Is there a way to chopdown an html tag with a keyboard shortcut?

I know that intellij has an html formatting setting for chopping down an html line if it is too long, but often I'm in the midst of editing and I need to add a lot of attributes to a tag and I would just like to chop down the tag with just a keyboard shortcut. I've searched through the intellij settings. I can't find a way to do it other than manually.
just to clarify what I mean is I want to turn this:
<input type="some-type" id="some-id" [someAngularProperty]="some fairly long bit of logic"/>
into this:
<input
type="some-type"
id="some-id"
[someAngularProperty]="some fairly long bit of logic"
/>
with a keyboard shortcut.
You're probably looking for Ctrl+Alt+L ('Reformat Code' action).
If you select a piece of code and hit the shortcut, it will reformat that piece for you according to current formatting settings (File | Settings | Editor | Code Style | HTML). If nothing is selected, it will reformat the whole file.
So in order for chopping down to take effect on hitting the shortcut, 'Wrapping attributes' option should be set to either 'Chop down if long' or 'Wrap always' (screenshot).
More information on reformatting and rearranging code in IntelliJ IDEA here.

PhpStorm can't highlight the file

When I write JavaScript in PhpStorm the articleList.js file looks great but list.js become like plain text.
How can I fix it?
Please check if list.js is added to text file patterns in Preferences | Editor | File types -> Text file type. Removing this pattern should solve your problem

IntelliJ expands Emmet expression in html encoded format

New user to IntelliJ ultimate 2016. Trying to use simple emmet expression "div.error" in a index.html file.
When I tab out, it expands to below expression with html encoded form instead of usual html.
<div class="error"></div>
<!-- /.error -->
I'm not what settings I messed up with. Any help is appreciated
Preferences | Editor | Emmet | HTML, make sure that 'Escape' filter is not enabled in 'Filters enabled by default'

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.

Sublime Text 2 tab_size setting not correctly activated

I have the following in my user/Preferences.sublime-settings
{
"tab_size": 2,
}
And most of the time it works. But once in a while I open a ruby file, and it jumped back to 4 spaces. I'm wondering if there is some bug or slight difference in opening a file that could change this?
Having trouble tracking this down. Thanks for the help.
You'll want to add:
"detect_indentation": false
This is on by default and ST is trying to be smart detecting the indentation of your current file, overloading the user or syntax specific default.
Here are various Sublime Text 2 tab settings explained:
http://opensourcehacker.com/2012/05/11/sublime-text-2-tips-for-python-and-web-developers/#Configure_sane_tab_and_whitespace_policy_and_other_settings
Note that the tab setting may be per file type
There is also autodetect from file enabled by default and your source code file may contain bad tabbing