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?

phils
  • 50,977
  • 3
  • 79
  • 122
CD86
  • 563
  • 2
  • 11

2 Answers2

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.

dalanicolai
  • 7,795
  • 8
  • 24
  • thanks I wlll try that. whats the difference between tab-line-mode and tab-bar-mode? – CD86 Nov 11 '22 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). – dalanicolai Nov 11 '22 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)
zck
  • 9,092
  • 2
  • 33
  • 65
  • In this case this would indeed be the (even) more straightforward solution (followed by the tab-...-mode line of course). – dalanicolai Nov 19 '22 at 08:11