Improve ctags and company configuration

Set ctags command based on major mode
Set different company backends based on major mode
Completely abandon robe in favour of ctags for Ruby
Set up Erlang configuration
This commit is contained in:
Maciej 2019-04-08 11:23:36 +03:00
parent 4d3683eb4a
commit d3c2c17ff9
Signed by: maciej
GPG key ID: 41D62D42D3B0D765
10 changed files with 141 additions and 57 deletions

44
20erlang.el Normal file
View file

@ -0,0 +1,44 @@
;; Add erlang installation to load path
(setq erlang-asdf-root "/Users/maciej/.asdf/installs/erlang/21.2.6/")
(setq load-path
(cons (format "%slib/tools-3.0.2/emacs" erlang-asdf-root)
load-path))
(require 'erlang-start)
(setq erlang-root-dir erlang-asdf-root)
(setq exec-path (cons (format "%sbin" erlang-asdf-root) exec-path))
(setq erlang-man-root-dir (format "%sman" erlang-asdf-root))
;; Flycheck checker for Erlang
(flycheck-define-checker erlang-otp
"An Erlang syntax checker using the Erlang interpreter."
:command ("erlc" "-o" temporary-directory "-Wall"
"-I" "../include" "-I" "../../include"
"-I" "../../../include" source)
:error-patterns
((warning line-start (file-name) ":" line ": Warning:" (message) line-end)
(error line-start (file-name) ":" line ": " (message) line-end))
:modes (erlang-mode))
(defun activate-erlang-mode ()
"All things for Erlang."
(flycheck-select-checker 'erlang-otp)
;; Set specific ctags command
(setq-local
ctags-refresh-command
(format
"ctags -e -R --languages=erlang -f %sTAGS %s. %slib/stdlib-* %slib/kernel-*"
(projectile-project-root) (projectile-project-root)
erlang-asdf-root erlang-asdf-root)
(add-to-list (make-local-variable 'company-backends)
'(company-etags company-yasnippet))
)
;; Company list override
(add-to-list (make-local-variable 'company-backends) 'company-etags))
(add-hook 'erlang-mode-hook 'activate-erlang-mode)