Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
This repository was archived by the owner on Apr 5, 2024. It is now read-only.

NERDTree and tabs together in Vim, painlessly

License

NotificationsYou must be signed in to change notification settings

jistr/vim-nerdtree-tabs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 

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.

NERDTree and tabs together in Vim, painlessly

Features

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.

Installation

  1. If you haven't already, install NERDTree (seehttps://github.com/scrooloose/nerdtree)

  2. 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
  3. 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>
  4. Celebrate.

Commands and Mappings

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

Configuration

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 mode

  • g: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 names

  • g:nerdtree_tabs_autoclose (default:1)
    Close current tab if there is only one window in it and it's NERDTree

  • g: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.

Example

To run NERDTreeTabs on console vim startup, put into your .vimrc:

let g:nerdtree_tabs_open_on_console_startup=1

Credits

The tab autoclose feature is stolen from Carl Lerche & Yehuda Katz'sJanus. Thanks, guys!

About

NERDTree and tabs together in Vim, painlessly

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors18


[8]ページ先頭

©2009-2025 Movatter.jp