程序師世界是廣大編程愛好者互助、分享、學習的平台,程序師世界有你更精彩!
首頁
編程語言
C語言|JAVA編程
Python編程
網頁編程
ASP編程|PHP編程
JSP編程
數據庫知識
MYSQL數據庫|SqlServer數據庫
Oracle數據庫|DB2數據庫
 程式師世界 >> 編程語言 >> 更多編程語言 >> 編程綜合問答 >> emac-Emacs 自動補全 auto-complete yasnippet 光標空白處不顯示

emac-Emacs 自動補全 auto-complete yasnippet 光標空白處不顯示

編輯:編程綜合問答
Emacs 自動補全 auto-complete yasnippet 光標空白處不顯示

我在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))

  1. 上一頁:
  2. 下一頁:
Copyright © 程式師世界 All Rights Reserved