我在ubuntu中配置了emacs 的自動補全,現在碰到一個問題,在出現自動補全的時候,光標在有字符的地方會閃爍,在沒有字符或者空白處無法看到光標,請問怎麼讓光標都在空白處也顯示
下面的是我自動補全的配置
;; yasnippet
(add-to-list 'load-path "~/.emacs.d/yasnippet-0.6.1c")
(require 'yasnippet);; not yasnippet-bundle
(yas/initialize)
(yas/global-mode 1)
(yas/minor-mode-on)
(yas/load-directory "~/.emacs.d/yasnippet-0.6.1c/snippets")
;;(load-file "~/.emacs.d/yasnippet-bundle.el")
;;f3 為查找字符串,alt+f3 關閉當前緩沖區
(global-set-key [f3] 'grep)
(global-set-key [M-f3] 'kill-buffer-and-window)
;;auto-complete
(add-to-list 'load-path "~/.emacs.d/auto-complete-1.3.1")
;(require 'auto-complete)
(require 'auto-complete-config)
(add-to-list 'ac-dictionary-directories "~/.emacs.d/auto-complete-1.3.1/dict")
(ac-config-default)
(global-auto-complete-mode t)
(setq-default ac-sources '(ac-source-words-in-same-mode-buffers))
(setq-default ac-sources '(ac-source-yasnippet
ac-source-semantic
ac-source-ropemacs
ac-source-imenu
ac-source-functions
ac-source-symbols
ac-source-features
ac-source-dictionary
ac-source-abbrev
ac-source-words-in-buffer
ac-source-files-in-current-dir
ac-source-filename))
(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)))
;;下面這句是從auto-complete-config.el中翻出來的
;;加上這句,在python中輸入類的 . 就可以提示裡面的方法了
(add-hook 'python-mode-hook (lambda () (add-to-list 'ac-omni-completion-sources (cons "\." '(ac-source-ropemacs))) ))
(set-face-background 'ac-candidate-face "lightgray")
(set-face-underline 'ac-candidate-face "darkgray")
(set-face-background 'ac-selection-face "steelblue")
(setq ac-auto-start 2)
(setq ac-dwim t)
解決的辦法是在.emacs 中添加這個 並修改yasnippet的配置,具體如下:
;; 設置光標不閃
(blink-cursor-mode 1)
;;設置光標為線條狀
(setq-default cursor-type 'bar)
;; yasnippet
(add-to-list 'load-path "~/.emacs.d/yasnippet-0.6.1c")
(require 'yasnippet);; not yasnippet-bundle
(yas/initialize)
;;(yas/global-mode 1)
;;(yas/minor-mode-on)
(yas/load-directory "~/.emacs.d/yasnippet-0.6.1c/snippets")
;;(load-file "~/.emacs.d/yasnippet-bundle.el")
(require 'dropdown-list)
(setq yas/prompt-functions '(yas/dropdown-prompt
yas/ido-prompt
yas/completing-prompt))