晚上花了一个小时配置了一下 lsp-mode, company, company-lsp , 配置文件在: https://www.emacswiki.org/emacs/init-company-mode.el
怕折腾的同学可以参考一下.
Python LSP 服务端的安装方法:
- conda info --envs
- source activate python36
- sudo pip install ‘python-language-server[all]’
Ruby LSP 服务端的安装方法:
- sudo gem install solargraph
- Add gem ‘solargraph’ in Gemfile, then execute command “bundler update” in ruby project
Mac 用户安装 exec-path-from-shell ( https://raw.githubusercontent.com/purcell/exec-path-from-shell/master/exec-path-from-shell.el ) , 避免 LSP 各种抱怨找不到 server 的二进制程序:
(when (featurep 'cocoa)
(require 'exec-path-from-shell)
(exec-path-from-shell-initialize))
Company 参考主题:
(custom-set-faces
'(company-preview ((t (:background "gold3" :foreground "black"))))
'(company-preview-common ((t (:background "gold3" :foreground "grey20"))))
'(company-preview-search ((t (:background "green4" :foreground "green"))))
'(company-scrollbar-bg ((t (:background "#303030"))))
'(company-scrollbar-fg ((t (:background "#404040"))))
'(company-tooltip ((t (:background "#202020" :foreground "grey"))))
'(company-tooltip-annotation ((t (:foreground "gold"))))
'(company-tooltip-annotation-selection ((t (:foreground "white"))))
'(company-tooltip-common ((t (:inherit company-tooltip :foreground "white"))))
'(company-tooltip-common-selection ((t (:foreground "white"))))
'(company-tooltip-selection ((t (:background "red3" :foreground "white"))))
)