Skip to content


Subversion checkout URL

You can clone with
Download ZIP
a collection of yasnippet snippets for many languages
Groff Emacs Lisp Python C HTML
Latest commit 56a9f62 @AndreaCrotti Merge pull request #104 from AndreaCrotti/javascript_function_style
Generate idiomatic anonymous functions
Failed to load latest commit information.
antlr-mode remove all user entries
applescript-mode Split text snippets into prog and fundamental
c++-mode c++-mode/cout: surround `\n' with double quote
c-mode Deleted fopen snippet from c-mode
cc-mode Added doxygen snippets to cc-mode
chef-mode added machine for chef-provisioning
clojure-mode import a few clojure and elixir snippets
cmake-mode added add_library add_executable for cmake mode
conf-unix-mode remove all user entries
cperl-mode Bring cperl-mode back from yasnippet 0.8.0
cpp-omnet-mode remove all user entries
csharp-mode Replace some legacy usage of 'text' with 'yas-text'
css-mode remove incorrect use of binding: directive
elixir-mode import a few clojure and elixir snippets
emacs-lisp-mode Snippets for ert tests.
erc-mode remove all user entries
erlang-mode add a whole bunch of snippets taken from other people
f90-mode Remove redundant/identical snippets
fundamental-mode remove snippets in fundamdental-mode, leaving the directory just to not
git-commit-mode magit-log-edit-mode obsoleted by git-commit-mode
go-mode Remove trailing newline
groovy-mode Split text snippets into prog and fundamental
haskell-mode new snippet `efix`
html-mode Add html5 doctype
java-mode few more improvements
js-mode closes #101
latex-mode latex-mode: add enumerate and improve itemize
lisp-interaction-mode remove a few contributor settings
lisp-mode Adding a few lisp snippets
lua-mode remove a few contributor settings
m4-mode remove all user entries
makefile-automake-mode remove a few contributor settings
makefile-bsdmake-mode remove all user entries
makefile-gmake-mode Add shell snippet for makefile-gmake-mode
makefile-mode Move clean snippet to `makefile-mode`
malabar-mode few java snippets
markdown-mode add highlight snippet for markdown-mode, jekyll
ned-mode Split text snippets into prog and fundamental
nesc-mode closes issue #20 removing empty snippets
nsis-mode Split text snippets into prog and fundamental
nxml-mode massive cleanup of very simple tags that don't add much value anyway
octave-mode remove all user entries
org-mode fixes #69
perl-mode Bring perl-mode back from yasnippet 0.8.0
prog-mode prog-mode/fixme: disable on sh-mode
python-mode Fixed class snippet name
rst-mode Split text snippets into prog and fundamental
ruby-mode add map and reduce
scala-mode remove snippets provided by ENSIME
sh-mode Use portable version of bash shebang
snippet-mode Give a useful body to snippet-mode/cont(ributor)
snippets/ruby-mode/definitions Add `mod` snippet to ruby-mode for `module` definitions
sql-mode Split text snippets into prog and fundamental
text-mode Split text snippets into prog and fundamental
tuareg-mode Split text snippets into prog and fundamental
udev-mode add a js-mode directory and more python scripts
yaml-mode Split text snippets into prog and fundamental
.nosearch Create .nosearch
CONTRIBUTORS.txt add contributors file
LICENSE Update LICENSE update docs fixes #100
cider-repl-mode new link
enh-ruby-mode add enhanced-ruby-mode alias
ensime-mode new pythoon
js2-mode use a symlink instead of yas-parents for equivalent modes remove .yasnippet extension
typerex-mode fixes #29

Yasnippet official snippet collections

Join the chat at This repository contains the official snippets for yasnippet, as you can see from the git submodules link.

How to install

There are two options, if you have checked out yasnippet already, the only thing you need to do is to run git submodule update --init and it will checkout automatically this repository, at the last version it was synchronized too.

Otherwise if you want the latest and greatest snippets collection proceed as follows:

  1. clone this repository
  2. add to your .emacs the following

    • (add-to-list 'yas-snippet-dirs "$$DIRECTORY_WHERE_YOU_CLONED")
    • and in case you want to enable yasnippet globally: (yas-global-mode t)
  3. M-x yas-reload-all to activate them


This repository has now become the default snippets repository (as a submodule) in yasnippet. So if you have any useful snippets for any language or framework please feel free to contribute.

To study the current snippets I suggest to use M-x yas-describe-tables which will gave a table representation of all the snippets available in the current mode.


Snippets need to be generic enough to be useful for everyone, and not contain anything specific to your own system.

Various notes

HTML snippets

Until September 1st 2014 there were a lot of HTML snippets in the repository, which were sometimes useful but I came to the conclusion that yasnippet was not the right fool for them, so they were removed in this pull request:

To everyone writing a lot of HTML I suggest using emmet mode instead, which is a much more powerful mode for writing HTML tags.

Something went wrong with that request. Please try again.