Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NERDTree conflicts with vim command bd #400

Closed
chaos-dd opened this issue Nov 15, 2014 · 12 comments
Closed

NERDTree conflicts with vim command bd #400

chaos-dd opened this issue Nov 15, 2014 · 12 comments

Comments

@chaos-dd
Copy link

Recently I seem to find a bug of NERDTree.
Here is steps to regenerate the bug.
Open Vim, toggle NERDTree , open more than two file through NERDTree, and than try to close one of the opened file using command bd, the vim exits ! Not only close an opened file.

@alextsits
Copy link

May I ask why this got closed? I have the same issue. When I have NERDTree opened, and issue :bd in another window, bd will close all buffers instead of just one, and vim will exit because I have chosen so (to quit vim if NERDTree is only window left).
If I issue bd with NERDTree closed, only the currently viewed buffer gets deleted, which is what I expect.

Edit: bd seems to not delete all buffers, but instead deleting current buffer and closing the window viewing it, so then the only window left is NERDTree. So vim quits.
This really does not seem to be a bug in NERDTree, so closing this seems a god call.

@darrynten
Copy link

👍 please fix!

@wyntau
Copy link

wyntau commented Jun 8, 2015

same problem, can anyone to fix?

@wyntau
Copy link

wyntau commented Jun 16, 2015

@bleached @darrynten I have the same problem, and i find a solution on StackOverflow

http://stackoverflow.com/questions/1864394/vim-and-nerd-tree-closing-a-buffer-properly

@ecthiender
Copy link

@chaos-dd why did you close the issue? Did you find any fix? If yes, then please share. I'm also having the same problem.

@wyntau
Copy link

wyntau commented Mar 23, 2016

@ecthiender you can have a try the answer I found on StackOverflow. I used long times and it works as expected.

@cyfyifanchen
Copy link

cyfyifanchen commented Aug 11, 2016

ran into same issue, fixed with Treri's link.

@jdhao
Copy link

jdhao commented Oct 9, 2018

After long experiment and search ,finally find this post. For later comers, you can use this mapping in your vim/Nvim config:

nnoremap \d :bp<cr>:bd #<cr>

Simple, but it works well.

@s3cret
Copy link

s3cret commented Nov 9, 2018

Easy and simple fixed with:
noremap <leader>x :bp<cr>:bd #<cr>
From: https://stackoverflow.com/a/16505009/9690756

@s3cret
Copy link

s3cret commented Nov 9, 2018

After long experiment and search ,finally find this post. For later comers, you can use this mapping in your vim/Nvim config:

nnoremap \d :bp<cr>:bd #<cr>

Simple, but it works well.

Sorry, I did not see your comment.
I made a comment below yours and exactly the same as yours.
My bad.

@arbkm22
Copy link

arbkm22 commented Sep 28, 2022

After long experiment and search ,finally find this post. For later comers, you can use this mapping in your vim/Nvim config:

nnoremap \d :bp<cr>:bd #<cr>

Simple, but it works well.

why doesn't this works for me?

@nhejazi
Copy link

nhejazi commented Oct 11, 2022

I'm also having trouble getting the above solution to work

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

10 participants