- Notifications
You must be signed in to change notification settings - Fork130
NERDTree and tabs together in Vim, painlessly
License
jistr/vim-nerdtree-tabs
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
I'm no longer using vim-nerdtree-tabs and i'm no longer maintaining itactively.
In case you forked it and moved the code forward, e.g. by fixing aconsiderable chunk ofthereported issues,let me know and i'll link your fork here.
This plugin aims at making NERDTree feel like a true panel, independent of tabs.
Just one NERDTree, always and ever. It will always look the same inall tabs, including expanded/collapsed nodes, scroll position etc.
Open in all tabs / close in all tabs. Do this via
:NERDTreeTabsToggle
Meaningful tab captions for inactive tabs. No more captions like 'NERD_tree_1'.
When you close a file, the tab closes with it. No NERDTree hanging open.
Autoopen NERDTree on GVim / MacVim startup.
Many of these features can be switched off. See section Configuration.
If you haven't already, install NERDTree (seehttps://github.com/scrooloose/nerdtree)
Install the pluginthrough Pathogen:
cd ~/.vim/bundlegit clone https://github.com/jistr/vim-nerdtree-tabs.git
Orthrough Vundle:
Bundle 'jistr/vim-nerdtree-tabs'
Orthrough Janus:
cd ~/.janusgit clone https://github.com/jistr/vim-nerdtree-tabs.git
Map :NERDTreeTabsToggle command to some combo so you don't have to type it.Alternatively, you can use plug-mapping instead of a command, like this:
map <Leader>n <plug>NERDTreeTabsToggle<CR>
Celebrate.
Vim-nerdtree-tabs provides these commands:
:NERDTreeTabsOpen
switches NERDTree on for all tabs.:NERDTreeTabsClose
switches NERDTree off for all tabs.:NERDTreeTabsToggle
toggles NERDTree on/off for all tabs.:NERDTreeTabsFind
find currently opened file and select it:NERDTreeMirrorOpen
acts as:NERDTreeMirror
, but smarter: When opening,it first tries to use an existing tree (i.e. previously closed in this tab orperform a mirror of another tab's tree). If all this fails, a new tree iscreated. It is recommended that you use this command instead of:NERDTreeMirror
.:NERDTreeMirrorToggle
toggles NERDTree on/off in current tab, usingthe same behavior as:NERDTreeMirrorOpen
.:NERDTreeSteppedOpen
focuses the NERDTree, opening one first if none is present.:NERDTreeSteppedClose
unfocuses the NERDTree, or closes/hides it if it wasnot focused.:NERDTreeFocusToggle
focus the NERDTree or create it if focus ison a file, unfocus NERDTree if focus is on NERDTree
There are also plug-mappings available with the same functionality:
<plug>NERDTreeTabsOpen
<plug>NERDTreeTabsClose
<plug>NERDTreeTabsToggle
<plug>NERDTreeTabsFind
<plug>NERDTreeMirrorOpen
<plug>NERDTreeMirrorToggle
<plug>NERDTreeSteppedOpen
<plug>NERDTreeSteppedClose
You can switch on/off some features of the plugin by setting global vars to 1(for on) or 0 (for off) in your vimrc. Here are the options and their defaultvalues:
g:nerdtree_tabs_open_on_gui_startup
(default:1
)
Open NERDTree on gvim/macvim startup. (When set to2
,open only if directory was given as startup argument).g:nerdtree_tabs_open_on_console_startup
(default:0
)
Open NERDTree on console vim startup. (When set to2
,open only if directory was given as startup argument).g:nerdtree_tabs_no_startup_for_diff
(default:1
)
Do not open NERDTree if vim starts in diff modeg:nerdtree_tabs_smart_startup_focus
(default:1
)
On startup, focus NERDTree if opening a directory, focus file if openinga file. (When set to2
, always focus file window after startup).g:nerdtree_tabs_open_on_new_tab
(default:1
)
Open NERDTree on new tab creation (if NERDTree was globally opened by:NERDTreeTabsToggle)g:nerdtree_tabs_meaningful_tab_names
(default:1
)
Unfocus NERDTree when leaving a tab for descriptive tab namesg:nerdtree_tabs_autoclose
(default:1
)
Close current tab if there is only one window in it and it's NERDTreeg:nerdtree_tabs_synchronize_view
(default:1
)
Synchronize view of all NERDTree windows (scroll and cursor position)g:nerdtree_tabs_synchronize_focus
(default:1
)
Synchronize focus when switching windows (focus NERDTree after tab switchif and only if it was focused before tab switch)g:nerdtree_tabs_focus_on_files
(default:0
)
When switching into a tab, make sure that focus is on the file window,not in the NERDTree window. (Note that this can get annoying if you useNERDTree's feature "open in new tab silently", as you will lose focus on theNERDTree.)g:nerdtree_tabs_startup_cd
(default:1
)
When given a directory name as a command line parameter when launching Vim,:cd
into it.g:nerdtree_tabs_autofind
(default:0
)
Automatically find and select currently opened file in NERDTree.
To run NERDTreeTabs on console vim startup, put into your .vimrc:
let g:nerdtree_tabs_open_on_console_startup=1
The tab autoclose feature is stolen from Carl Lerche & Yehuda Katz'sJanus. Thanks, guys!
About
NERDTree and tabs together in Vim, painlessly
Resources
License
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Packages0
Uh oh!
There was an error while loading.Please reload this page.