Skip to content

Instantly share code, notes, and snippets.

@anildigital
Created November 26, 2008 12:29
Show Gist options
  • Save anildigital/29376 to your computer and use it in GitHub Desktop.
Save anildigital/29376 to your computer and use it in GitHub Desktop.
(autoload 'js2-mode "js2" nil t)
(add-to-list 'auto-mode-alist '("\\.js$" . js2-mode))
; js2
; (autoload 'js2-mode "js2" nil t)
; (add-to-list 'auto-mode-alist '("\\.js$" . js2-mode))
;
; ; js-shell
; (autoload 'javascript-shell "javascript-mode" nil t)
;
(defun js2-execute-buffer ()
(interactive)
(shell-command (concat "johnson " (buffer-file-name))))
(add-hook 'js2-mode-hook '(lambda ()
(define-key js2-mode-map [A-r] 'js2-execute-buffer)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment