Emacs Lisp Yasnippet Templates

Perm url with updates: http://xahlee.org/emacs/elisp_idiom_templates.html

Yasnippet Templates for Emacs Lisp Mode

Xah Lee, 2009-02-24, ..., 2011-01-11

This pages is a set of abbrev and YASnippet templates for emacs lisp coders.

emacs-lisp-mode Abbrevs

The abbrev list contains ~78 most frequently used elisp functions. For example:

  • “add-hook” has abbrev “ah”.
  • “search-forward” has abbrev “sf”.
  • “thing-at-point” has abbrev “tap”.
  • “defun” has abbrev “d”.

Each abbrev is based on first letters of the words in function names.

If you are not familiar with emacs's abbrev feature, see: Using Emacs's Abbrev Mode for Abbreviation.

YASnippets Templates for emacs-lisp-mode

The YASnippet are for expanding function names to its full syntax and parameters. It contains ~145 of most frequently used elisp functions.

For example, type buffer-substring-no-properties , press Tab, then it becomes (buffer-substring-no-properties START▮ END). Here's a picture of more examples, when used together with abbrev:

bsnp ▮
  ⇓
buffer-substring-no-properties▮
  ⇓
(buffer-substring-no-properties START▮ END)

Another example:

sfr ▮
  ⇓
search-forward-regexp▮
  ⇓
(search-forward-regexp "▮" &optional BOUND NOERROR COUNT)

If you are not familiar with yasnippet, see: Emacs Templates with YASnippet.

Download

Download the templates for $5. In the comment field, put “elisp templates”. I'll email you the download link. Make sure your email address is included and correct.

Popular posts from this blog

11 Years of Writing About Emacs

does md5 creates more randomness?

Google Code shutting down, future of ErgoEmacs