gpt4 book ai didi

emacs - Emacs如何自动跳转到新创建的缓冲区/窗口

转载 作者:行者123 更新时间:2023-12-04 00:00:33 31 4
gpt4 key购买 nike

在编译时,发生搜索,grep搜索等,Emacs会在单独的窗口中创建一个新的缓冲区来显示结果,有没有自动跳转到那个窗口的方法?这很有用,因为我可以使用 np 而不是 M-g nM-g p 移动到下一个和以前的项目;另外,可以使用 q 快速退出缓冲区。目前我每次运行这些命令时都手动切换到新缓冲区,这很烦人。谢谢。

最佳答案

您可以使用建议。

例如跳转到 grep 缓冲区使用以下建议:

(defadvice compilation-start (after compilation-start-maximize activate)
(when (equal mode 'grep-mode)
(switch-to-buffer "*grep*")
;; you may want to maximize the buffer
(delete-other-windows)))

对于发生你可以使用以下建议

(defadvice occur-1 (after occur-maximize activate)
(other-window 1))

关于emacs - Emacs如何自动跳转到新创建的缓冲区/窗口,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13676462/

31 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com