Skip to content

Instantly share code, notes, and snippets.

@shigemk2
Created April 11, 2015 16:06
Show Gist options
  • Save shigemk2/674926a5f692cc924b88 to your computer and use it in GitHub Desktop.
Save shigemk2/674926a5f692cc924b88 to your computer and use it in GitHub Desktop.
(require 'js2-mode)
(add-hook 'js2-mode-hook 'ac-js2-mode)
(defun js2-mode-hooks ()
(font-lock-add-keywords nil
'(("^[^\n]\\{80\\}\\(.*\\)$" 1 font-lock-warning-face t)))
(defun underscore-require ()
(interactive)
(insert (format "var _ = require('underscore');"))
)
(local-set-key (kbd "C-x c j") '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