I really want to use emacs as a Javascript IDE. I have followed all the directions I can, includings Yasnippets
and Autocomplete
, but I still have some issues.
If you look at the differences, in Jedi
the auto-completion and pop-up window appears almost right away in Python files. In my javascript, the only words that appear for autocorrect are those that previously appear (and they are not in a drop-down window) not even function (see attached).
I have loaded external libraries and it looks like everything works, does any body have advice here?
Here is my .emacs
;; js2 mode
(add-hook 'js-mode-hook 'js2-minor-mode)
(add-hook 'js-mode-hook 'ac-js2-mode)
(setq js2-highlight-level 3)
(add-to-list 'auto-mode-alist (cons (rx ".js" eos) 'js2-mode))
(add-to-list 'auto-mode-alist '("\\.json$" . js2-mode))
;; yasnippit
;; load before auto complete
(require 'yasnippet)
(setq yas-snippet-dirs
'("~/.emacs.d/snippets/javascript-mode"
"~/.emacs.d/snippets/js-yasnippets"
))
(yas-global-mode 1)
;; autocomplete mode
(require 'auto-complete-config)
(add-to-list 'ac-dictionary-directories "~/.emacs.d/ac-dict")
(add-to-list 'ac-sources 'ac-source-yasnippet)
(ac-config-default)
(ac-set-trigger-key "TAB")
(ac-set-trigger-key "<tab>")
;; use spaces instead of tabs
(setq-default indent-tabs-mode nil)