1

I'm currently exploring ways to iterate through all buffers in vim, and confused by behavior of NERDTree. I displayed NERDTree directory tree and expected that the viewport is bound to some buffer. By conrast the :ls command did not show the buffer that is diplayed in the NERDTree's viewport:

enter image description here

Does the viewport NERDTree displays directory tree on bound to some buffer? If no, how does NERDTree display the content?

2

NERDTree does a great many things that are... unvim-like... in order to give the IDE “project drawer” experience. I consider most of them hacks, and I’m wary of a plugin which has to hack around default behaviors and usages to do something I don’t need (see Oil and Vinegar).

All of that said, one of its hacks is actually quite normal—it’s an unlisted buffer (I believe). You can check the 'buftype' option, or use :ls!.

Netrw actually does similar things most of the time, regarding unlisting buffers. It’s convenient not to have “non-file” buffers not appear in the regular buffer list.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.