Here is what is happening:
- I open one file, either with
oin NERDTree or with:edit file_a. - I open another file, again with
oin NERDTree or with:edit file_b, and the file opens at the same window asfile_a(no problem with that). - Then, I do
:bwor:bdand Vim exits.
I found that this is NERDTree. If I run vim by
vim -u NONE -U NONE -N
then when I open two files on the same window and I use :bd or :bw, Vim is not exiting and only the buffer that I choose to delete or wipe closes.
But, when I install NERDTree, then when I have again two buffers on the same window and I close one (with either :bd or :bw) the window closes and only NERDTree window stays open.
This is with plain NERDTree. No extra settings.
My .vimrc file is:
set nocompatible
filetype plugin indent on
call plug#begin('~/.vim/plugged')
Plug 'scrooloose/nerdtree'
call plug#end()
nocompatibleit's enabled by default when you have a vimrc. It the issue comes from nerdtree you'll be better off reporting it on their issue tracker and you'll be even better off without using NERDTree which is the main source of bugs in a config, I recommend reading this – statox Jul 03 '20 at 15:15But you gave me good information, thank you very much!
– Xxxo Jul 03 '20 at 15:32bd/bwat all? Why not, say,bn/bp/ctrl-^? It really looks as a strange idea to me an attempt to delete a buffer while you're going to switch to another one. – Matt Jul 03 '20 at 15:51