Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
Sublime Text 2: Snippet scopes
Here is a list of scopes to use in Sublime Text 2 snippets -
ActionScript: source.actionscript.2
AppleScript: source.applescript
ASP: source.asp
Batch FIle: source.dosbatch
C#: source.cs
C++: source.c++
Clojure: source.clojure
CoffeeScript: source.coffee
CSS: source.css
D: source.d
Diff: source.diff
Erlang: source.erlang
Go: source.go
GraphViz: source.dot
Groovy: source.groovy
Haskell: source.haskell
HTML: text.html(.basic)
JSP: text.html.jsp
Java: source.java
Java Properties: source.java-props
Java Doc: text.html.javadoc
JSON: source.json
Javascript: source.js
BibTex: source.bibtex
Latex Log: text.log.latex
Latex Memoir: text.tex.latex.memoir
Latex: text.tex.latex
LESS: source.css.less
TeX: text.tex
Lisp: source.lisp
Lua: source.lua
MakeFile: source.makefile
Markdown: text.html.markdown
Multi Markdown: text.html.markdown.multimarkdown
Matlab: source.matlab
Objective-C: source.objc
Objective-C++: source.objc++
OCaml campl4: source.camlp4.ocaml
OCaml: source.ocaml
OCamllex: source.ocamllex
Perl: source.perl
PHP: source.php
Regular Expression(python): source.regexp.python
Python: source.python
R Console: source.r-console
R: source.r
Ruby on Rails: source.ruby.rails
Ruby HAML: text.haml
SQL(Ruby): source.sql.ruby
Regular Expression: source.regexp
RestructuredText: text.restructuredtext
Ruby: source.ruby
SASS: source.sass
Scala: source.scala
Shell Script: source.shell
SQL: source.sql
Stylus: source.stylus
TCL: source.tcl
HTML(TCL): text.html.tcl
Plain text: text.plain
Textile: text.html.textile
XML: text.xml
XSL: text.xml.xsl
YAML: source.yaml
@vlakarados

This comment has been minimized.

Show comment Hide comment
@vlakarados

vlakarados May 3, 2013

Thank you very much, very handy!

Thank you very much, very handy!

@blindside85

This comment has been minimized.

Show comment Hide comment
@blindside85

blindside85 Jun 22, 2013

This is awesome; exactly what I was looking for to help me make better, more targeted snippets :)

This is awesome; exactly what I was looking for to help me make better, more targeted snippets :)

@GuigZ-

This comment has been minimized.

Show comment Hide comment
@GuigZ-

GuigZ- Jul 30, 2013

TPL : text.html

I seek the better syntax ... if you have :)

GuigZ- commented Jul 30, 2013

TPL : text.html

I seek the better syntax ... if you have :)

@chaitan94

This comment has been minimized.

Show comment Hide comment
@chaitan94

chaitan94 Oct 16, 2013

Is it possible to get scope for files without any extensions?

Is it possible to get scope for files without any extensions?

@vlakarados

This comment has been minimized.

Show comment Hide comment
@vlakarados

vlakarados Oct 19, 2013

There is one more that may be handy when making color schemes - text.find-in-files, it's the one that is set to the find in files outputs.

There is one more that may be handy when making color schemes - text.find-in-files, it's the one that is set to the find in files outputs.

@Esteban-Rocha

This comment has been minimized.

Show comment Hide comment
@Esteban-Rocha

Esteban-Rocha Nov 12, 2013

Thank a lot for this, also I know there are very few people who uses PL/SQL on Sublime (way better than Jdeveloper), but there should be "maybe" someone just like me that uses Sublime for Anything and Everything; So there is this plugin called Oracle PL/SQL that will give you some sintax recognition. I had a good pair of snippets and the Scope for the developers that may want to check it out will be:

source.plsql

Hope this results useful for someone.

Thank a lot for this, also I know there are very few people who uses PL/SQL on Sublime (way better than Jdeveloper), but there should be "maybe" someone just like me that uses Sublime for Anything and Everything; So there is this plugin called Oracle PL/SQL that will give you some sintax recognition. I had a good pair of snippets and the Scope for the developers that may want to check it out will be:

source.plsql

Hope this results useful for someone.

@jackcutting

This comment has been minimized.

Show comment Hide comment
@jackcutting

jackcutting Nov 19, 2013

I know there is sass in there, but could you add in scss: source.scss for reference as well?

I know there is sass in there, but could you add in scss: source.scss for reference as well?

@yang-wei

This comment has been minimized.

Show comment Hide comment
@yang-wei

yang-wei Jan 26, 2014

Nice list, mate!

Nice list, mate!

@vace

This comment has been minimized.

Show comment Hide comment
@vace

vace Apr 20, 2014

thank you!

vace commented Apr 20, 2014

thank you!

@G1yn

This comment has been minimized.

Show comment Hide comment
@G1yn

G1yn May 1, 2014

I was struggling with the scope in a snippet and just found this. Thank you!

G1yn commented May 1, 2014

I was struggling with the scope in a snippet and just found this. Thank you!

@austinicomedez

This comment has been minimized.

