-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Always opening NERDTree in current window and reuse instance #244
Comments
I would really like this feature. Any ideas on how to accomplish this? |
Every time NERDTree creates an instance via the NERDTreeHijackNetrw function is assigns it a unique buffer name i.e. So instead of editing the NERDTree source, I just created a mapping that looks like this:
Hope this helps. |
I like this feature too! |
Hi, I have added a simple proof of concept for this in this branch: https://github.com/scrooloose/nerdtree/tree/reuse-win-tree Try it out and let me know how you get on :) |
@PhilRunninger any thoughts on this? It seems like The Right Way (TM) to go - at least in theory. |
Hmm, I cant reproduce this :-/ Can you give any more info about it? |
It happens on the I added a new commit to fix it, but I don't know if I did it the correct way. |
I still cant reproduce this. Vimscript is awesome! But I've merged it back into master (with your fix). Thanks for testing/feedback :-) I've been using nerdtree with |
This is awesome. Any tips on how to do the same with NerdTreeFind ? |
In a multi-window workflow, it's often desirable to make NERDTree to work in the current window instead of its side window. See issue preservim#244 for brief discussion. Currently it's possible to use `:e <dir>` to achieve this for `:NERDTree` command; but there are no workarounds for other functions like opening bookmark, toggling nerdtree, finding current file, etc. This commit adds an option to render NERDTree in current window instead of side window, and modifies all relevant commands to respect the option.
@juanibiapina hjdivad/dotfiles@f030f34 might be close enough to want you want. It relies on a mapping (in my case You can likely tweak it according to your preferences. |
I've actually rewritten most of NerdTree to work with splits properly: https://github.com/juanibiapina/vim-lighttree |
I read http://vimcasts.org/blog/2013/01/oil-and-vinegar-split-windows-and-project-drawer/ and as Drew says you can add
let NERDTreeHijackNetrw=1
and NERDTree will open up in the current window if I do:e .
. However it seems to be a new instance of NERDTree every time it's opened because it does not remember which folders I had open before like it does if I run:NERDTreeToggle
. Is it possible to have both? Have NERDTree open in the current window and remember where it was (reuse the same instance)?The text was updated successfully, but these errors were encountered: