Skip to content

Instantly share code, notes, and snippets.

@iambibhas
Last active April 8, 2026 18:20
Show Gist options
  • Select an option

  • Save iambibhas/4705378 to your computer and use it in GitHub Desktop.

Select an option

Save iambibhas/4705378 to your computer and use it in GitHub Desktop.
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
@kingRayhan

Copy link
Copy Markdown

Thanks you very much

@awakekat

Copy link
Copy Markdown

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

Copy link
Copy Markdown

@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

Copy link
Copy Markdown

Thank You!

@kingRayhan

Copy link
Copy Markdown

Thanks you 😄

@chenshengzhi

Copy link
Copy Markdown

Thanks you 😄

@iahu

iahu commented Mar 28, 2016

Copy link
Copy Markdown

very useful list

@jamiecalder

Copy link
Copy Markdown

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

fro commented Apr 21, 2016

Copy link
Copy Markdown

Thank you, this is so useful.

@prabhath6

Copy link
Copy Markdown

Thanks for the list.

@victorpolko

Copy link
Copy Markdown

@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.

@ngrok-add

Copy link
Copy Markdown

There are $ symbol how to solve?

@jwt625

jwt625 commented Feb 5, 2017

Copy link
Copy Markdown

Thanks, very useful!

@raj015

raj015 commented Apr 15, 2017

Copy link
Copy Markdown

how to add scope for multiple file types

@jeffbruce

Copy link
Copy Markdown

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

fhightower commented Jul 23, 2017

Copy link
Copy Markdown

Assembly: source.assembly

@summer87279149

Copy link
Copy Markdown

what's the javascript es6 scope?
image

@coderblower

Copy link
Copy Markdown

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

@faridcher

faridcher commented Sep 22, 2017

Copy link
Copy Markdown

@jeffreysbrother

Copy link
Copy Markdown

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

@microrony

Copy link
Copy Markdown

Thank you so much...

@moshiurshimul

Copy link
Copy Markdown

Thanks for all the scopes.

@raineorshine

Copy link
Copy Markdown

Inline React (i.e. via Babel):

meta.jsx.js

@wout

wout commented Feb 2, 2020

Copy link
Copy Markdown

For Crystal apps:

source.crystal

@AkramElOmrani

Copy link
Copy Markdown

This is so cool

I am not sure why Cplusplus is c++ instead of c++ but ok

@bokunodev

Copy link
Copy Markdown

for arduino .ino files
source.c++.arduino

@lpdmm0416

Copy link
Copy Markdown

Hi is the scope for SAS (instead of SASS): source.sas (instead of sass?). Thanks.

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