2014-07-17 02:59:23 -04:00
|
|
|
(require-packages
|
|
|
|
'(auto-complete ; self-explanity
|
|
|
|
auto-complete-config ; its default config
|
|
|
|
))
|
|
|
|
|
2014-07-24 01:25:08 -04:00
|
|
|
(setq ac-auto-show-menu nil ; Suggestions box must be invoked manually (see core-keymaps.el)
|
|
|
|
ac-use-menu-map t ; Enable ac-menu-map map when menu is open
|
|
|
|
ac-us-quick-help nil ; Don't show tooltips unless invoked (see core-keymaps.el)
|
|
|
|
ac-fuzzy-cursor-color nil)
|
2014-07-21 03:52:01 -04:00
|
|
|
|
|
|
|
;; Keep auto-complete quiet until it's needed (see core-keymaps.el)
|
2014-07-24 01:25:08 -04:00
|
|
|
(setq ac-auto-start 2)
|
2014-07-17 02:59:23 -04:00
|
|
|
|
|
|
|
(ac-config-default)
|
2014-07-20 09:17:43 -04:00
|
|
|
(ac-linum-workaround) ; Fix line number flux bug
|
2014-07-21 03:52:01 -04:00
|
|
|
(ac-flyspell-workaround) ; Compatibility with flyspell/make
|
2014-07-20 09:17:43 -04:00
|
|
|
(diminish 'auto-complete-mode) ; Hide mode-line entry
|
2014-07-21 03:52:01 -04:00
|
|
|
|
2014-07-22 23:24:02 -04:00
|
|
|
(add-to-list 'ac-dictionary-files "~/.emacs.d/ac-dict/global")
|
|
|
|
(add-to-list 'ac-dictionary-directories "~/.emacs.d/ac-dict")
|
|
|
|
|
2014-07-21 03:52:01 -04:00
|
|
|
;; Use more vim-like keymappings
|
2014-07-24 01:25:08 -04:00
|
|
|
(add-hook 'change-major-mode-hook
|
|
|
|
(lambda () (evil-define-key 'insert ac-mode-map (kbd "C-SPC") 'auto-complete)))
|
|
|
|
|
|
|
|
(evil-define-key 'insert ac-mode-map (kbd "C-S-SPC") 'auto-complete)
|
|
|
|
(define-key ac-completing-map (kbd "<tab>") 'ac-expand)
|
|
|
|
(define-key ac-completing-map (kbd "C-n") 'ac-next)
|
|
|
|
(define-key ac-completing-map (kbd "C-p") 'ac-previous)
|
2014-07-21 03:52:01 -04:00
|
|
|
(define-key ac-completing-map (kbd "<F1>") 'ac-quick-help)
|
|
|
|
(define-key ac-completing-map (kbd "ESC") 'ac-stop)
|
2014-07-24 01:25:08 -04:00
|
|
|
(define-key ac-completing-map [return] nil)
|
2014-07-17 02:59:23 -04:00
|
|
|
|
|
|
|
(add-hook 'prog-mode-hook 'enable-path-completion)
|
|
|
|
|
|
|
|
(defun enable-path-completion ()
|
2014-07-21 03:52:01 -04:00
|
|
|
(add-to-list 'ac-sources 'ac-source-filename)
|
|
|
|
(add-to-list 'ac-sources 'ac-source-files-in-current-dir))
|
2014-07-17 02:59:23 -04:00
|
|
|
|
|
|
|
;; Tell ido not to care about case
|
|
|
|
(setq completion-ignore-case t)
|
|
|
|
|
|
|
|
;;
|
|
|
|
(provide 'mod-ac)
|