JAVASCRIPT

This commit is contained in:
Ahir Reddy 2014-08-03 23:27:39 -07:00
commit e996890bc2

18
.emacs
View file

@ -2,7 +2,7 @@
(setq package-list '(auctex expand-region gist magit magithub markdown-mode paredit projectile
python sass-mode rainbow-mode scss-mode solarized-theme anything
volatile-highlights evil evil-leader scala-mode2 sbt-mode flx-ido
js2-mode js2-refactor tern tern-auto-complete))
js2-mode js2-refactor tern tern-auto-complete yasnippet auto-complete))
; list the repositories containing them
(setq package-archives '(("elpa" . "http://tromey.com/elpa/")
@ -78,6 +78,22 @@
(setq js2-highlight-level 3)
(add-to-list 'auto-mode-alist '("\\.json$" . js-mode))
;;; yasnippet
;;; should be loaded before auto complete so that they can work together
(require 'yasnippet)
(yas-global-mode 1)
;;; auto complete mod
;;; should be loaded after yasnippet so that they can work together
(require 'auto-complete-config)
(add-to-list 'ac-dictionary-directories "~/.emacs.d/ac-dict")
(ac-config-default)
;;; set the trigger key so that it can work together with yasnippet on tab key,
;;; if the word exists in yasnippet, pressing tab will cause yasnippet to
;;; activate, otherwise, auto-complete will
(ac-set-trigger-key "TAB")
(ac-set-trigger-key "<tab>")
; Tern auto completion, install tern
; sudo npm install -g tern
(add-hook 'js-mode-hook (lambda () (tern-mode t)))