From 911692e53677171579d04f2193fc05e09caf6737 Mon Sep 17 00:00:00 2001 From: Tom Willemse Date: Sun, 17 Nov 2013 11:10:38 +0100 Subject: Use ternjs for javascript development --- .emacs.d/init.org | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to '.emacs.d/init.org') diff --git a/.emacs.d/init.org b/.emacs.d/init.org index df9b930..c62a1d2 100644 --- a/.emacs.d/init.org +++ b/.emacs.d/init.org @@ -398,3 +398,27 @@ (global-set-key (kbd "C-c Q") #'delete-other-windows) (global-set-key (kbd "C-c R") #'delete-window) #+END_SRC + +* Use ternjs for javascript development + + Ternjs seems like an interesting project. Add its location to the + =load-path=, autoload it and after it loads setup the auto-complete + functionality. + + #+BEGIN_SRC emacs-lisp + (add-to-list 'load-path "/usr/lib/node_modules/tern/emacs/") + (autoload 'tern-mode "tern" nil t) + + (stante-after tern + (require 'tern-auto-complete) + (tern-ac-setup)) + #+END_SRC + +* Turn on tern for javascript + + Torn on tern when working in =js2-mode=. It adds eldoc-like + functionality and autocompletion. + + #+BEGIN_SRC emacs-lisp + (add-hook 'js2-mode-hook #'tern-mode) + #+END_SRC -- cgit v1.2.3-54-g00ecf