- Download http://yasnippet.googlecode.com/files/yasnippet-0.5.5.tar.bz2 and unpack it as ~/elisp/snippets.
- Download http://yasnippet.googlecode.com/files/yasnippet-bundle-0.5.5.el.tgz and unpack it as ~/elisp/yasnippet-bundle.el .
- Symlink lisp-interaction-mode to emacs-lisp-mode with the command
ln -s ~/elisp/snippets/emacs-lisp-mode ~/elisp/snippets/lisp-interaction-mode
- Add the following lines to ~/.emacs
(require 'yasnippet-bundle) (yas/initialize) (yas/load-directory "~/elisp/snippets") ;; I don't like using partial words for completion (setq yas/key-syntaxes '("w_" "w_." "^ "))
(defun sacha/drupal-module-name () "Return the Drupal module name for .module and .install files." (file-name-sans-extension (file-name-nondirectory (buffer-file-name))))I can make templates like this one for hook_user. Sweet!
- 06 August 2008 at 3:08pm
- Drupal, Emacs, and templates: Module update functions | sacha chua :: enterprise 2.0 consultant, storyteller, geek 25 November 2008 at 12:11am
- things to look at (November 20th - November 24th) | stimulant - changing things around. . .
[...] been using yasnippet for my Emacs templates. All I needed to do to automate that ...
[...] Yet another snippet mode for Emacs | sacha chua :: enterprise 2.0 consultant, ...