From 8922442a7409bba0fcc4a8948bafee961f40dcda Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Fri, 28 Apr 2017 10:44:05 +0200 Subject: Emacs: Setup js2-refactor-mode --- emacs/.emacs.d/init.org | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) (limited to 'emacs') diff --git a/emacs/.emacs.d/init.org b/emacs/.emacs.d/init.org index 1bbfa68..38d572b 100644 --- a/emacs/.emacs.d/init.org +++ b/emacs/.emacs.d/init.org @@ -2020,9 +2020,7 @@ And add ensime, an IDE-style environment. *** js2-mode This mode is really great for editing Javascript. It turns code into -an AST internally, so it can work with it almost like a lisp. I don’t -think there’s anything as good as paredit/redshank for refactoring in -it though +an AST internally, so it can work with it almost like a lisp. #+BEGIN_SRC emacs-lisp (use-package js2-mode @@ -2049,6 +2047,18 @@ it though js2-highlight-level 1))) #+END_SRC +**** js2-refactor + +Thanks to the AST provided by js2-mode, refactoring is possible. This +library implements some refactorings. + +#+BEGIN_SRC emacs-lisp +(use-package js2-refactor + :config (progn + (add-hook 'js2-mode-hook #'js2-refactor-mode) + (js2r-add-keybindings-with-prefix "C-c C-m"))) +#+END_SRC + **** jade (not pug) Javascript with an inferior node.js process and a debugger? Awesome. -- cgit 1.4.1