Sublime Text 2 + Emmet - Expansion doesn't work - sublimetext2

I have the Emmet Plugin on Sublime Text 2, and for example, in a CSS file, pressing TAB after:
pos:r
should result in
position:relative
But instead, after the :, the fuzzy search changes completely and disregards whatever was before the :.
This is very similar to this question:
Sublime Text 2 + Emmet - not expanding correctly
, but I have tried adding "disable_tab_abbreviations_on_auto_complete": false in valid JSON format, saved, restarted ST2, but the behaviour is still the same.

Try a couple of things here. They fixed the problem for me:
Save the file in ".css" format
After typing pos:r press Ctrl (Cmd) + E
Hope this helps.

Related

How to format HTML code in VS Code on Ubuntu?

I have installed the prettier extension on VS Code and use this shortcut - Ctrl+shift+ I. But it doesn't work for me.
Also tried this- Setting the VSCode preference html.format.wrapAttributes to force. But nothing happens.
If "Format Document" is what you are referring to, you just have to press F1 and search for Format Document or just press Shift + Alt + F

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 auto fold the code

By default when I open file it looks as follows:
And I want always unfold when I open a file
Is there any keybinding exist that can unfold everything automatically not require any command from keyboar ? Thank you !
If you last saved a file while it was folded, Sublime will remember that. Select Edit -> Code Folding -> Unfold All, make a small change like adding then deleting a space, then resave the file. It will open unfolded next time.
Also, as a point of style, please use 4 spaces for indentation. Using 1 space, it's almost impossible to differentiate the various indentation levels. 2 spaces is almost as bad. With a Python file open, select Preferences -> Settings-More -> Syntax-Specific - User and add the following:
{
"tab_size": 4,
"translate_tabs_to_spaces": true
}

Sublime Text 2 highlighting always disabled on trailing spaces plugin

In Sublime Text 2 I have installed the trailing spaces plugin, however the highlighting is always set to disabled.
if I toggle the highlight regions, by doing the following:
edit -> trailing spaces -> highlight regions
I always get the following:
highlighting of trailing spaces is disabled!
I have restarted sublime since the package install, but the toggle doesn't seem to work, does anyone know how to fix this issue?
Work around fix - not the solution to the problem
As for others it seems, i couldn't seem to get this trailing spaces to highlight no matter what i did, so what i did was remove the trailing spaces automatically on save. Not ideal but used to it now, works nicely.
Go to SublimeText 2 > Preferences > User Settings (or just hit the Mac Standard cmd + ,). This should open your User Settings as a JSON file. Add the following to your file
"trim_trailing_white_space_on_save": true
That's it. You're good to go.
I had this problem in Sublime Text 3.
I fixed it by deleting my trailing_spaces.sublime-settings file in the Sublime Text user package settings folder (which for me was %APPDATA%\Sublime Text 3\Packages\User) and reinstalling the plugin.
Some more discussion about this issue can be found on the plugin GitHub page here.
It's a known bug - see their Issues page on GitHub.
I was able to get it working by starting Sublime with a non-blank string value for the setting trailing_spaces_highlight_color
Open Preferences > Package Settings > Trailing Spaces > Settings - User
Replace:
"trailing_spaces_highlight_color": ""
With:
"trailing_spaces_highlight_color": "invalid"
Restart Sublime.
Edit > Trailing Spaces > Highlight Regions should work as expected now.
If you restart Sublime, "trailing_spaces_highlight_color" must not be a blank string, otherwise it will stop working again. Repeat the steps above to fix.
As long as Sublime is started with a non-blank string value for trailing_spaces_highlight_color, the toggle highlight regions works.
It looks like the plugin is caching the value in the setting file when Sublime loads. If you make changes to the settings file and toggle highlighting, the original value is restored. Which is why you need to restart Sublime for setting changes to take effect.

Sublime text 2 search does not work

I have ST2 installed on Win7 and for some reason the global 'Find in Files' (ctrl+shift+f) stopped working (it worked before). Now all i get is :
Searching 0 files for "capbSectionac"
0 matches across 0 files
The regular search in the currently opened file is working correctly.
I tried re-installing it but to no avail :(
Anyone encountered it? Any solution?
Note that it says "Searching 0 files".
In the second field "Where:", make sure you don't have a folder selected. You should see the placeholder text "Open files and folders" which means that it will search in the whole project. If you don't see this placeholder, even if the "Where" field is empty try clicking on the "..." button and then click on "Clear".
source: http://www.sublimetext.com/forum/viewtopic.php?f=3&t=12611
I had the same problem. At some time I noticed that the Where: field (below Find:) didn't show any placeholder text ("Open files and folders"), as it is supposed to when it's empty. It turns out that the Where: field wasn't empty and therefore the search was like happening nowhere. As I cleared this field, the search worked again.
Press ctrl F . then in left side of search bar, enable Wrap. with inverted reload sign
I am new to Sublime Text 3, so when I first tried to use Find In Files (shift+command+y) it yielded nothing but 0 search results.
I brought up Find (command + f) and I noticed alot of spaces before my search term.
I cleared out those extra spaces and left my search term. Brough back up Find In Files and the search worked properly.
I keep having this problem in Unbuntu. The solution I found was just to delete the folder
/home/<user>/.config/sublime-text-2/Packages/User/Package Control.cache
I think this happens because I have file synchronization on save but can't be sure.