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:
parent
4d3683eb4a
commit
d3c2c17ff9
10 changed files with 141 additions and 57 deletions
30
08ctags.el
Normal file
30
08ctags.el
Normal 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)
|
||||
Loading…
Add table
Add a link
Reference in a new issue