Documentation
Commentary
Basic steps to setup:
(add-to-list 'load-path
"~/path-to-yasnippet")
(require 'yasnippet)
(yas-global-mode 1)
Interesting variables are:
`yas-snippet-dirs'
The directory where user-created snippets are to be
stored. Can also be a list of directories. In that case,
when used for bulk (re)loading of snippets (at startup or
via `yas-reload-all'), directories appearing earlier in
the list override other dir's snippets. Also, the first
directory is taken as the default for storing the user's
new snippets.
The deprecated `yas/root-directory' aliases this variable
for backward-compatibility.
Major commands are:
M-x yas-expand
Try to expand snippets before point. In `yas-minor-mode',
this is normally bound to TAB, but you can customize it in
`yas-minor-mode-map'.
M-x yas-load-directory
Prompts you for a directory hierarchy of snippets to load.
M-x yas-activate-extra-mode
Prompts you for an extra mode to add snippets for in the
current buffer.
M-x yas-insert-snippet
Prompts you for possible snippet expansion if that is
possible according to buffer-local and snippet-local
expansion conditions. With prefix argument, ignore these
conditions.
M-x yas-visit-snippet-file
Prompts you for possible snippet expansions like
`yas-insert-snippet', but instead of expanding it, takes
you directly to the snippet definition's file, if it
exists.
M-x yas-new-snippet
Lets you create a new snippet file in the correct
subdirectory of `yas-snippet-dirs', according to the
active major mode.
M-x yas-load-snippet-buffer
When editing a snippet, this loads the snippet. This is
bound to "C-c C-c" while in the `snippet-mode' editing
mode.
M-x yas-tryout-snippet
When editing a snippet, this opens a new empty buffer,
sets it to the appropriate major mode and inserts the
snippet there, so you can see what it looks like. This is
bound to "C-c C-t" while in `snippet-mode'.
M-x yas-describe-tables
Lists known snippets in a separate buffer. User is
prompted as to whether only the currently active tables
are to be displayed, or all the tables for all major
modes.
If you have `dropdown-list' installed, you can optionally use it
as the preferred "prompting method", putting in your .emacs file,
for example:
(require 'dropdown-list)
(setq yas-prompt-functions '(yas-dropdown-prompt
yas-ido-prompt
yas-completing-prompt))
Also check out the customization group
M-x customize-group RET yasnippet RET
If you use the customization group to set variables
`yas-snippet-dirs' or `yas-global-mode', make sure the path to
"yasnippet.el" is present in the `load-path' *before* the
`custom-set-variables' is executed in your .emacs file.
For more information and detailed usage, refer to the project page:
http://github.com/joaotavora/yasnippet
Requires
Dependencies
Consumers
Reverse Dependencies
- sublime
- ac-clang
- ac-dcd
- ajc-java-complete
- angular-snippets
- auto-complete-auctex
- auto-yasnippet
- boogie-friends
- buster-snippets
- clj-refactor
- clojure-snippets
- common-lisp-snippets
- company-auctex
- company-dcd
- datomic-snippets
- dix
- django-mode
- docbook-snippets
- eclim
- el-autoyas
- elixir-yasnippets
- elpy
- ensime
- extend-dnd
- go-snippets
- haskell-snippets
- helm-c-yasnippet
- irony
- java-snippets
- jonprl-mode
- js2-refactor
- mallard-snippets
- meghanada
- minitest
- namelist-mode
- nand2tetris
- nsis-mode
- one-key
- pig-mode
- processing-mode
- r-autoyas
- react-snippets
- requirejs
- rspec-mode
- sclang-snippets
- stan-mode
- textmate-to-yas
- vala-snippets
- yankpad
- yatemplate
- awk-it
- company-coq
- auto-complete-acr
- fstar-mode
- yasnippet-snippets
- elpygen
- vertica-snippets
- aws-snippets
- anything
- ivy-yasnippet
- php-auto-yasnippets
- pyramid
- vdm-mode
- jupyter
- ac-php
- yasnippet-lean
- pony-snippets
- js-react-redux-yasnippets
- lsp-mode
- competitive-programming-snippets
- ptemplate
- license-snippets
- gitignore-snippets
- frontside-javascript
- ue
- consult-yasnippet
- cardano-tx
- py-snippets
- related-files
- haskell-tng-mode
- abs-mode
- lsp-bridge
- awk-yasnippets
- gpr-yasnippets
- yasnippet-capf
- verilog-ext
- template-dumper
- ansible
- magik-mode
- aider
- magik-company
- ai-code