auto-complte.el導入
Emacs auto-completeの設定 - cloverrose's blog
ただの備忘録であり、オリジナリティは皆無です。
というか、ネットが遅くてELPA使うのが頗る面倒なので、submoduleを使った導入をやりたかった。
$ cd ~/.emacs.d $ git submodule add git://github.com/auto-complete/auto-complete.git elisp/auto-complete # auto-completeをgit-submoduleで追加 $ cd elisp/auto-complete # auto-complete自体もgit-submoduleを使って管理を行なっています # auto-complete/libの下にert, popup, fuzzyが入っています # これらを取得する $ git submodule init $ git submodule update $ make byte-compile # .elをバイトコンパイル
(defvar rootpath (expand-file-name "~/.emacs.d")) (setq load-path (cons (concat rootpath "/elisp")load-path)) ;; submodule関連 (defvar elisp-package-dir (concat rootpath "/elisp")) (defun submodule (dir) (push (format "%s/%s" elisp-package-dir dir) load-path)) (defun require-submodule (name &optional dir) (push (format "%s/%s" elisp-package-dir (if (null dir) name dir)) load-path) (require name)) ;;;; auto-complete ;; 基本設定 (submodule "auto-complete") (require-submodule 'popup "auto-complete/lib/popup") (require-submodule 'fuzzy "auto-complete/lib/fuzzy") (require 'auto-complete-config) (defvar ac-dictionary-directories "~/.emacs.d/elisp/auto-complete/dict" ) (ac-config-default) ;; カスタマイズ (setq ac-auto-start 2) ;; n文字以上の単語の時に補完を開始 (setq ac-delay 0.05) ;; n秒後に補完開始 (setq ac-use-fuzzy t) ;; 曖昧マッチ有効 (setq ac-use-comphist t) ;; 補完推測機能有効 (setq ac-auto-show-menu 0.05) ;; n秒後に補完メニューを表示 (setq ac-quick-help-delay 0.5) ;; n秒後にクイックヘルプを表示 (setq ac-ignore-case nil) ;; 大文字・小文字を区別する ;; auto-complete の候補に日本語を含む単語が含まれないようにする ;; http://d.hatena.ne.jp/IMAKADO/20090813/1250130343 (defadvice ac-word-candidates (after remove-word-contain-japanese activate) (let ((contain-japanese (lambda (s) (string-match (rx (category japanese)) s)))) (setq ad-return-value (remove-if contain-japanese ad-return-value))))
pythonからのauto-complete
Pythonの補完をEmacsでシンプルに最小労力で手早く使えるようにする - 牌語備忘録 - pygo
ac-python.el
;;auto-completeの設定のあとに書く (require 'ac-python) ;; この設定しないとpython-modeで自動的にauto-completeが起動しない (add-to-list 'ac-modes 'python-2-mode)