TL;DR:
I want to avoid split windows and tabs. Is there a way to intercept a split command with an autocommand that translates every window split, including those of plugins, into a simple buffer switch? Instead of splitting the window, I want to open the buffer that would have appeared in the split in the main window, i.e. full-screen.
Longer version:
Because I have low vision and therefore require text to be quite large, split windows don't make sense for my workflow. The split windows themselves become way too small to be usable.
That put me on the quest to set up my (Neo) Vim config such that anything I do could be done from within the main window without any splits.
What has been working well for me is the following autocommand (I'd like to credit the source here, but I sadly don't remember where I got the idea from) which will open every new window - that includes splits - in a new tab.
vim.api.nvim_create_autocmd("WinNew", {
group = "bufcheck",
pattern = "*",
command = "if winnr() != winnr('$') |wincmd T"
})
But what if I want to avoid tabs and instead just switch buffers?
Is there an autocommand that can be triggered before a window is created?
Is there a smarter way to avoid window creation altogether?
Many thanks!
wincmd T
, which opens the current window in a new tab, you have to execute a command that makes the current split/window the only window.