Skip to content

Instantly share code, notes, and snippets.

@mkhl
Created April 2, 2009 22:51
Show Gist options
  • Save mkhl/89546 to your computer and use it in GitHub Desktop.
Save mkhl/89546 to your computer and use it in GitHub Desktop.
Disable yasnippet expansion when in indentation
(eval-after-load "yasnippet-bundle"
'(defadvice yas/expand (around mkhl-yas/expand-or-indent)
(let ((in-indentation? (looking-back (rx bol (0+ blank)))))
(if in-indentation?
(funcall (or (lookup-key (current-local-map) yas/trigger-key)
(lookup-key (current-global-map) yas/trigger-key)))
ad-do-it))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment