如何在分割缓冲区中生成jedi:goto-definition open definition

时间:2013-05-15 12:04:25

标签: emacs

jedi:goto-definition运行得非常好,但它在我正在编辑的同一个缓冲区中打开定义。对于查找引用,如果它在分割窗格中打开函数的定义,那将更好。将光标保持在原位。

有一种简单的方法吗?

1 个答案:

答案 0 :(得分:1)

您可以建议jedi:goto-definition,以便Emacs在运行jedi:goto-definition之前拆分帧,然后返回缓冲区。

(defadvice jedi:goto-definition (around definition-in-other-window activate)
  "Goto definition in a different window."
  (interactive)
  ;; remove any current frame splits
  (delete-other-windows)
  ;; split the frame vertically
  (split-window-right)
  ;; switch focus to the window on the right
  (other-window 1)
  ad-do-it
  ;; switch back to the window on the left
  (other-window 1))