;;一个snippet插件可以自定义模板, http://code.google.com/p/yasnippet/
(add-to-list 'load-path
"D:/Lvan/emacs_plugin/yasnippet-0.6.1c")
(require 'yasnippet)
(yas/initialize)
(yas/load-directory "D:/Lvan/emacs_plugin/yasnippet-0.6.1c/snippets")
;;自动完成插件, http://www.emacswiki.org/emacs/AutoComplete
(require 'auto-complete)
(require 'auto-complete-config)
(global-auto-complete-mode t)
(setq-default ac-sources '(ac-source-words-in-same-mode-buffers))
(add-hook 'emacs-lisp-mode-hook (lambda () (add-to-list 'ac-sources 'ac-source-symbols)))
(add-hook 'auto-complete-mode-hook (lambda () (add-to-list 'ac-sources 'ac-source-filename)))
(set-face-background 'ac-candidate-face "lightgray")
(set-face-underline 'ac-candidate-face "darkgray")
(set-face-background 'ac-selection-face "steelblue") ;;; 设置比上面截图中更好看的背景颜色
(define-key ac-completing-map "/M-n" 'ac-next) ;;; 列表中通过按M-n来向下移动
(define-key ac-completing-map "/M-p" 'ac-previous)
(setq ac-auto-start 2)
(setq ac-dwim t)
(define-key ac-mode-map (kbd "M-TAB") 'auto-complete)
我的Emacs配置
最新推荐文章于 2024-11-01 16:17:24 发布