summaryrefslogtreecommitdiffstats
path: root/.emacs.d/init.org
diff options
context:
space:
mode:
authorGravatar Tom Willemse2013-11-17 11:10:38 +0100
committerGravatar Tom Willemse2013-11-17 11:11:06 +0100
commit911692e53677171579d04f2193fc05e09caf6737 (patch)
tree82e71bee1716edf569dcb8b83acd0f6c0198e0be /.emacs.d/init.org
parent6def92e4e10ba7e87f60af5abf95321b639ee351 (diff)
downloademacs-911692e53677171579d04f2193fc05e09caf6737.tar.gz
emacs-911692e53677171579d04f2193fc05e09caf6737.zip
Use ternjs for javascript development
Diffstat (limited to '.emacs.d/init.org')
-rw-r--r--.emacs.d/init.org24
1 files changed, 24 insertions, 0 deletions
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