Created
September 24, 2010 17:01
-
-
Save Kanasansoft/595678 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;;from http://www.emacswiki.org/emacs/AutoComplete | |
(require 'auto-complete) | |
(require 'yasnippet) | |
(defun ac-yasnippet-candidate () | |
(let ((table (yas/get-snippet-tables major-mode))) | |
(if table | |
(let (candidates (list)) | |
(mapcar (lambda (mode) | |
(maphash (lambda (key value) | |
(push key candidates)) | |
(yas/snippet-table-hash mode))) | |
table) | |
(all-completions ac-prefix candidates))))) | |
(defface ac-yasnippet-candidate-face | |
'((t (:background "sandybrown" :foreground "black"))) | |
"Face for yasnippet candidate.") | |
(defface ac-yasnippet-selection-face | |
'((t (:background "coral3" :foreground "white"))) | |
"Face for the yasnippet selected candidate.") | |
(defvar ac-source-yasnippet | |
'((candidates . ac-yasnippet-candidate) | |
(action . yas/expand) | |
(limit . 3) | |
(candidate-face . ac-yasnippet-candidate-face) | |
(selection-face . ac-yasnippet-selection-face)) | |
"Source for Yasnippet.") | |
(provide 'auto-complete-yasnippet) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment