Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to make Emacs always open .c files in the left windows while .h in the right?

Tags:

emacs

cscope

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.

like image 526
ZelluX Avatar asked Nov 21 '25 01:11

ZelluX


1 Answers

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).

like image 160
Trey Jackson Avatar answered Nov 23 '25 23:11

Trey Jackson



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!