Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
(require 'js2-mode)
(add-hook 'js2-mode-hook 'ac-js2-mode)
(defun my-underscore-require ()
(interactive)
(insert (format "var _ = require('underscore');"))
)
(defun js2-mode-hooks ()
(font-lock-add-keywords nil
'(("^[^\n]\\{80\\}\\(.*\\)$" 1 font-lock-warning-face t)))
(local-set-key (kbd "C-x c j") 'my-underscore-require)
)
(add-hook 'js2-mode-hook 'js2-mode-hooks)
(custom-set-variables
'(js2-basic-offset 2)
)
(add-to-list 'auto-mode-alist '("\\.js$" . js2-mode))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment