citadel

My dotfiles, scripts and nix configs
git clone git://jb55.com/citadel
Log | Files | Refs | README | LICENSE

NERD_tree.txt (48975B)


      1 *NERD_tree.txt*   A tree explorer plugin that owns your momma!
      2 
      3 
      4 
      5     omg its ... ~
      6 
      7     ________  ________   _   ____________  ____     __________  ____________~
      8    /_  __/ / / / ____/  / | / / ____/ __ \/ __ \   /_  __/ __ \/ ____/ ____/~
      9     / / / /_/ / __/    /  |/ / __/ / /_/ / / / /    / / / /_/ / __/ / __/   ~
     10    / / / __  / /___   / /|  / /___/ _, _/ /_/ /    / / / _, _/ /___/ /___   ~
     11   /_/ /_/ /_/_____/  /_/ |_/_____/_/ |_/_____/    /_/ /_/ |_/_____/_____/   ~
     12 
     13 
     14                               Reference Manual~
     15 
     16 
     17 
     18 
     19 ==============================================================================
     20 CONTENTS                                                   *NERDTree-contents*
     21 
     22     1.Intro...................................|NERDTree|
     23     2.Functionality provided..................|NERDTreeFunctionality|
     24         2.1.Global commands...................|NERDTreeGlobalCommands|
     25         2.2.Bookmarks.........................|NERDTreeBookmarks|
     26             2.2.1.The bookmark table..........|NERDTreeBookmarkTable|
     27             2.2.2.Bookmark commands...........|NERDTreeBookmarkCommands|
     28             2.2.3.Invalid bookmarks...........|NERDTreeInvalidBookmarks|
     29         2.3.NERD tree mappings................|NERDTreeMappings|
     30         2.4.The NERD tree menu................|NERDTreeMenu|
     31     3.Options.................................|NERDTreeOptions|
     32         3.1.Option summary....................|NERDTreeOptionSummary|
     33         3.2.Option details....................|NERDTreeOptionDetails|
     34     4.The NERD tree API.......................|NERDTreeAPI|
     35         4.1.Key map API.......................|NERDTreeKeymapAPI|
     36         4.2.Menu API..........................|NERDTreeMenuAPI|
     37     5.About...................................|NERDTreeAbout|
     38     6.Changelog...............................|NERDTreeChangelog|
     39     7.Credits.................................|NERDTreeCredits|
     40     8.License.................................|NERDTreeLicense|
     41 
     42 ==============================================================================
     43 1. Intro                                                            *NERDTree*
     44 
     45 What is this "NERD tree"??
     46 
     47 The NERD tree allows you to explore your filesystem and to open files and
     48 directories. It presents the filesystem to you in the form of a tree which you
     49 manipulate with the keyboard and/or mouse. It also allows you to perform
     50 simple filesystem operations.
     51 
     52 The following features and functionality are provided by the NERD tree:
     53     * Files and directories are displayed in a hierarchical tree structure
     54     * Different highlighting is provided for the following types of nodes:
     55         * files
     56         * directories
     57         * sym-links
     58         * windows .lnk files
     59         * read-only files
     60         * executable files
     61     * Many (customisable) mappings are provided to manipulate the tree:
     62         * Mappings to open/close/explore directory nodes
     63         * Mappings to open files in new/existing windows/tabs
     64         * Mappings to change the current root of the tree
     65         * Mappings to navigate around the tree
     66         * ...
     67     * Directories and files can be bookmarked.
     68     * Most NERD tree navigation can also be done with the mouse
     69     * Filtering of tree content (can be toggled at runtime)
     70         * custom file filters to prevent e.g. vim backup files being displayed
     71         * optional displaying of hidden files (. files)
     72         * files can be "turned off" so that only directories are displayed
     73     * The position and size of the NERD tree window can be customised
     74     * The order in which the nodes in the tree are listed can be customised.
     75     * A model of your filesystem is created/maintained as you explore it. This
     76       has several advantages:
     77         * All filesystem information is cached and is only re-read on demand
     78         * If you revisit a part of the tree that you left earlier in your
     79           session, the directory nodes will be opened/closed as you left them
     80     * The script remembers the cursor position and window position in the NERD
     81       tree so you can toggle it off (or just close the tree window) and then
     82       reopen it (with NERDTreeToggle) the NERD tree window will appear exactly
     83       as you left it
     84     * You can have a separate NERD tree for each tab, share trees across tabs,
     85       or a mix of both.
     86     * By default the script overrides the default file browser (netw), so if
     87       you :edit a directory a (slighly modified) NERD tree will appear in the
     88       current window
     89     * A programmable menu system is provided (simulates right clicking on a
     90       node)
     91         * one default menu plugin is provided to perform basic filesytem
     92           operations (create/delete/move/copy files/directories)
     93     * There's an API for adding your own keymappings
     94 
     95 
     96 ==============================================================================
     97 2. Functionality provided                              *NERDTreeFunctionality*
     98 
     99 ------------------------------------------------------------------------------
    100 2.1. Global Commands                                  *NERDTreeGlobalCommands*
    101 
    102 :NERDTree [<start-directory> | <bookmark>]                         *:NERDTree*
    103     Opens a fresh NERD tree. The root of the tree depends on the argument
    104     given. There are 3 cases: If no argument is given, the current directory
    105     will be used.  If a directory is given, that will be used. If a bookmark
    106     name is given, the corresponding directory will be used.  For example: >
    107         :NERDTree /home/marty/vim7/src
    108         :NERDTree foo   (foo is the name of a bookmark)
    109 <
    110 :NERDTreeFromBookmark <bookmark>                       *:NERDTreeFromBookmark*
    111     Opens a fresh NERD tree with the root initialized to the dir for
    112     <bookmark>.  This only reason to use this command over :NERDTree is for
    113     the completion (which is for bookmarks rather than directories).
    114 
    115 :NERDTreeToggle [<start-directory> | <bookmark>]             *:NERDTreeToggle*
    116     If a NERD tree already exists for this tab, it is reopened and rendered
    117     again.  If no NERD tree exists for this tab then this command acts the
    118     same as the |:NERDTree| command.
    119 
    120 :NERDTreeMirror                                              *:NERDTreeMirror*
    121     Shares an existing NERD tree, from another tab, in the current tab.
    122     Changes made to one tree are reflected in both as they are actually the
    123     same buffer.
    124 
    125     If only one other NERD tree exists, that tree is automatically mirrored. If
    126     more than one exists, the script will ask which tree to mirror.
    127 
    128 :NERDTreeClose                                                *:NERDTreeClose*
    129     Close the NERD tree in this tab.
    130 
    131 ------------------------------------------------------------------------------
    132 2.2. Bookmarks                                             *NERDTreeBookmarks*
    133 
    134 Bookmarks in the NERD tree are a way to tag files or directories of interest.
    135 For example, you could use bookmarks to tag all of your project directories.
    136 
    137 ------------------------------------------------------------------------------
    138 2.2.1. The Bookmark Table                              *NERDTreeBookmarkTable*
    139 
    140 If the bookmark table is active (see |NERDTree-B| and
    141 |'NERDTreeShowBookmarks'|), it will be rendered above the tree. You can double
    142 click bookmarks or use the |NERDTree-o| mapping to activate them. See also,
    143 |NERDTree-t| and |NERDTree-T|
    144 
    145 ------------------------------------------------------------------------------
    146 2.2.2. Bookmark commands                            *NERDTreeBookmarkCommands*
    147 
    148 Note that the following commands are only available in the NERD tree buffer.
    149 
    150 :Bookmark <name>
    151     Bookmark the current node as <name>. If there is already a <name>
    152     bookmark, it is overwritten. <name> must not contain spaces.
    153 
    154 :BookmarkToRoot <bookmark>
    155     Make the directory corresponding to <bookmark> the new root. If a treenode
    156     corresponding to <bookmark> is already cached somewhere in the tree then
    157     the current tree will be used, otherwise a fresh tree will be opened.
    158     Note that if <bookmark> points to a file then its parent will be used
    159     instead.
    160 
    161 :RevealBookmark <bookmark>
    162     If the node is cached under the current root then it will be revealed
    163     (i.e. directory nodes above it will be opened) and the cursor will be
    164     placed on it.
    165 
    166 :OpenBookmark <bookmark>
    167     <bookmark> must point to a file. The file is opened as though |NERDTree-o|
    168     was applied. If the node is cached under the current root then it will be
    169     revealed and the cursor will be placed on it.
    170 
    171 :ClearBookmarks [<bookmarks>]
    172     Remove all the given bookmarks. If no bookmarks are given then remove all
    173     bookmarks on the current node.
    174 
    175 :ClearAllBookmarks
    176     Remove all bookmarks.
    177 
    178 :ReadBookmarks
    179     Re-read the bookmarks in the |'NERDTreeBookmarksFile'|.
    180 
    181 See also |:NERDTree| and |:NERDTreeFromBookmark|.
    182 
    183 ------------------------------------------------------------------------------
    184 2.2.3. Invalid Bookmarks                            *NERDTreeInvalidBookmarks*
    185 
    186 If invalid bookmarks are detected, the script will issue an error message and
    187 the invalid bookmarks will become unavailable for use.
    188 
    189 These bookmarks will still be stored in the bookmarks file (see
    190 |'NERDTreeBookmarksFile'|), down the bottom. There will always be a blank line
    191 after the valid bookmarks but before the invalid ones.
    192 
    193 Each line in the bookmarks file represents one bookmark. The proper format is:
    194 <bookmark name><space><full path to the bookmark location>
    195 
    196 After you have corrected any invalid bookmarks, either restart vim, or go
    197 :ReadBookmarks from the NERD tree window.
    198 
    199 ------------------------------------------------------------------------------
    200 2.3. NERD tree Mappings                                     *NERDTreeMappings*
    201 
    202 Default  Description~                                             help-tag~
    203 Key~
    204 
    205 o.......Open files, directories and bookmarks....................|NERDTree-o|
    206 go......Open selected file, but leave cursor in the NERDTree.....|NERDTree-go|
    207 t.......Open selected node/bookmark in a new tab.................|NERDTree-t|
    208 T.......Same as 't' but keep the focus on the current tab........|NERDTree-T|
    209 i.......Open selected file in a split window.....................|NERDTree-i|
    210 gi......Same as i, but leave the cursor on the NERDTree..........|NERDTree-gi|
    211 s.......Open selected file in a new vsplit.......................|NERDTree-s|
    212 gs......Same as s, but leave the cursor on the NERDTree..........|NERDTree-gs|
    213 O.......Recursively open the selected directory..................|NERDTree-O|
    214 x.......Close the current nodes parent...........................|NERDTree-x|
    215 X.......Recursively close all children of the current node.......|NERDTree-X|
    216 e.......Edit the current dif.....................................|NERDTree-e|
    217 
    218 <CR>...............same as |NERDTree-o|.
    219 double-click.......same as the |NERDTree-o| map.
    220 middle-click.......same as |NERDTree-i| for files, same as
    221                    |NERDTree-e| for dirs.
    222 
    223 D.......Delete the current bookmark .............................|NERDTree-D|
    224 
    225 P.......Jump to the root node....................................|NERDTree-P|
    226 p.......Jump to current nodes parent.............................|NERDTree-p|
    227 K.......Jump up inside directories at the current tree depth.....|NERDTree-K|
    228 J.......Jump down inside directories at the current tree depth...|NERDTree-J|
    229 <C-J>...Jump down to the next sibling of the current directory...|NERDTree-C-J|
    230 <C-K>...Jump up to the previous sibling of the current directory.|NERDTree-C-K|
    231 
    232 C.......Change the tree root to the selected dir.................|NERDTree-C|
    233 u.......Move the tree root up one directory......................|NERDTree-u|
    234 U.......Same as 'u' except the old root node is left open........|NERDTree-U|
    235 r.......Recursively refresh the current directory................|NERDTree-r|
    236 R.......Recursively refresh the current root.....................|NERDTree-R|
    237 m.......Display the NERD tree menu...............................|NERDTree-m|
    238 cd......Change the CWD to the dir of the selected node...........|NERDTree-cd|
    239 
    240 I.......Toggle whether hidden files displayed....................|NERDTree-I|
    241 f.......Toggle whether the file filters are used.................|NERDTree-f|
    242 F.......Toggle whether files are displayed.......................|NERDTree-F|
    243 B.......Toggle whether the bookmark table is displayed...........|NERDTree-B|
    244 
    245 q.......Close the NERDTree window................................|NERDTree-q|
    246 A.......Zoom (maximize/minimize) the NERDTree window.............|NERDTree-A|
    247 ?.......Toggle the display of the quick help.....................|NERDTree-?|
    248 
    249 ------------------------------------------------------------------------------
    250                                                                   *NERDTree-o*
    251 Default key: o
    252 Map option: NERDTreeMapActivateNode
    253 Applies to: files and directories.
    254 
    255 If a file node is selected, it is opened in the previous window.
    256 
    257 If a directory is selected it is opened or closed depending on its current
    258 state.
    259 
    260 If a bookmark that links to a directory is selected then that directory
    261 becomes the new root.
    262 
    263 If a bookmark that links to a file is selected then that file is opened in the
    264 previous window.
    265 
    266 ------------------------------------------------------------------------------
    267                                                                  *NERDTree-go*
    268 Default key: go
    269 Map option: None
    270 Applies to: files.
    271 
    272 If a file node is selected, it is opened in the previous window, but the
    273 cursor does not move.
    274 
    275 The key combo for this mapping is always "g" + NERDTreeMapActivateNode (see
    276 |NERDTree-o|).
    277 
    278 ------------------------------------------------------------------------------
    279                                                                   *NERDTree-t*
    280 Default key: t
    281 Map option: NERDTreeMapOpenInTab
    282 Applies to: files and directories.
    283 
    284 Opens the selected file in a new tab. If a directory is selected, a fresh
    285 NERD Tree for that directory is opened in a new tab.
    286 
    287 If a bookmark which points to a directory is selected, open a NERD tree for
    288 that directory in a new tab. If the bookmark points to a file, open that file
    289 in a new tab.
    290 
    291 ------------------------------------------------------------------------------
    292                                                                   *NERDTree-T*
    293 Default key: T
    294 Map option: NERDTreeMapOpenInTabSilent
    295 Applies to: files and directories.
    296 
    297 The same as |NERDTree-t| except that the focus is kept in the current tab.
    298 
    299 ------------------------------------------------------------------------------
    300                                                                   *NERDTree-i*
    301 Default key: i
    302 Map option: NERDTreeMapOpenSplit
    303 Applies to: files.
    304 
    305 Opens the selected file in a new split window and puts the cursor in the new
    306 window.
    307 
    308 ------------------------------------------------------------------------------
    309                                                                  *NERDTree-gi*
    310 Default key: gi
    311 Map option: None
    312 Applies to: files.
    313 
    314 The same as |NERDTree-i| except that the cursor is not moved.
    315 
    316 The key combo for this mapping is always "g" + NERDTreeMapOpenSplit (see
    317 |NERDTree-i|).
    318 
    319 ------------------------------------------------------------------------------
    320                                                                   *NERDTree-s*
    321 Default key: s
    322 Map option: NERDTreeMapOpenVSplit
    323 Applies to: files.
    324 
    325 Opens the selected file in a new vertically split window and puts the cursor in
    326 the new window.
    327 
    328 ------------------------------------------------------------------------------
    329                                                                  *NERDTree-gs*
    330 Default key: gs
    331 Map option: None
    332 Applies to: files.
    333 
    334 The same as |NERDTree-s| except that the cursor is not moved.
    335 
    336 The key combo for this mapping is always "g" + NERDTreeMapOpenVSplit (see
    337 |NERDTree-s|).
    338 
    339 ------------------------------------------------------------------------------
    340                                                                   *NERDTree-O*
    341 Default key: O
    342 Map option: NERDTreeMapOpenRecursively
    343 Applies to: directories.
    344 
    345 Recursively opens the selelected directory.
    346 
    347 All files and directories are cached, but if a directory would not be
    348 displayed due to file filters (see |'NERDTreeIgnore'| |NERDTree-f|) or the
    349 hidden file filter (see |'NERDTreeShowHidden'|) then its contents are not
    350 cached. This is handy, especially if you have .svn directories.
    351 
    352 ------------------------------------------------------------------------------
    353                                                                   *NERDTree-x*
    354 Default key: x
    355 Map option: NERDTreeMapCloseDir
    356 Applies to: files and directories.
    357 
    358 Closes the parent of the selected node.
    359 
    360 ------------------------------------------------------------------------------
    361                                                                   *NERDTree-X*
    362 Default key: X
    363 Map option: NERDTreeMapCloseChildren
    364 Applies to: directories.
    365 
    366 Recursively closes all children of the selected directory.
    367 
    368 Tip: To quickly "reset" the tree, use |NERDTree-P| with this mapping.
    369 
    370 ------------------------------------------------------------------------------
    371                                                                   *NERDTree-e*
    372 Default key: e
    373 Map option: NERDTreeMapOpenExpl
    374 Applies to: files and directories.
    375 
    376 |:edit|s the selected directory, or the selected file's directory. This could
    377 result in a NERD tree or a netrw being opened, depending on
    378 |'NERDTreeHijackNetrw'|.
    379 
    380 ------------------------------------------------------------------------------
    381                                                                   *NERDTree-D*
    382 Default key: D
    383 Map option: NERDTreeMapDeleteBookmark
    384 Applies to: lines in the bookmarks table
    385 
    386 Deletes the currently selected bookmark.
    387 
    388 ------------------------------------------------------------------------------
    389                                                                   *NERDTree-P*
    390 Default key: P
    391 Map option: NERDTreeMapJumpRoot
    392 Applies to: no restrictions.
    393 
    394 Jump to the tree root.
    395 
    396 ------------------------------------------------------------------------------
    397                                                                   *NERDTree-p*
    398 Default key: p
    399 Map option: NERDTreeMapJumpParent
    400 Applies to: files and directories.
    401 
    402 Jump to the parent node of the selected node.
    403 
    404 ------------------------------------------------------------------------------
    405                                                                   *NERDTree-K*
    406 Default key: K
    407 Map option: NERDTreeMapJumpFirstChild
    408 Applies to: files and directories.
    409 
    410 Jump to the first child of the current nodes parent.
    411 
    412 If the cursor is already on the first node then do the following:
    413     * loop back thru the siblings of the current nodes parent until we find an
    414       open dir with children
    415     * go to the first child of that node
    416 
    417 ------------------------------------------------------------------------------
    418                                                                   *NERDTree-J*
    419 Default key: J
    420 Map option: NERDTreeMapJumpLastChild
    421 Applies to: files and directories.
    422 
    423 Jump to the last child of the current nodes parent.
    424 
    425 If the cursor is already on the last node then do the following:
    426     * loop forward thru the siblings of the current nodes parent until we find
    427       an open dir with children
    428     * go to the last child of that node
    429 
    430 ------------------------------------------------------------------------------
    431                                                                 *NERDTree-C-J*
    432 Default key: <C-J>
    433 Map option: NERDTreeMapJumpNextSibling
    434 Applies to: files and directories.
    435 
    436 Jump to the next sibling of the selected node.
    437 
    438 ------------------------------------------------------------------------------
    439                                                                 *NERDTree-C-K*
    440 Default key: <C-K>
    441 Map option: NERDTreeMapJumpPrevSibling
    442 Applies to: files and directories.
    443 
    444 Jump to the previous sibling of the selected node.
    445 
    446 ------------------------------------------------------------------------------
    447                                                                   *NERDTree-C*
    448 Default key: C
    449 Map option: NERDTreeMapChdir
    450 Applies to: directories.
    451 
    452 Make the selected directory node the new tree root. If a file is selected, its
    453 parent is used.
    454 
    455 ------------------------------------------------------------------------------
    456                                                                   *NERDTree-u*
    457 Default key: u
    458 Map option: NERDTreeMapUpdir
    459 Applies to: no restrictions.
    460 
    461 Move the tree root up a dir (like doing a "cd ..").
    462 
    463 ------------------------------------------------------------------------------
    464                                                                   *NERDTree-U*
    465 Default key: U
    466 Map option: NERDTreeMapUpdirKeepOpen
    467 Applies to: no restrictions.
    468 
    469 Like |NERDTree-u| except that the old tree root is kept open.
    470 
    471 ------------------------------------------------------------------------------
    472                                                                   *NERDTree-r*
    473 Default key: r
    474 Map option: NERDTreeMapRefresh
    475 Applies to: files and directories.
    476 
    477 If a dir is selected, recursively refresh that dir, i.e. scan the filesystem
    478 for changes and represent them in the tree.
    479 
    480 If a file node is selected then the above is done on it's parent.
    481 
    482 ------------------------------------------------------------------------------
    483                                                                   *NERDTree-R*
    484 Default key: R
    485 Map option: NERDTreeMapRefreshRoot
    486 Applies to: no restrictions.
    487 
    488 Recursively refresh the tree root.
    489 
    490 ------------------------------------------------------------------------------
    491                                                                   *NERDTree-m*
    492 Default key: m
    493 Map option: NERDTreeMapMenu
    494 Applies to: files and directories.
    495 
    496 Display the NERD tree menu. See |NERDTreeMenu| for details.
    497 
    498 ------------------------------------------------------------------------------
    499                                                                  *NERDTree-cd*
    500 Default key: cd
    501 Map option: NERDTreeMapChdir
    502 Applies to: files and directories.
    503 
    504 Change vims current working directory to that of the selected node.
    505 
    506 ------------------------------------------------------------------------------
    507                                                                   *NERDTree-I*
    508 Default key: I
    509 Map option: NERDTreeMapToggleHidden
    510 Applies to: no restrictions.
    511 
    512 Toggles whether hidden files (i.e. "dot files") are displayed.
    513 
    514 ------------------------------------------------------------------------------
    515                                                                   *NERDTree-f*
    516 Default key: f
    517 Map option: NERDTreeMapToggleFilters
    518 Applies to: no restrictions.
    519 
    520 Toggles whether file filters are used. See |'NERDTreeIgnore'| for details.
    521 
    522 ------------------------------------------------------------------------------
    523                                                                   *NERDTree-F*
    524 Default key: F
    525 Map option: NERDTreeMapToggleFiles
    526 Applies to: no restrictions.
    527 
    528 Toggles whether file nodes are displayed.
    529 
    530 ------------------------------------------------------------------------------
    531                                                                   *NERDTree-B*
    532 Default key: B
    533 Map option: NERDTreeMapToggleBookmarks
    534 Applies to: no restrictions.
    535 
    536 Toggles whether the bookmarks table is displayed.
    537 
    538 ------------------------------------------------------------------------------
    539                                                                   *NERDTree-q*
    540 Default key: q
    541 Map option: NERDTreeMapQuit
    542 Applies to: no restrictions.
    543 
    544 Closes the NERDtree window.
    545 
    546 ------------------------------------------------------------------------------
    547                                                                   *NERDTree-A*
    548 Default key: A
    549 Map option: NERDTreeMapToggleZoom
    550 Applies to: no restrictions.
    551 
    552 Maximize (zoom) and minimize the NERDtree window.
    553 
    554 ------------------------------------------------------------------------------
    555                                                                   *NERDTree-?*
    556 Default key: ?
    557 Map option: NERDTreeMapHelp
    558 Applies to: no restrictions.
    559 
    560 Toggles whether the quickhelp is displayed.
    561 
    562 ------------------------------------------------------------------------------
    563 2.3. The NERD tree menu                                         *NERDTreeMenu*
    564 
    565 The NERD tree has a menu that can be programmed via the an API (see
    566 |NERDTreeMenuAPI|). The idea is to simulate the "right click" menus that most
    567 file explorers have.
    568 
    569 The script comes with two default menu plugins: exec_menuitem.vim and
    570 fs_menu.vim. fs_menu.vim adds some basic filesystem operations to the menu for
    571 creating/deleting/moving/copying files and dirs. exec_menuitem.vim provides a
    572 menu item to execute executable files.
    573 
    574 Related tags: |NERDTree-m| |NERDTreeApi|
    575 
    576 ==============================================================================
    577 3. Customisation                                             *NERDTreeOptions*
    578 
    579 
    580 ------------------------------------------------------------------------------
    581 3.1. Customisation summary                             *NERDTreeOptionSummary*
    582 
    583 The script provides the following options that can customise the behaviour the
    584 NERD tree. These options should be set in your vimrc.
    585 
    586 |'loaded_nerd_tree'|            Turns off the script.
    587 
    588 |'NERDChristmasTree'|           Tells the NERD tree to make itself colourful
    589                                 and pretty.
    590 
    591 |'NERDTreeAutoCenter'|          Controls whether the NERD tree window centers
    592                                 when the cursor moves within a specified
    593                                 distance to the top/bottom of the window.
    594 |'NERDTreeAutoCenterThreshold'| Controls the sensitivity of autocentering.
    595 
    596 |'NERDTreeCaseSensitiveSort'|   Tells the NERD tree whether to be case
    597                                 sensitive or not when sorting nodes.
    598 
    599 |'NERDTreeChDirMode'|           Tells the NERD tree if/when it should change
    600                                 vim's current working directory.
    601 
    602 |'NERDTreeHighlightCursorline'| Tell the NERD tree whether to highlight the
    603                                 current cursor line.
    604 
    605 |'NERDTreeHijackNetrw'|         Tell the NERD tree whether to replace the netrw
    606                                 autocommands for exploring local directories.
    607 
    608 |'NERDTreeIgnore'|              Tells the NERD tree which files to ignore.
    609 
    610 |'NERDTreeBookmarksFile'|       Where the bookmarks are stored.
    611 
    612 |'NERDTreeMouseMode'|           Tells the NERD tree how to handle mouse
    613                                 clicks.
    614 
    615 |'NERDTreeQuitOnOpen'|          Closes the tree window after opening a file.
    616 
    617 |'NERDTreeShowBookmarks'|       Tells the NERD tree whether to display the
    618                                 bookmarks table on startup.
    619 
    620 |'NERDTreeShowFiles'|           Tells the NERD tree whether to display files
    621                                 in the tree on startup.
    622 
    623 |'NERDTreeShowHidden'|          Tells the NERD tree whether to display hidden
    624                                 files on startup.
    625 
    626 |'NERDTreeShowLineNumbers'|     Tells the NERD tree whether to display line
    627                                 numbers in the tree window.
    628 
    629 |'NERDTreeSortOrder'|           Tell the NERD tree how to sort the nodes in
    630                                 the tree.
    631 
    632 |'NERDTreeStatusline'|          Set a statusline for NERD tree windows.
    633 
    634 |'NERDTreeWinPos'|              Tells the script where to put the NERD tree
    635                                 window.
    636 
    637 |'NERDTreeWinSize'|             Sets the window size when the NERD tree is
    638                                 opened.
    639 
    640 ------------------------------------------------------------------------------
    641 3.2. Customisation details                             *NERDTreeOptionDetails*
    642 
    643 To enable any of the below options you should put the given line in your
    644 ~/.vimrc
    645 
    646                                                           *'loaded_nerd_tree'*
    647 If this plugin is making you feel homicidal, it may be a good idea to turn it
    648 off with this line in your vimrc: >
    649     let loaded_nerd_tree=1
    650 <
    651 ------------------------------------------------------------------------------
    652                                                          *'NERDChristmasTree'*
    653 Values: 0 or 1.
    654 Default: 1.
    655 
    656 If this option is set to 1 then some extra syntax highlighting elements are
    657 added to the nerd tree to make it more colourful.
    658 
    659 Set it to 0 for a more vanilla looking tree.
    660 
    661 ------------------------------------------------------------------------------
    662                                                         *'NERDTreeAutoCenter'*
    663 Values: 0 or 1.
    664 Default: 1
    665 
    666 If set to 1, the NERD tree window will center around the cursor if it moves to
    667 within |'NERDTreeAutoCenterThreshold'| lines of the top/bottom of the window.
    668 
    669 This is ONLY done in response to tree navigation mappings,
    670 i.e. |NERDTree-J| |NERDTree-K| |NERDTree-C-J| |NERDTree-C-K| |NERDTree-p|
    671 |NERDTree-P|
    672 
    673 The centering is done with a |zz| operation.
    674 
    675 ------------------------------------------------------------------------------
    676                                                *'NERDTreeAutoCenterThreshold'*
    677 Values: Any natural number.
    678 Default: 3
    679 
    680 This option controls the "sensitivity" of the NERD tree auto centering. See
    681 |'NERDTreeAutoCenter'| for details.
    682 
    683 ------------------------------------------------------------------------------
    684                                                  *'NERDTreeCaseSensitiveSort'*
    685 Values: 0 or 1.
    686 Default: 0.
    687 
    688 By default the NERD tree does not sort nodes case sensitively, i.e. nodes
    689 could appear like this: >
    690     bar.c
    691     Baz.c
    692     blarg.c
    693     boner.c
    694     Foo.c
    695 <
    696 But, if you set this option to 1 then the case of the nodes will be taken into
    697 account. The above nodes would then be sorted like this: >
    698     Baz.c
    699     Foo.c
    700     bar.c
    701     blarg.c
    702     boner.c
    703 <
    704 ------------------------------------------------------------------------------
    705                                                          *'NERDTreeChDirMode'*
    706 
    707 Values: 0, 1 or 2.
    708 Default: 0.
    709 
    710 Use this option to tell the script when (if at all) to change the current
    711 working directory (CWD) for vim.
    712 
    713 If it is set to 0 then the CWD is never changed by the NERD tree.
    714 
    715 If set to 1 then the CWD is changed when the NERD tree is first loaded to the
    716 directory it is initialized in. For example, if you start the NERD tree with >
    717     :NERDTree /home/marty/foobar
    718 <
    719 then the CWD will be changed to /home/marty/foobar and will not be changed
    720 again unless you init another NERD tree with a similar command.
    721 
    722 If the option is set to 2 then it behaves the same as if set to 1 except that
    723 the CWD is changed whenever the tree root is changed. For example, if the CWD
    724 is /home/marty/foobar and you make the node for /home/marty/foobar/baz the new
    725 root then the CWD will become /home/marty/foobar/baz.
    726 
    727 ------------------------------------------------------------------------------
    728                                                *'NERDTreeHighlightCursorline'*
    729 Values: 0 or 1.
    730 Default: 1.
    731 
    732 If set to 1, the current cursor line in the NERD tree buffer will be
    733 highlighted. This is done using the |'cursorline'| option.
    734 
    735 ------------------------------------------------------------------------------
    736                                                        *'NERDTreeHijackNetrw'*
    737 Values: 0 or 1.
    738 Default: 1.
    739 
    740 If set to 1, doing a >
    741     :edit <some directory>
    742 <
    743 will open up a "secondary" NERD tree instead of a netrw in the target window.
    744 
    745 Secondary NERD trees behaves slighly different from a regular trees in the
    746 following respects:
    747     1. 'o' will open the selected file in the same window as the tree,
    748        replacing it.
    749     2. you can have as many secondary tree as you want in the same tab.
    750 
    751 ------------------------------------------------------------------------------
    752                                                             *'NERDTreeIgnore'*
    753 Values: a list of regular expressions.
    754 Default: ['\~$'].
    755 
    756 This option is used to specify which files the NERD tree should ignore.  It
    757 must be a list of regular expressions. When the NERD tree is rendered, any
    758 files/dirs that match any of the regex's in 'NERDTreeIgnore' wont be
    759 displayed.
    760 
    761 For example if you put the following line in your vimrc: >
    762     let NERDTreeIgnore=['\.vim$', '\~$']
    763 <
    764 then all files ending in .vim or ~ will be ignored.
    765 
    766 Note: to tell the NERD tree not to ignore any files you must use the following
    767 line: >
    768     let NERDTreeIgnore=[]
    769 <
    770 
    771 The file filters can be turned on and off dynamically with the |NERDTree-f|
    772 mapping.
    773 
    774 ------------------------------------------------------------------------------
    775                                                      *'NERDTreeBookmarksFile'*
    776 Values: a path
    777 Default: $HOME/.NERDTreeBookmarks
    778 
    779 This is where bookmarks are saved. See |NERDTreeBookmarkCommands|.
    780 
    781 ------------------------------------------------------------------------------
    782                                                        *'NERDTreeMouseMode'*
    783 Values: 1, 2 or 3.
    784 Default: 1.
    785 
    786 If set to 1 then a double click on a node is required to open it.
    787 If set to 2 then a single click will open directory nodes, while a double
    788 click will still be required for file nodes.
    789 If set to 3 then a single click will open any node.
    790 
    791 Note: a double click anywhere on a line that a tree node is on will
    792 activate it, but all single-click activations must be done on name of the node
    793 itself. For example, if you have the following node: >
    794     | | |-application.rb
    795 <
    796 then (to single click activate it) you must click somewhere in
    797 'application.rb'.
    798 
    799 ------------------------------------------------------------------------------
    800                                                         *'NERDTreeQuitOnOpen'*
    801 
    802 Values: 0 or 1.
    803 Default: 0
    804 
    805 If set to 1, the NERD tree window will close after opening a file with the
    806 |NERDTree-o| or |NERDTree-i| mappings.
    807 
    808 ------------------------------------------------------------------------------
    809                                                      *'NERDTreeShowBookmarks'*
    810 Values: 0 or 1.
    811 Default: 0.
    812 
    813 If this option is set to 1 then the bookmarks table will be displayed.
    814 
    815 This option can be toggled dynamically, per tree, with the |NERDTree-B|
    816 mapping.
    817 
    818 ------------------------------------------------------------------------------
    819                                                          *'NERDTreeShowFiles'*
    820 Values: 0 or 1.
    821 Default: 1.
    822 
    823 If this option is set to 1 then files are displayed in the NERD tree. If it is
    824 set to 0 then only directories are displayed.
    825 
    826 This option can be toggled dynamically, per tree, with the |NERDTree-F|
    827 mapping and is useful for drastically shrinking the tree when you are
    828 navigating to a different part of the tree.
    829 
    830 ------------------------------------------------------------------------------
    831                                                         *'NERDTreeShowHidden'*
    832 Values: 0 or 1.
    833 Default: 0.
    834 
    835 This option tells vim whether to display hidden files by default. This option
    836 can be dynamically toggled, per tree, with the |NERDTree-I| mapping.  Use one
    837 of the follow lines to set this option: >
    838     let NERDTreeShowHidden=0
    839     let NERDTreeShowHidden=1
    840 <
    841 
    842 ------------------------------------------------------------------------------
    843                                                    *'NERDTreeShowLineNumbers'*
    844 Values: 0 or 1.
    845 Default: 0.
    846 
    847 This option tells vim whether to display line numbers for the NERD tree
    848 window.  Use one of the follow lines to set this option: >
    849     let NERDTreeShowLineNumbers=0
    850     let NERDTreeShowLineNumbers=1
    851 <
    852 
    853 ------------------------------------------------------------------------------
    854                                                          *'NERDTreeSortOrder'*
    855 Values: a list of regular expressions.
    856 Default: ['\/$', '*', '\.swp$',  '\.bak$', '\~$']
    857 
    858 This option is set to a list of regular expressions which are used to
    859 specify the order of nodes under their parent.
    860 
    861 For example, if the option is set to: >
    862     ['\.vim$', '\.c$', '\.h$', '*', 'foobar']
    863 <
    864 then all .vim files will be placed at the top, followed by all .c files then
    865 all .h files. All files containing the string 'foobar' will be placed at the
    866 end.  The star is a special flag: it tells the script that every node that
    867 doesnt match any of the other regexps should be placed here.
    868 
    869 If no star is present in 'NERDTreeSortOrder' then one is automatically
    870 appended to the array.
    871 
    872 The regex '\/$' should be used to match directory nodes.
    873 
    874 After this sorting is done, the files in each group are sorted alphabetically.
    875 
    876 Other examples: >
    877     (1) ['*', '\/$']
    878     (2) []
    879     (3) ['\/$', '\.rb$', '\.php$', '*', '\.swp$',  '\.bak$', '\~$']
    880 <
    881 1. Directories will appear last, everything else will appear above.
    882 2. Everything will simply appear in alphabetical order.
    883 3. Dirs will appear first, then ruby and php. Swap files, bak files and vim
    884    backup files will appear last with everything else preceding them.
    885 
    886 ------------------------------------------------------------------------------
    887                                                         *'NERDTreeStatusline'*
    888 Values: Any valid statusline setting.
    889 Default: %{b:NERDTreeRoot.path.strForOS(0)}
    890 
    891 Tells the script what to use as the |'statusline'| setting for NERD tree
    892 windows.
    893 
    894 Note that the statusline is set using |:let-&| not |:set| so escaping spaces
    895 isn't necessary.
    896 
    897 Setting this option to -1 will will deactivate it so that your global
    898 statusline setting is used instead.
    899 
    900 ------------------------------------------------------------------------------
    901                                                             *'NERDTreeWinPos'*
    902 Values: "left" or "right"
    903 Default: "left".
    904 
    905 This option is used to determine where NERD tree window is placed on the
    906 screen.
    907 
    908 This option makes it possible to use two different explorer plugins
    909 simultaneously. For example, you could have the taglist plugin on the left of
    910 the window and the NERD tree on the right.
    911 
    912 ------------------------------------------------------------------------------
    913                                                            *'NERDTreeWinSize'*
    914 Values: a positive integer.
    915 Default: 31.
    916 
    917 This option is used to change the size of the NERD tree when it is loaded.
    918 
    919 ==============================================================================
    920 4. The NERD tree API                                             *NERDTreeAPI*
    921 
    922 The NERD tree script allows you to add custom key mappings and menu items via
    923 a set of API calls. Any scripts that use this API should be placed in
    924 ~/.vim/nerdtree_plugin/ (*nix) or ~/vimfiles/nerdtree_plugin (windows).
    925 
    926 The script exposes some prototype objects that can be used to manipulate the
    927 tree and/or get information from it: >
    928     g:NERDTreePath
    929     g:NERDTreeDirNode
    930     g:NERDTreeFileNode
    931     g:NERDTreeBookmark
    932 <
    933 See the code/comments in NERD_tree.vim to find how to use these objects. The
    934 following code conventions are used:
    935     * class members start with a capital letter
    936     * instance members start with a lower case letter
    937     * private members start with an underscore
    938 
    939 See this blog post for more details:
    940  http://got-ravings.blogspot.com/2008/09/vim-pr0n-prototype-based-objects.html
    941 
    942 ------------------------------------------------------------------------------
    943 4.1. Key map API                                           *NERDTreeKeymapAPI*
    944 
    945 NERDTreeAddKeyMap({options})                             *NERDTreeAddKeyMap()*
    946     Adds a new keymapping for all NERD tree buffers.
    947     {options} must be a dictionary, and must contain the following keys:
    948     "key" - the trigger key for the new mapping
    949     "callback" - the function the new mapping will be bound to
    950     "quickhelpText" - the text that will appear in the quickhelp (see
    951     |NERDTree-?|)
    952 
    953     Example: >
    954         call NERDTreeAddKeyMap({
    955                \ 'key': 'b',
    956                \ 'callback': 'NERDTreeEchoCurrentNode',
    957                \ 'quickhelpText': 'echo full path of current node' })
    958 
    959         function! NERDTreeEchoCurrentNode()
    960             let n = g:NERDTreeFileNode.GetSelected()
    961             if n != {}
    962                 echomsg 'Current node: ' . n.path.str()
    963             endif
    964         endfunction
    965 <
    966     This code should sit in a file like ~/.vim/nerdtree_plugin/mymapping.vim.
    967     It adds a (rather useless) mapping on 'b' which echos the full path to the
    968     current node.
    969 
    970 ------------------------------------------------------------------------------
    971 4.2. Menu API                                                *NERDTreeMenuAPI*
    972 
    973 NERDTreeAddSubmenu({options})                           *NERDTreeAddSubmenu()*
    974     Creates and returns a new submenu.
    975 
    976     {options} must be a dictionary and must contain the following keys:
    977     "text" - the text of the submenu that the user will see
    978     "shortcut" - a shortcut key for the submenu (need not be unique)
    979 
    980     The following keys are optional:
    981     "isActiveCallback" - a function that will be called to determine whether
    982     this submenu item will be displayed or not. The callback function must return
    983     0 or 1.
    984     "parent" - the parent submenu of the new submenu (returned from a previous
    985     invocation of NERDTreeAddSubmenu()). If this key is left out then the new
    986     submenu will sit under the top level menu.
    987 
    988     See below for an example.
    989 
    990 NERDTreeAddMenuItem({options})                         *NERDTreeAddMenuItem()*
    991     Adds a new menu item to the NERD tree menu (see |NERDTreeMenu|).
    992 
    993     {options} must be a dictionary and must contain the
    994     following keys:
    995     "text" - the text of the menu item which the user will see
    996     "shortcut" - a shortcut key for the menu item (need not be unique)
    997     "callback" - the function that will be called when the user activates the
    998     menu item.
    999 
   1000     The following keys are optional:
   1001     "isActiveCallback" - a function that will be called to determine whether
   1002     this menu item will be displayed or not. The callback function must return
   1003     0 or 1.
   1004     "parent" - if the menu item belongs under a submenu then this key must be
   1005     specified. This value for this key will be the object that
   1006     was returned when the submenu was created with |NERDTreeAddSubmenu()|.
   1007 
   1008     See below for an example.
   1009 
   1010 NERDTreeAddMenuSeparator([{options}])             *NERDTreeAddMenuSeparator()*
   1011     Adds a menu separator (a row of dashes).
   1012 
   1013     {options} is an optional dictionary that may contain the following keys:
   1014     "isActiveCallback" - see description in |NERDTreeAddMenuItem()|.
   1015 
   1016 Below is an example of the menu API in action. >
   1017     call NERDTreeAddMenuSeparator()
   1018 
   1019     call NERDTreeAddMenuItem({
   1020                 \ 'text': 'a (t)op level menu item',
   1021                 \ 'shortcut': 't',
   1022                 \ 'callback': 'SomeFunction' })
   1023 
   1024     let submenu = NERDTreeAddSubmenu({
   1025                 \ 'text': 'a (s)ub menu',
   1026                 \ 'shortcut': 's' })
   1027 
   1028     call NERDTreeAddMenuItem({
   1029                 \ 'text': '(n)ested item 1',
   1030                 \ 'shortcut': 'n',
   1031                 \ 'callback': 'SomeFunction',
   1032                 \ 'parent': submenu })
   1033 
   1034     call NERDTreeAddMenuItem({
   1035                 \ 'text': '(n)ested item 2',
   1036                 \ 'shortcut': 'n',
   1037                 \ 'callback': 'SomeFunction',
   1038                 \ 'parent': submenu })
   1039 <
   1040 This will create the following menu: >
   1041   --------------------
   1042   a (t)op level menu item
   1043   a (s)ub menu
   1044 <
   1045 Where selecting "a (s)ub menu" will lead to a second menu: >
   1046   (n)ested item 1
   1047   (n)ested item 2
   1048 <
   1049 When any of the 3 concrete menu items are selected the function "SomeFunction"
   1050 will be called.
   1051 
   1052 ------------------------------------------------------------------------------
   1053 NERDTreeRender()                                            *NERDTreeRender()*
   1054     Re-renders the NERD tree buffer. Useful if you change the state of the
   1055     tree and you want to it to be reflected in the UI.
   1056 
   1057 ==============================================================================
   1058 5. About                                                       *NERDTreeAbout*
   1059 
   1060 The author of the NERD tree is a terrible terrible monster called Martyzilla
   1061 who gobbles up small children with milk and sugar for breakfast.
   1062 
   1063 He can be reached at martin.grenfell at gmail dot com. He would love to hear
   1064 from you, so feel free to send him suggestions and/or comments about this
   1065 plugin.  Don't be shy --- the worst he can do is slaughter you and stuff you in
   1066 the fridge for later ;)
   1067 
   1068 The latest stable versions can be found at
   1069     http://www.vim.org/scripts/script.php?script_id=1658
   1070 
   1071 The latest dev versions are on github
   1072     http://github.com/scrooloose/nerdtree
   1073 
   1074 
   1075 ==============================================================================
   1076 6. Changelog                                               *NERDTreeChangelog*
   1077 
   1078 4.0.0
   1079     - add a new programmable menu system (see :help NERDTreeMenu).
   1080     - add new APIs to add menus/menu-items to the menu system as well as
   1081       custom key mappings to the NERD tree buffer (see :help NERDTreeAPI).
   1082     - removed the old API functions
   1083     - added a mapping to maximize/restore the size of nerd tree window, thanks
   1084       to Guillaume Duranceau for the patch. See :help NERDTree-A for details.
   1085 
   1086     - fix a bug where secondary nerd trees (netrw hijacked trees) and
   1087       NERDTreeQuitOnOpen didnt play nicely, thanks to Curtis Harvey.
   1088     - fix a bug where the script ignored directories whose name ended in a dot,
   1089       thanks to Aggelos Orfanakos for the patch.
   1090     - fix a bug when using the x mapping on the tree root, thanks to Bryan
   1091       Venteicher for the patch.
   1092     - fix a bug where the cursor position/window size of the nerd tree buffer
   1093       wasnt being stored on closing the window, thanks to Richard Hart.
   1094     - fix a bug where NERDTreeMirror would mirror the wrong tree
   1095 
   1096 3.1.1
   1097     - fix a bug where a non-listed no-name buffer was getting created every
   1098       time the tree windows was created, thanks to Derek Wyatt and owen1
   1099     - make <CR> behave the same as the 'o' mapping
   1100     - some helptag fixes in the doc, thanks strull
   1101     - fix a bug when using :set nohidden and opening a file where the previous
   1102       buf was modified. Thanks iElectric
   1103     - other minor fixes
   1104 
   1105 3.1.0
   1106     New features:
   1107     - add mappings to open files in a vsplit, see :help NERDTree-s and :help
   1108       NERDTree-gs
   1109     - make the statusline for the nerd tree window default to something
   1110       hopefully more useful. See :help 'NERDTreeStatusline'
   1111     Bugfixes:
   1112     - make the hijack netrw functionality work when vim is started with "vim
   1113       <some dir>" (thanks to Alf Mikula for the patch).
   1114     - fix a bug where the CWD wasnt being changed for some operations even when
   1115       NERDTreeChDirMode==2 (thanks to Lucas S. Buchala)
   1116     - add -bar to all the nerd tree :commands so they can chain with other
   1117       :commands (thanks to tpope)
   1118     - fix bugs when ignorecase was set (thanks to nach)
   1119     - fix a bug with the relative path code (thanks to nach)
   1120     - fix a bug where doing a :cd would cause :NERDTreeToggle to fail (thanks nach)
   1121 
   1122 
   1123 3.0.1
   1124     Bugfixes:
   1125     - fix bugs with :NERDTreeToggle and :NERDTreeMirror when 'hidden
   1126       was not set
   1127     - fix a bug where :NERDTree <path> would fail if <path> was relative and
   1128       didnt start with a ./ or ../  Thanks to James Kanze.
   1129     - make the q mapping work with secondary (:e <dir>  style) trees,
   1130       thanks to jamessan
   1131     - fix a bunch of small bugs with secondary trees
   1132 
   1133     More insane refactoring.
   1134 
   1135 3.0.0
   1136     - hijack netrw so that doing an :edit <directory>  will put a NERD tree in
   1137       the window rather than a netrw browser. See :help 'NERDTreeHijackNetrw'
   1138     - allow sharing of trees across tabs, see :help :NERDTreeMirror
   1139     - remove "top" and "bottom" as valid settings for NERDTreeWinPos
   1140     - change the '<tab>' mapping to 'i'
   1141     - change the 'H' mapping to 'I'
   1142     - lots of refactoring
   1143 
   1144 ==============================================================================
   1145 7. Credits                                                   *NERDTreeCredits*
   1146 
   1147 Thanks to the following people for testing, bug reports, ideas etc. Without
   1148 you I probably would have got bored of the hacking the NERD tree and
   1149 just downloaded pr0n instead.
   1150 
   1151     Tim Carey-Smith (halorgium)
   1152     Vigil
   1153     Nick Brettell
   1154     Thomas Scott Urban
   1155     Terrance Cohen
   1156     Yegappan Lakshmanan
   1157     Jason Mills
   1158     Michael Geddes (frogonwheels)
   1159     Yu Jun
   1160     Michael Madsen
   1161     AOYAMA Shotaro
   1162     Zhang Weiwu
   1163     Niels Aan de Brugh
   1164     Olivier Yiptong
   1165     Zhang Shuhan
   1166     Cory Echols
   1167     Piotr Czachur
   1168     Yuan Jiang
   1169     Matan Nassau
   1170     Maxim Kim
   1171     Charlton Wang
   1172     Matt Wozniski (godlygeek)
   1173     knekk
   1174     Sean Chou
   1175     Ryan Penn
   1176     Simon Peter Nicholls
   1177     Michael Foobar
   1178     Tomasz Chomiuk
   1179     Denis Pokataev
   1180     Tim Pope (tpope)
   1181     James Kanze
   1182     James Vega (jamessan)
   1183     Frederic Chanal (nach)
   1184     Alf Mikula
   1185     Lucas S. Buchala
   1186     Curtis Harvey
   1187     Guillaume Duranceau
   1188     Richard Hart (hates)
   1189 
   1190 ==============================================================================
   1191 8. License                                                   *NERDTreeLicense*
   1192 
   1193 The NERD tree is released under the wtfpl.
   1194 See http://sam.zoy.org/wtfpl/COPYING.