Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Open sessions, restore graphical tabs (gvim, windows)

Tags:

vim

session

I use gvim and work in tabs. For example, I have 3 tabs open when I :mksession. When I later source it, the files will "open" in buffers, as they are visible in the buffers menu, but it doesn't recreate the tabs.

Looking at the example session.vim, it runs badd for every file, but I can't see anything that creates new tabs. I tried putting au BufAdd * tabnew in my vimrc, but it didn't work as expected.

My .vimrc
Example session.vim

sessionoptions="blank,buffers,curdir,folds,help,resize,tabpages,winsize"

like image 901
jjt Avatar asked Dec 05 '25 16:12

jjt


1 Answers

Sometimes the exact right combination of Google search terms will get it for you...

:au BufAdd,BufNewFile * nested tab sball

http://vim.wikia.com/wiki/Open_every_buffer_in_its_own_tabpage

edit: This au command causes Netrw to open a new tab for each directory you browse. A workaround is to run :tab sball after opening a session.

like image 141
jjt Avatar answered Dec 08 '25 10:12

jjt