Skip to content

Instantly share code, notes, and snippets.

@terrycojones
Created May 6, 2012 02:05
Show Gist options
  • Save terrycojones/2607055 to your computer and use it in GitHub Desktop.
Save terrycojones/2607055 to your computer and use it in GitHub Desktop.
(if (and
(boundp 'i-use-js2-mode)
i-use-js2-mode)
(progn
(require 'js-comint)
(setq-default js2-basic-offset 4)
(setq
js2-enter-indents-newline t
js2-consistent-level-indent-inner-bracket-p t
js2-pretty-multiline-decl-indentation-p t
inferior-js-program-command "/usr/bin/rhino"
js2-electric-keys '()
js2-auto-indent-flag nil)
(add-hook 'js2-mode-hook
'(lambda ()
(require 'js2-highlight-vars)
(if (featurep 'js2-highlight-vars)
(js2-highlight-vars-mode))
(local-set-key "\C-x\C-e" 'js-send-last-sexp)
(local-set-key "\C-\M-x" 'js-send-last-sexp-and-go)
(local-set-key "\C-cb" 'js-send-buffer)
(local-set-key "\C-c\C-b" 'js-send-buffer-and-go)
(local-set-key "\C-cl" 'js-load-file-and-go)))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment