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

30
08ctags.el Normal file
View file

@ -0,0 +1,30 @@
;; Do not mix ctags between folders
(setq tags-add-tables nil)
;; Sentinel function for capturing ctags
(defun ctags-process-callback (process event)
"Show status of asynchronous ctags-process after it finishes."
(cond
((string-equal event "finished\n")
(message "Creating tag files...completed")
(kill-buffer (get-buffer "*ctags*"))
(visit-tags-table (format "%sTAGS" (projectile-project-root))))
(t
(message "Creating tags file...failed")
(pop-to-buffer (get-buffer "*ctags*"))
)))
(setq ctags-refresh-command
(format "ctags -e -R -f %sTAGS %s."
(projectile-project-root) (projectile-project-root)))
(defun refresh-ctags ()
"Refresh ctags according to currently set command."
(interactive)
(message "Starting ctags process")
(start-process-shell-command "ctags" "*ctags*" ctags-refresh-command)
(set-process-sentinel (get-process "ctags") 'ctags-process-callback))
;; Ctags bindings
(define-key prog-mode-map (kbd "C-c E") 'refresh-ctags)