如何使 Emacs 始终在左侧窗口中打开 .c 文件,而在右侧窗口中打开 .h 文件?
我在编写C代码时总是打开三个窗口,如下所示:
|
| 2
1 |_____
|
| 3
|
窗口1用于代码编写,窗口2用于cscope,窗口3用于头文件快速引用。
当我按 cscope 窗口显示源代码时,我希望 Emacs 始终在窗口 1 中显示 .c 文件,而在窗口 3 中显示 .h 文件,有什么可能的解决方案吗?
非常感谢您的回复。
I always open three windows when writing C code like this:
|
| 2
1 |_____
|
| 3
|
Window 1 is used for code writing, window 2 is used for cscope, and window 3 is used for header file quick reference.
When I press in cscope window to show source, I want Emacs to display .c files always in window 1 while .h files in window 3, is there any possible solution?
Many thanks for your reply.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
看看 类似问题的答案。 关键是使用变量:
special-display -正则表达式
。 这几乎是一个嵌入式解决方案,只需您根据扩展名选择窗口(而不是不选择窗口)。Take a look at the answer to a similar question. The key is to use the variable:
special-display-regexps
. It's nearly a drop-in solution, only you choose the window based on the extension (as opposed to not choosing a window).