Show comment Hide comment
@austinicomedez

austinicomedez Jun 23, 2014

Awesome!, thanks

Awesome!, thanks

@hite

This comment has been minimized.

Show comment Hide comment
@hite

hite Aug 6, 2014

FreeMarker or ftl : text.html.ftl

hite commented Aug 6, 2014

FreeMarker or ftl : text.html.ftl

@benbrowning

This comment has been minimized.

Show comment Hide comment
@benbrowning

benbrowning Aug 8, 2014

Very handy!

Very handy!

@xinshangshangxin

This comment has been minimized.

Show comment Hide comment
@xinshangshangxin

xinshangshangxin Sep 20, 2014

thanks

thanks

@lijin305

This comment has been minimized.

Show comment Hide comment
@lijin305

lijin305 Feb 17, 2015

Thanks.

Thanks.

@wzup

This comment has been minimized.

Show comment Hide comment
@wzup

wzup Feb 19, 2015

Twig?
There is HTML(Twig) syntax that Twig plugin provides. What is the scope for it?

wzup commented Feb 19, 2015

Twig?
There is HTML(Twig) syntax that Twig plugin provides. What is the scope for it?

@jdsantiagojr

This comment has been minimized.

Show comment Hide comment
@jdsantiagojr

jdsantiagojr Mar 5, 2015

Thank You!

Thank You!

@raven-chen

This comment has been minimized.

Show comment Hide comment
@raven-chen

raven-chen Mar 30, 2015

Really helpful ! Thanks !

Really helpful ! Thanks !

@JoaoFranciscoNeto

This comment has been minimized.

Show comment Hide comment
@JoaoFranciscoNeto

JoaoFranciscoNeto Apr 12, 2015

PostgreSQL - scope.pgsql

PostgreSQL - scope.pgsql

@maurice-schleussinger

This comment has been minimized.

Show comment Hide comment
@maurice-schleussinger

maurice-schleussinger May 5, 2015

Is there a scope for new files? (I want to trigger a snippet even before I save a new file)

Is there a scope for new files? (I want to trigger a snippet even before I save a new file)

@webglider

This comment has been minimized.

Show comment Hide comment
@webglider

webglider May 8, 2015

Prolog- source.prolog.

Prolog- source.prolog.

@dvogeldev

This comment has been minimized.

Show comment Hide comment
@dvogeldev

dvogeldev May 10, 2015

Nice! Super useful

Nice! Super useful

@Eomerx

This comment has been minimized.

Show comment Hide comment
@Eomerx

Eomerx Jun 12, 2015

great gist, thank you very much.
btw, source.css.less doesn't work for me.
used source.less

Eomerx commented Jun 12, 2015

great gist, thank you very much.
btw, source.css.less doesn't work for me.
used source.less

@tadeobarranco

This comment has been minimized.

Show comment Hide comment
@tadeobarranco

tadeobarranco Jun 16, 2015

Perfect man ... tanks a lot

Perfect man ... tanks a lot

@wonzbak

This comment has been minimized.

Show comment Hide comment
@wonzbak

wonzbak Jul 7, 2015

thanks,

Can you add Twig: text.html.twig

wonzbak commented Jul 7, 2015

thanks,

Can you add Twig: text.html.twig

@projer

This comment has been minimized.

Show comment Hide comment
@projer

projer Jul 24, 2015

Thanks for the list!

projer commented Jul 24, 2015

Thanks for the list!

@yuntas

This comment has been minimized.

Show comment Hide comment
@yuntas

yuntas Sep 7, 2015

Thanks, Mr. @iambibhas.

By the way, How did you know that ?

I wanna make a snippet related to ".Rmd", but there is no your list.

Therefore, I can't use my custom snippet...

yuntas commented Sep 7, 2015

Thanks, Mr. @iambibhas.

By the way, How did you know that ?

I wanna make a snippet related to ".Rmd", but there is no your list.

Therefore, I can't use my custom snippet...

@SandyGifford

This comment has been minimized.

Show comment Hide comment
@SandyGifford

SandyGifford Dec 7, 2015

Thanks for the list,

is it possible to add TypeScript and React support?

.ts, .jsx, .tsx

Thanks for the list,

is it possible to add TypeScript and React support?

.ts, .jsx, .tsx

@fjmarcelo

This comment has been minimized.

Show comment Hide comment
@fjmarcelo

fjmarcelo Dec 12, 2015

Thanks a lot!!!

Thanks a lot!!!

@skube

This comment has been minimized.

Show comment Hide comment
@skube

skube Dec 16, 2015

This is great. ๐Ÿ‘

Also keep in mind you can always check and see (in the status bar) the current scope:

  • Ctrl + Alt + p (Windows and Linux)
  • Command + Option + p (OS X)

skube commented Dec 16, 2015

This is great. ๐Ÿ‘

Also keep in mind you can always check and see (in the status bar) the current scope:

  • Ctrl + Alt + p (Windows and Linux)
  • Command + Option + p (OS X)
@kingRayhan

This comment has been minimized.

Show comment Hide comment
@kingRayhan

kingRayhan Jan 19, 2016

