Files
.emacs.d/modules/siren-auto-complete.el
Jim Myhrberg c791150a06 Add rewritten config, dubbed emacs-siren
I've taken a lot of inspiration from Emacs-Prelude when it came to the
structure of this rewritten config. I didn't want to use Prelude as I
don't agree with all it's defaults, nor do I want to have to deal with
any future changes in Prelude that might break things for me. So instead
I went down the fully custom path, but heavily inspired by Prelude, both
in terms of file/code structure, and also some of it's features.

Compared to my old config setup, it's got most of the same things, but
nearly everything is in a module file now, making it easy to fully
enable/disable certain features.
2015-10-04 08:56:07 +01:00

33 lines
791 B
EmacsLisp

;;
;; auto-complete
;;
(siren-require-packages '(auto-complete))
(require 'auto-complete)
;; (require 'auto-complete-config)
;; (ac-config-default)
(ac-flyspell-workaround)
(setq ac-auto-show-menu 0.2)
(setq ac-auto-start 3)
(setq ac-delay 0.05)
(setq ac-menu-height 15)
(let ((map ac-completing-map))
(define-key map (kbd "RET") 'ac-complete)
(define-key map (kbd "C-m") 'ac-complete)
(define-key map (kbd "C-s") 'ac-isearch)
(define-key map (kbd "C-n") 'ac-next)
(define-key map (kbd "C-p") 'ac-previous))
;; Auto-complete when indenting.
(defadvice indent-for-tab-command (around ac-before-indent activate)
"Call `auto-complete' if text was recently entered"
(if (ac-trigger-command-p last-command)
(auto-complete)
ad-do-it))
(provide 'siren-auto-complete)