JS2-mode and Yasnippet

JS2-mode for Emacs is a great mode. But it remaps some keys that makes some behavior change. In my case it changed the TAB key, and thereby disabled Yasnippet. To fix it, I added this to ~/.emacs:

(eval-after-load 'js2-mode
     (define-key js2-mode-map (kbd "TAB") (lambda()
                                            (let ((yas/fallback-behavior 'return-nil))
                                              (unless (yas/expand)
                                                (if (looking-back "^\s*")

blog comments powered by Disqus Back to Top

Fork me on GitHub