Thanks you very much

Thanks you very much

@awakekat

This comment has been minimized.

Show comment Hide comment
@awakekat

awakekat Feb 11, 2016

How might you be able to have php.scope and have a snippet complete the entire . I opened a php file and hit the Cmd + Option + p and get "embedding.php" but the mini autocomplete popup won't show this source. Any ideas?? Awesome list by the way!!

How might you be able to have php.scope and have a snippet complete the entire . I opened a php file and hit the Cmd + Option + p and get "embedding.php" but the mini autocomplete popup won't show this source. Any ideas?? Awesome list by the way!!

@GarySwift

This comment has been minimized.

Show comment Hide comment
@GarySwift

GarySwift Feb 18, 2016

@awakekat - I could be wrong but it looks like you are using Advanced Custom Fields. If so, this will be helpful, https://github.com/smilledge/acf-sublime-snippets

@awakekat - I could be wrong but it looks like you are using Advanced Custom Fields. If so, this will be helpful, https://github.com/smilledge/acf-sublime-snippets

@IgorGavrilenko

This comment has been minimized.

Show comment Hide comment
@IgorGavrilenko

IgorGavrilenko Feb 18, 2016

Thank You!

Thank You!

@kingRayhan

This comment has been minimized.

Show comment Hide comment
@kingRayhan

kingRayhan Mar 11, 2016

Thanks you ๐Ÿ˜„

Thanks you ๐Ÿ˜„

@chenshengzhi

This comment has been minimized.

Show comment Hide comment
@chenshengzhi

chenshengzhi Mar 24, 2016

Thanks you ๐Ÿ˜„

Thanks you ๐Ÿ˜„

@iahu

This comment has been minimized.

Show comment Hide comment
@iahu

iahu Mar 28, 2016

very useful list

iahu commented Mar 28, 2016

very useful list

@jamiecalder

This comment has been minimized.

Show comment Hide comment
@jamiecalder

jamiecalder Apr 2, 2016

For those who are asking about having the snippets work for all files or for files that have not been saved yet, just leave out the scope, it's optional anyway, and it'll work for all files.

For those who are asking about having the snippets work for all files or for files that have not been saved yet, just leave out the scope, it's optional anyway, and it'll work for all files.

@fro

This comment has been minimized.

Show comment Hide comment
@fro

fro Apr 21, 2016

Thank you, this is so useful.

fro commented Apr 21, 2016

Thank you, this is so useful.

@prabhath6

This comment has been minimized.

Show comment Hide comment
@prabhath6

prabhath6 May 3, 2016

Thanks for the list.

Thanks for the list.

@victorpolko

This comment has been minimized.

Show comment Hide comment
@victorpolko

victorpolko Aug 5, 2016

@pacmanbits, use source.js.jsx for .jsx

I also found that Shift+Ctrl+Alt+P command really shows the current scope under the cursor. Very convenient.

@pacmanbits, use source.js.jsx for .jsx

I also found that Shift+Ctrl+Alt+P command really shows the current scope under the cursor. Very convenient.

@Alien3389

This comment has been minimized.

Show comment Hide comment
@Alien3389

Alien3389 Sep 1, 2016

There are $ symbol how to solve?

There are $ symbol how to solve?

@jwt625

This comment has been minimized.

Show comment Hide comment
@jwt625

jwt625 Feb 5, 2017

Thanks, very useful!

jwt625 commented Feb 5, 2017

Thanks, very useful!

@raj015

This comment has been minimized.

Show comment Hide comment
@raj015

raj015 Apr 15, 2017

how to add scope for multiple file types

raj015 commented Apr 15, 2017

how to add scope for multiple file types

@jeffbruce

This comment has been minimized.

Show comment Hide comment
@jeffbruce

jeffbruce May 12, 2017

How can we extend the valid scope list? I'd particularly like to see .txt and .md added. Can I add my own custom scopes somehow?

How can we extend the valid scope list? I'd particularly like to see .txt and .md added. Can I add my own custom scopes somehow?

@fhightower

This comment has been minimized.

Show comment Hide comment
@fhightower

fhightower Jul 23, 2017

Assembly: source.assembly

fhightower commented Jul 23, 2017

Assembly: source.assembly

@summer87279149

This comment has been minimized.

Show comment Hide comment
@summer87279149

summer87279149 Jul 24, 2017

what's the javascript es6 scope?
image

what's the javascript es6 scope?
image

@coderblower

This comment has been minimized.

Show comment Hide comment
@coderblower

coderblower Sep 13, 2017

If you don't give any scope, Then it will run globally means everywhere you can use particular snippets.

If you don't give any scope, Then it will run globally means everywhere you can use particular snippets.

@faridcher

This comment has been minimized.

Show comment Hide comment

faridcher commented Sep 22, 2017

@jeffreysbrother

This comment has been minimized.

Show comment Hide comment
@jeffreysbrother

jeffreysbrother Dec 29, 2017

Yes. As mentioned above, source.css.less doesn't work. Must be source.less.

Yes. As mentioned above, source.css.less doesn't work. Must be source.less.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment