(unless (and (interactive-p)
(yas-expand))
ad-do-it)))))
-
+
(yas-advise-indent-function 'ruby-indent-line)
#+END_SRC
solve this problem, drop a line in the
[[http://groups.google.com/group/smart-snippet][discussion group]].
-* How do I turn off the minor mode where in some buffers
+* How to I use alternative keys, i.e. not TAB?
+
+Edit the keymaps [[sym:yas-minor-mode-map][=yas-minor-mode-map=]] and
+[[sym:yas-keymap][=yas-keymap=]] as you would any other keymap:
+
+#+begin_src emacs-lisp :exports code
+ (define-key yas-minor-mode-map (kbd "<tab>") nil)
+ (define-key yas-minor-mode-map (kbd "TAB") nil)
+ (define-key yas-minor-mode-map (kbd "<the new key>") 'yas-expand)
+
+ ;;keys for navigation
+ (define-key yas-keymap [(tab)] nil)
+ (define-key yas-keymap (kbd "TAB") nil)
+ (define-key yas-keymap [(shift tab)] nil)
+ (define-key yas-keymap [backtab] nil)
+ (define-key yas-keymap (kbd "<new-next-field-key>") 'yas-next-field-or-maybe-expand)
+ (define-key yas-keymap (kbd "<new-prev-field-key>") 'yas-prev)
+#+end_src
+
+* How do I turn off the minor mode where in some buffers?
The best way, since version 0.6.1c, is to set the default value of the
variable [[sym:yas-dont-activate][=yas-dont-activate=]] to a lambda function like so:
** =# key:= snippet abbrev
-This is the probably the most important directive, it's the abbreviation
-you type to expand a snippet just before hitting [[sym:yas-trigger-key][=yas-trigger-key=]]. If
-you don't specify this the snippet will not be expandable through the
-key mechanism.
+This is the probably the most important directive, it's the
+abbreviation you type to expand a snippet just before hitting the key
+that runs [[sym:yas-expand][=yas-expand=]]. If you don't specify this
+the snippet will not be expandable through the trigger mechanism.
** =# name:= snippet name