When I invoke Emacs from the shell with the command emacs fileA fileB
, I'd like to have the Emacs window split vertically (i.e. with one file on the left and one file on the right), not horizontally, to show the two buffers. How should I edit my .emacs configuration file?
1 Answer
If you don't care which file goes on the right and which file goes on the left, try the following init file:
(setq inhibit-splash-screen t)
(split-window-horizontally)
And yes: split-window-horizontally
splits it vertically in your terminology :-) Emacs's terminology is different from yours.
-
It works. But now there's a minor annoyance - when I open just one file, with
emacs fileA
from the terminal, the screen is still split into two parts, with one part showing *scratch*. Is there a quick workaround?– felixCommented May 26, 2021 at 20:04 -
I don't think so - in any case, I don't know one and a little investigation was fruitless. You might want to post it as a new question: that might attract some new eyes to it.– NickDCommented May 26, 2021 at 23:53