Note that there are some explanatory texts on larger screens.

plurals
  1. POAbout auto complete and yasnippet in emacs
    primarykey
    data
    text
    <p>I'm using auto-complete and yasnippet in Emacs and I am confused by their settings. I placed the following code in my <code>.emacs</code>:</p> <pre class="lang-lisp prettyprint-override"><code>(add-to-list 'load-path "~/.emacs.d/plugins/yasnippet") (require 'yasnippet) (yas/global-mode 1) (global-set-key (kbd "C-i") 'yas/expand) (setq yas/also-auto-indent-first-line t) (add-to-list 'load-path "~/.emacs.d/plugins/autocomplete/") (require 'auto-complete-config) (add-to-list 'ac-dictionary-directories "~/.emacs.d/plugins/autocomplete/ac-dict") (ac-config-default) (setq ac-use-menu-map t) (define-key ac-menu-map "\C-n" 'ac-next) (define-key ac-menu-map "\C-p" 'ac-previous) (defun ac-js-mode() (setq ac-sources '(ac-source-yasnippet ac-source-symbols ac-source-words-in-buffer ac-source-words-in-same-mode-buffers ac-source-files-in-current-dir ))) (add-hook 'js-mode-hook 'ac-js-mode) </code></pre> <p>I am trying to set yasnippet as the first candidate in the auto-complete popup menu. However, as the example below shows, this doesn't work with my current settings: when I type the word <code>for</code>, <code>formatItem</code> is in first position and <code>for</code> in second. <code>formatItem</code> is just a local function in current buffer.</p> <pre><code> for_____________ |formatItem | |for a| |for s| |force s| |foreachv s| ---------------- </code></pre> <p>So my question is: how can I make yasnippet the first candidate in auto-complete? And is there something missing in my <code>.emacs</code> config?</p> <p>Any help is appreciated.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload