When I use C-x 2/3
to open a new window in Emacs, I usually want to do something in the other window, such as shell, open a buffer or visit a new file, but I always change into the other window manually. Is there a way(maybe defun
a new function in .emacs
, but I'm new to Emacs) that I can switch my point into the other window immediately after C-x 2/3
just like when you open a new tab and switch to it immediately in a browser???
Asked
Active
Viewed 107 times
2

CodyChan
- 1,776
- 22
- 35
1 Answers
3
How about just wrapping the function using something like this:
(defun my-split-window-below ()
(interactive)
(let ((win (split-window-below)))
(set-frame-selected-window (selected-frame) win)))
You could also do defadvice
on split-window-below
using after
, and have it select the window, but I'm not sure that it's a better solution.

assem
- 2,077
- 1
- 19
- 24