Skip to content

Instantly share code, notes, and snippets.

@kawaguchi
Created December 9, 2008 09:14
Show Gist options
  • Save kawaguchi/33848 to your computer and use it in GitHub Desktop.
Save kawaguchi/33848 to your computer and use it in GitHub Desktop.
;; js2-mode
(when (load "js2")
(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\t" point-of-indentation)))
(define-key js2-mode-map (kbd "C-i") 'indent-and-back-to-indentation)
(define-key js2-mode-map (kbd "C-m") nil)
(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