I often take a look at help files in Vim, but sometimes I want to read one in full screen. Since the :help command opens it in a new window, and closing the old window, if it was the only one besides of the help file, for some reason closes Vim, the only way I found of doing this was opening the help file, and then reopening it in a new tab.
I wondered, is there any way to make the :help command (or another command) to open a help file in the same window, but a new buffer?
You might be looking for :only
or CTRL-W o
(the same command). This makes the current window the only one on the screen. All other windows are closed.
You can also vertically split the help window with:
:vert help {subject}
BTW, :help
actually does open in a new buffer, it's just "unlisted". To list all buffers, including the unlisted ones:
:buffers!
If I understand the question correctly, all you need to do is to chain the help command call with the only command:
:help <subject> | only
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With