Chinaunix首页 | 论坛 | 博客
  • 博客访问: 979310
  • 博文数量: 109
  • 博客积分: 554
  • 博客等级: 中士
  • 技术积分: 2577
  • 用 户 组: 普通用户
  • 注册时间: 2010-03-04 12:49
文章分类

全部博文(109)

文章存档

2019年(5)

2016年(7)

2015年(9)

2014年(1)

2013年(71)

2012年(16)

分类: 嵌入式

2013-05-16 23:07:07

(require 'auto-complete)
(add-to-list 'ac-dictionary-directories "~/.emacs.d/plugins/auto-complete-1.3.1/dict")
(require 'auto-complete-config)
(ac-config-default)
;;(require 'init-auto-complete)

;;set face
(set-face-background 'ac-candidate-face "lightgray")
(set-face-underline 'ac-candidate-face "darkgray")
(set-face-background 'ac-selection-face "steelblue")

;; Ignore case if completion target string doesn't include upper characters
;; (setq ac-ignore-case 'smart)

(global-auto-complete-mode t)           ;enable global-mode
(setq ac-auto-start t)                  ;automatically start
(setq ac-dwim t)                        ;Do what i mean
(setq ac-override-local-map t)        ;don't override local map

;; if you want enable auto-complete at org-mode, uncomment this line
;; (add-to-list 'ac-trigger-commands 'org-self-insert-command)


(defun ac-cmake-mode-setup ()
  (setq ac-sources (append '(ac-source-yasnippet  ac-source-dictionary) ac-sources)))
(add-hook 'cmake-mode-hook 'ac-cmake-mode-setup)

;;use C-n/C-p to select candidates
(define-key ac-complete-mode-map "\M-n" 'ac-next)
(define-key ac-complete-mode-map "\M-p" 'ac-previous)
(define-key ac-complete-mode-map "\t" 'ac-complete)
(define-key ac-complete-mode-map "\r" nil)

(setq ac-auto-start nil)
(define-key ac-mode-map "\M-j" 'auto-complete)



阅读(4090) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~