1

Here is what is happening:

  1. I open one file, either with o in NERDTree or with :edit file_a.
  2. I open another file, again with o in NERDTree or with :edit file_b, and the file opens at the same window as file_a (no problem with that).
  3. Then, I do :bw or :bd and 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()
Xxxo
  • 187
  • 9
  • 2
    Can you share with us a minimal vimrc which allows you to reproduce this issue? (and have a read here) – statox Jul 03 '20 at 14:56
  • @statox thnx! I will upload. – Xxxo Jul 03 '20 at 14:58
  • 1
    Then it seems that it is my vimrc. I will do the debugging and update my questions. – Xxxo Jul 03 '20 at 15:00
  • Found it.. it is NERDTree – Xxxo Jul 03 '20 at 15:07
  • You don't need nocompatible it'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:15
  • @statox thank you for the pointer, but I posted my question here in case that somebody knows how to solve it. This is my target, to get an answer for this problem. Not to post it to the issue tracker of NERDTree nor to use some other way of doing things. – Xxxo Jul 03 '20 at 15:19
  • 1
    I understand, I pointed you to the issue tracker because it's more likely that the maintainers of the plugin know about the issue and how to solve it rather than people on this site who may or may not use the plugin and may or may not experience the issue. And I recommended getting rid of it because I have seen dozens of questions on this site caused by NERDTree's bugs and I have also used it and been frustrated numerous time before deciding to stop using it. Of course you are free to continue to use it but it's just a friendly advice as someone who has a bit of experience with this plugin :) – statox Jul 03 '20 at 15:27
  • 1
    Thnx! The truth is that I will probably move away from NERDTree... but I want to solve this bug :D

    But you gave me good information, thank you very much!

    – Xxxo Jul 03 '20 at 15:32
  • What's the point of using bd/bw at 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
  • Considering NERDTree, perhaps, it's not a bug but "a feature", sort of "never left me alone". – Matt Jul 03 '20 at 15:57

0 Answers0