Vim “fake fullscreen”: open split windows in a new tab

Since I use a lot of split windows in Vim, for example when exploring the git log or editing closely related files, a pattern I noticed is I often want to make one of the smaller windows full screen momentarily so I can read more at once without scrolling and then close it when I’m done. I made a really simple mapping to simulate this “full screen” idea:

:nnoremap <Leader>f :tabe %<CR>

This opens the current window’s buffer in a new tab (fake full screen ?) and when I close it I’m back to tab one with my split windows.

To demonstrate, here’s a gif in which I inspect the git blame for a file, open a patch and then open it “full screen” in a new tab:

Vim fake fullscreen demo gif

Vim fake fullscreen demo gif


Browsing the git log isn’t the best example because fugitive’s blame window already has an O mapping which opens the patch in a tab instead of a split and the necessity for this would be clearer with bigger files like those I edit at work.

This is one of the few things I use tabs for since I’m mostly jumping through buffers. Hopefully it’s useful for you too!