Ubuntu 下配置Emacs下的go語言插件

灬猜想灬 12年前發布 | 3K 次閱讀 Dockerfile 軟件工匠 汽車之家

首先安裝Emacs

sudo apt-get install emacs

然后進入Emacs的插件目錄,配置go語言語法插件

cd /usr/share/emacs/site-lisp

ln -s $GOROOT/misc/emacs/go-mode.el go-mode.el

ln -s $GOROOT/misc/emacs/go-mode-load.el go-mode-load.el</pre>
安裝Emacs的自動補全插件

sudo apt-get install auto-complete-el

再在用戶HOME目錄下配置.emacs,加入以下內容

;set for syntax highlight
(add-to-list 'load-path "PATH CONTAINING go-mode-load.el" t)
(require 'go-mode-load)

;set for auto complete (require 'go-autocomplete) (require 'auto-complete-config)</pre>
現在使用emacs打開go源文件就可以自動高亮語法顯示和自動補全代碼了.

 本文由用戶 灬猜想灬 自行上傳分享,僅供網友學習交流。所有權歸原作者,若您的權利被侵害,請聯系管理員。
 轉載本站原創文章,請注明出處,并保留原始鏈接、圖片水印。
 本站是一個以用戶分享為主的開源技術平臺,歡迎各類分享!