Create a gist now

Instantly share code, notes, and snippets.

@strobe /tags.el
Last active May 19, 2017

What would you like to do?
ensime ctags config for spacemacs
;; ensime - etags-select (see: http://ensime.org/editors/emacs/hacks/#tags
;; and for .ctags config https://gist.github.com/salomvary/3372e9cd40f5b09a928b)
(defun ensime-edit-definition-with-fallback ()
"Variant of `ensime-edit-definition' with ctags if ENSIME is not available."
(interactive)
(unless (and (ensime-connection-or-nil)
(ensime-edit-definition nil))
(projectile-find-tag)))
(defun ensime-settings ()
(bind-key "M-." 'ensime-edit-definition-with-fallback ensime-mode-map)
(bind-key "<s-mouse-1>" 'ensime-edit-definition-with-fallback ensime-mode-map))
(add-hook 'ensime-mode-hook 'ensime-settings)
;; ctags for non ensime modes
(global-set-key (kbd "M-.") 'projectile-find-tag)
(global-set-key (kbd "M-,") 'pop-tag-mark)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment