I'm creating a Vim plugin that I need intercept when a new buffer is loaded.
The basic idea consists in when I open a new buffer this new buffer must be screened on another tab, and the previous tab must keep the previous buffer loaded.
Eg.: I have a buffer with the foo.txt
, when I try to open bar.txt
with :e bar.txt
It will open in a new tab and the previous tab must stay with the foo.txt
. I know that :tabe bar.txt
does the job, but to my plugin I need the "tabe
behavior" even when it's not used to open a file.
Does anyone have any idea how to do this with Vimscript?
The reason behind this: https://github.com/vim-ctrlspace/vim-ctrlspace/issues/177.