I usually open each buffer in a separate tab-page (using NERDTree as directory navigator) since I feel more confortable this way.
But NERDTree always open new tab-page after the current one. Is there a way to make NERDTree always open new tab as last one ?
Manually this can be achivied using :$tabmove
command, but I would like to automate this task.
For clearness, I post an example. In the following screenshot I am in NERDTree window with minilexer.py
open in same tab-page #1. verilog_parser.py
in the next one, #2.
Thus having:
Tab page #1: minilexer.py
Tab page #2: verilog_parser.py
Now, if I open vhdl_parser.py
from tab-page #1 (exactly as in the screenshot), the new tab will be placed between #1 and #2, thus having:
Tab page #1: minilexer.py
Tab page #2: vhdl_parser.py
Tab page #3: verilog_parser.py
But I want to be:
Tab page #1: minilexer.py
Tab page #3: verilog_parser.py
Tab page #3: vhdl_parser.py
Always. So the last tab opened should always have tabepagenr('$')
.
In pseudocode should be:
If the buffer does not exists and it's not open in a tab, open it and make the tab the last one ($tabmove
).
I am actually looking for the function that returns the path under the cursor in NERDTree..