2017-03-15 22:44:42 -04:00
|
|
|
;;; feature/jump/config.el
|
|
|
|
|
|
|
|
;; "What am I looking at?"
|
|
|
|
;;
|
|
|
|
;; This module helps you answer that question. It helps you look up whatever
|
2017-05-21 15:06:15 +02:00
|
|
|
;; you're looking at.
|
2017-03-15 22:44:42 -04:00
|
|
|
;;
|
2017-05-21 15:06:15 +02:00
|
|
|
;; + `+jump/definition': a jump-to-definition that should 'just work'
|
|
|
|
;; + `+jump/references': find a symbol's references in the current project
|
|
|
|
;; + `+jump/online'; look up a symbol on online resources, like stackoverflow,
|
|
|
|
;; devdocs.io or google.
|
|
|
|
;;
|
|
|
|
;; This module uses `xref', an experimental new library in Emacs. It may change
|
|
|
|
;; in the future. When xref can't be depended on it will fall back to
|
|
|
|
;; `dumb-jump' to find what you want.
|
2017-03-15 22:44:42 -04:00
|
|
|
|
2017-05-15 20:44:08 +02:00
|
|
|
(defvar +jump-search-url-alist
|
|
|
|
'(("Google" . "https://google.com/search?q=%s")
|
2017-03-15 22:44:42 -04:00
|
|
|
("DuckDuckGo" . "https://duckduckgo.com/?q=%s")
|
|
|
|
("DevDocs.io" . "http://devdocs.io/#q=%s")
|
|
|
|
("StackOverflow" . "https://stackoverflow.com/search?q=%s"))
|
2017-05-21 15:06:15 +02:00
|
|
|
"An alist that maps online resources to their search url or a function that
|
|
|
|
produces an url. Used by `+jump/online'.")
|
2017-03-15 22:44:42 -04:00
|
|
|
|
|
|
|
(def-setting! :xref-backend (mode function)
|
|
|
|
"TODO"
|
|
|
|
`(add-hook! ,mode
|
2017-04-17 02:17:10 -04:00
|
|
|
(add-hook 'xref-backend-functions #',function nil t)))
|
2017-03-15 22:44:42 -04:00
|
|
|
|
2017-05-21 15:06:15 +02:00
|
|
|
(set! :popup "*xref*" :noselect t :autokill t :autoclose t)
|
|
|
|
|
|
|
|
;; Let me control what backends to fall back on
|
|
|
|
(setq-default xref-backend-functions '(t))
|
|
|
|
|
2017-03-15 22:44:42 -04:00
|
|
|
;; Recenter after certain jumps
|
|
|
|
(add-hook!
|
2017-05-10 08:41:13 +02:00
|
|
|
'(imenu-after-jump-hook evil-jumps-post-jump-hook counsel-grep-post-action-hook)
|
2017-03-15 22:44:42 -04:00
|
|
|
'recenter)
|
|
|
|
|
|
|
|
|
|
|
|
;;
|
|
|
|
;; Packages
|
|
|
|
;;
|
|
|
|
|
|
|
|
(def-package! dumb-jump
|
|
|
|
:commands (dumb-jump-go dumb-jump-quick-look dumb-jump-back)
|
|
|
|
:config
|
2017-05-21 15:06:15 +02:00
|
|
|
(setq dumb-jump-default-project doom-emacs-dir
|
|
|
|
dumb-jump-selector (cond ((featurep! :completion ivy) 'ivy)
|
|
|
|
((featurep! :completion helm) 'helm)
|
|
|
|
(t 'popup))))
|
2017-05-21 14:11:52 +02:00
|
|
|
|
|
|
|
|
|
|
|
(def-package! gxref
|
|
|
|
:commands (gxref-xref-backend
|
|
|
|
gxref-create-db
|
|
|
|
gxref-update-db
|
|
|
|
gxref-single-update-db
|
|
|
|
gxref-set-project-dir)
|
|
|
|
:init
|
|
|
|
(setq-default xref-backend-functions '(gxref-xref-backend t)))
|
2017-03-15 22:44:42 -04:00
|
|
|
|
|
|
|
|
|
|
|
;; (def-package! ggtags
|
|
|
|
;; :commands (ggtags-find-tag-dwim
|
|
|
|
;; ggtags-find-tag-mouse
|
|
|
|
;; ggtags-find-definition
|
|
|
|
;; ggtags-find-reference
|
|
|
|
;; ggtags-find-other-symbol
|
|
|
|
;; ggtags-find-tag-regexp
|
|
|
|
;; ggtags-idutils-query
|
|
|
|
;; ggtags-grep
|
|
|
|
;; ggtags-find-file
|
|
|
|
;; ggtags-query-replace
|
|
|
|
;; ggtags-delete-tags
|
|
|
|
;; ggtags-explain-tags))
|
|
|
|
|