3

Is there a way to have emacs open up, say, 3 tabs, upon start up ?

I am tired of all the time having to open them manually and then split window also.

I would like to automate this via setting in my init.el file.

Maybe someone can help?

2 Answers 2

4

You could use desktop-save for this. Start Emacs and manually set up the window configuration that you want (e.g. call M-x split-window-right twice, followed by C-x +). Then do M-x desktop-save and choose some directory to store the .emacs.desktop file (for example "~").

Then in your init file put (desktop-read "~") (or the directory that you chose previously) followed by (global-tab-line-mode) (or (tab-bar-mode) if you prefer that functionality) to open Emacs with tabs and your preferred window configuration.

2
  • thanks I wlll try that. whats the difference between tab-line-mode and tab-bar-mode?
    – CD86
    Commented Nov 11, 2022 at 15:39
  • I don't use tabs myself, so I can only refer you to the documentation of tab-bar-mode and tab-line-mode. If the documentation does not clarify things, then you could consider to posting another question here on SE. A very quick look, gave me the idea that tab-bar-mode is more for 'project-wise' tabs, and global-tab-line-mode is more like traditional tabs (but I might be wrong). Commented Nov 11, 2022 at 16:33
3

In your init file, you can add code to make the window configuration the way you want. Say, three windows, equally balanced:

(split-window-right)
(split-window-right)
(balance-windows)
1
  • In this case this would indeed be the (even) more straightforward solution (followed by the tab-...-mode line of course). Commented Nov 19, 2022 at 8:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.