Sublime Forum

Separate library of Emmet snippets

#1

In the hope of creating a separate library of snippets/abbreviations, I went to Preferences > Package Settings > Emmet > Settings - User (C:\Users…\AppData\Roaming\Sublime Text 2\Packages\User\Emmet.sublime-settings) and added this:

{
“extensions_path”: “~/emmet/ksdol”
}

and Ctrl + S to save it.

Then I manually created a ksdol (C:\Users…\AppData\Roaming\Sublime Text 2\Packages\Emmet\emmet\ksdol) subdirectory and copied snipets.json in it. That copy was reduced to

{
“variables”: {

},

"css": {
	"filters": "css",
	"profile": "css",
	"snippets": {
	}
},

"html": {
	"filters": "html",
	"profile": "html",
	"snippets": {
		
	},
	
	"abbreviations": {
		"html:xsjs":  "!!!xs+doc4[xmlns=http://www.w3.org/1999/xhtml xml:lang=${lang}]"
	}
}

}

and Ctrl + S to save it.

Ctrl + Shift + P to select Emmet: Reload Extensions, closed and opened Sublime, and Ctrl + E on html:xsjs and ended up with html:xsjs</html:xsjs>. docs.emmet.io/customization/snippets/'s first sentence might be what I am looking for except I have no idea where/what the ‘extensions folder’ is. I am missing something or is the whole approach is wrong?

0 Likes

#2

bump

0 Likes

#3

Hopefully this helps, took me awhile to figure this out myself.

1,
I created an ‘extensions’ folder here:
C:\Users\username\AppData\Roaming\Sublime Text 3\Packages\emmet-sublime\emmet\extensions
You could put this folder anywhere you like as long as you know how to set the path to it.

2,
C:\Users\username\AppData\Roaming\Sublime Text 3\Packages\User\Emmet.sublime-settings - in this file (i may have created it) I had to change the path as such:

{ "extensions_path": "~/AppData/Roaming/Sublime Text 3/Packages/emmet-sublime/emmet/extensions" }
The ~ in the path represents the home folder of your OS (if I understand correctly) so that’s the file/folder path up to the username on windows 7.

3,
C:\Users\00\AppData\Roaming\Sublime Text 3\Packages\emmet-sublime\emmet\extensions\snippets.json - now this file is recognized by st3, all I wanted was to change the html profile to xhtml so I can get autocompleted self-closing tags with slashes -
, , etc.

0 Likes