diff options
author | David Morgan <djm_uk@protonmail.com> | 2022-06-15 12:32:55 +0100 |
---|---|---|
committer | David Morgan <djm_uk@protonmail.com> | 2022-06-15 12:32:55 +0100 |
commit | 75fb2d87b3d493434e214c58d9a94db57b105737 (patch) | |
tree | 6a9bc877028c19356a940ba5f6da87fec7f0079a /.emacs.d/lisp | |
parent | f3d0b2a1b6581b8b1b3a99c67c18583f2c2b52a8 (diff) | |
download | dotfiles-75fb2d87b3d493434e214c58d9a94db57b105737.tar.gz |
Add xref-find-references-other-window
Diffstat (limited to '.emacs.d/lisp')
-rw-r--r-- | .emacs.d/lisp/init-editor.el | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/.emacs.d/lisp/init-editor.el b/.emacs.d/lisp/init-editor.el index e5aac71..a1ce514 100644 --- a/.emacs.d/lisp/init-editor.el +++ b/.emacs.d/lisp/init-editor.el @@ -193,10 +193,16 @@ and file 'filename' will be opened and cursor set on line 'linenumber'" (use-package xref :ensure nil :config + (defun xref-find-references-other-window (identifier) + "Like `xref-find-references' but switch to the other window" + (interactive (list (xref--read-identifier "Find references of: "))) + (xref--find-xrefs identifier 'references identifier 'window)) + (define-key ctl-x-4-map (kbd "M-?") 'xref-find-references-other-window) ;; 'xref-prompt-for-identifier begins with not, so adding this prevents ;; prompting for an identifier when calling xref-find-references, unless ;; there is no value at point that can be used - (add-to-list 'xref-prompt-for-identifier 'xref-find-references t)) + (add-to-list 'xref-prompt-for-identifier 'xref-find-references t) + (add-to-list 'xref-prompt-for-identifier 'xref-find-references-other-window t)) (provide 'init-editor) ;;; init-editor.el ends here |