Skip to content

Instantly share code, notes, and snippets.

@kawaguchi
Created December 9, 2008 07:48
Show Gist options
  • Save kawaguchi/33833 to your computer and use it in GitHub Desktop.
Save kawaguchi/33833 to your computer and use it in GitHub Desktop.
;; js2-mode
(autoload 'js2-mode "js2" nil t)
(add-to-list 'auto-mode-alist '("\\.js$" . js2-mode))
(add-hook 'js2-mode-hook
'(lambda ()
(setq js2-cleanup-whitespace nil
js2-mirror-mode nil
js2-bounce-indent-flag nil)
(defun indent-and-back-to-indentation ()
(interactive)
(indent-for-tab-command)
(let ((point-of-indentation
(save-excursion
(back-to-indentation)
(point))))
(skip-chars-forward "\s " point-of-indentation)))
(define-key js2-mode-map "\C-i" 'indent-and-back-to-indentation)
(define-key js2-mode-map "\C-m" nil)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment