vim-nerdtree-tabs
vim-nerdtree-tabs copied to clipboard
Opening a file in background resets cursor position
If i open a file in a tab but keeps focus (shortcut T in NERDTree) the cursor goes back to top. It's annoying because i often open many files like this.
I just spent some time on this. Sadly, Vim doesn't fire TabEnter event when switching back to the original tab after the new tab is set up, so I can't call the view restoration method in the original tab. Not really sure how to tackle this now, but I'm leaving it open for pull requests.
NERDtree can do it on it's own -- I assume that's because it does not open a new NERDtree tab. Perhaps the solution is to only open a new nerdtree tab window when the tab is actually selected?
This might make it more responsive too -- if I have multiple tabs open I can see NERDtree open in each tab sequentially, and I can take a second or two. I have this plugin activated by toggling <TAB> (nerdtree is configured to close on TAB, also)
NERDtree can do it on it's own -- I assume that's because it does not open a new NERDtree tab. Perhaps the solution is to only open a new nerdtree tab window when the tab is actually selected?
Hmm might be... If we can distinguish between "this tab was selected because NERDTree is opening a new file in it" and "this tab was was selected because user switched to it manually", then it might be a solution.
This might make it more responsive too -- if I have multiple tabs open I can see NERDTree open in each tab sequentially, and I can take a second or two.
Yeah this variant was discussed a already for possibility of speed improvements for users who open/close NERDTree a lot. The speed of nerdtree toggle would increase, but speed of tab switching would decrease, since you would open/close NERDTree upon tab switch. FTR - the speed of toggling was discussed in #3 (and improved a bit), and then resubmitted as #33.
I'm open to have vim-nerdtree-tabs refactored into the lazy-toggling mode, if it doesn't break other stuff. Open for pull requests :)
sorry to trouble, but now.. any progress of this issue.. how should I record last cursor position..
thanks for the smart plugin :)
regards.
interested as well ! Just curious, @jistr if you dont use nerdtree anymore, what do you use instead ?
@lpyparmentier Heh i use emacs :). The experience with vim scripting was one of the reasons to make the switch. Considering scripting power and plugin robustness, vim and emacs don't even play in the same league. To be fair, emacs' ergonomy is pretty bad. I had to remap the keyboard on all my computers to (hopefully) prevent emacs-induced RSI :).