1 *NERD_tree.txt* A tree explorer plugin that owns your momma!
7 ________ ________ _ ____________ ____ __________ ____________~
8 /_ __/ / / / ____/ / | / / ____/ __ \/ __ \ /_ __/ __ \/ ____/ ____/~
9 / / / /_/ / __/ / |/ / __/ / /_/ / / / / / / / /_/ / __/ / __/ ~
10 / / / __ / /___ / /| / /___/ _, _/ /_/ / / / / _, _/ /___/ /___ ~
11 /_/ /_/ /_/_____/ /_/ |_/_____/_/ |_/_____/ /_/ /_/ |_/_____/_____/ ~
19 ==============================================================================
20 CONTENTS *NERDTree-contents*
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 filesystem menu...............|NERDTreeFilesysMenu|
31 3.Options.................................|NERDTreeOptions|
32 3.1.Option summary....................|NERDTreeOptionSummary|
33 3.2.Option details....................|NERDTreeOptionDetails|
34 4.Hacking the NERD tree...................|NERDTreeHacking|
35 5.About...................................|NERDTreeAbout|
36 6.Changelog...............................|NERDTreeChangelog|
37 7.Credits.................................|NERDTreeCredits|
38 8.License.................................|NERDTreeLicense|
40 ==============================================================================
43 What is this "NERD tree"??
45 The NERD tree allows you to explore your filesystem and to open files and
46 directories. It presents the filesystem to you in the form of a tree which you
47 manipulate with the keyboard and/or mouse. It also allows you to perform
48 simple filesystem operations.
50 The following features and functionality are provided by the NERD tree:
51 * Files and directories are displayed in a hierarchical tree structure
52 * Different highlighting is provided for the following types of nodes:
59 * Many (customisable) mappings are provided to manipulate the tree:
60 * Mappings to open/close/explore directory nodes
61 * Mappings to open files in new/existing windows/tabs
62 * Mappings to change the current root of the tree
63 * Mappings to navigate around the tree
65 * Directories and files can be bookmarked.
66 * Most NERD tree navigation can also be done with the mouse
67 * Filtering of tree content (can be toggled at runtime)
68 * custom file filters to prevent e.g. vim backup files being displayed
69 * optional displaying of hidden files (. files)
70 * files can be "turned off" so that only directories are displayed
71 * A textual filesystem menu is provided which allows you to
72 create/delete/move file and directory nodes as well as copy (for
74 * The position and size of the NERD tree window can be customised
75 * The order in which the nodes in the tree are listed can be customised.
76 * A model of your filesystem is created/maintained as you explore it. This
77 has several advantages:
78 * All filesystem information is cached and is only re-read on demand
79 * If you revisit a part of the tree that you left earlier in your
80 session, the directory nodes will be opened/closed as you left them
81 * The script remembers the cursor position and window position in the NERD
82 tree so you can toggle it off (or just close the tree window) and then
83 reopen it (with NERDTreeToggle) the NERD tree window will appear exactly
85 * You can have a separate NERD tree for each tab, share trees across tabs,
87 * By default the script overrides the default file browser (netw), so if
88 you :edit a directory a (slighly modified) NERD tree will appear in the
91 ==============================================================================
92 2. Functionality provided *NERDTreeFunctionality*
94 ------------------------------------------------------------------------------
95 2.1. Global Commands *NERDTreeGlobalCommands*
97 :NERDTree [<start-directory> | <bookmark>] *:NERDTree*
98 Opens a fresh NERD tree. The root of the tree depends on the argument
99 given. There are 3 cases: If no argument is given, the current directory
100 will be used. If a directory is given, that will be used. If a bookmark
101 name is given, the corresponding directory will be used. For example: >
102 :NERDTree /home/marty/vim7/src
103 :NERDTree foo (foo is the name of a bookmark)
105 :NERDTreeFromBookmark <bookmark> *:NERDTreeFromBookmark*
106 Opens a fresh NERD tree with the root initialized to the dir for
107 <bookmark>. This only reason to use this command over :NERDTree is for
108 the completion (which is for bookmarks rather than directories).
110 :NERDTreeToggle [<start-directory> | <bookmark>] *:NERDTreeToggle*
111 If a NERD tree already exists for this tab, it is reopened and rendered
112 again. If no NERD tree exists for this tab then this command acts the
113 same as the |:NERDTree| command.
115 :NERDTreeMirror *:NERDTreeMirror*
116 Shares an existing NERD tree, from another tab, in the current tab.
117 Changes made to one tree are reflected in both as they are actually the
120 If only one other NERD tree exists, that tree is automatically mirrored. If
121 more than one exists, the script will ask which tree to mirror.
123 :NERDTreeClose *:NERDTreeClose*
124 Close the NERD tree in this tab.
126 ------------------------------------------------------------------------------
127 2.2. Bookmarks *NERDTreeBookmarks*
129 Bookmarks in the NERD tree are a way to tag files or directories of interest.
130 For example, you could use bookmarks to tag all of your project directories.
132 ------------------------------------------------------------------------------
133 2.2.1. The Bookmark Table *NERDTreeBookmarkTable*
135 If the bookmark table is active (see |NERDTree-B| and
136 |'NERDTreeShowBookmarks'|), it will be rendered above the tree. You can double
137 click bookmarks or use the |NERDTree-o| mapping to activate them. See also,
138 |NERDTree-t| and |NERDTree-T|
140 ------------------------------------------------------------------------------
141 2.2.2. Bookmark commands *NERDTreeBookmarkCommands*
143 Note that the following commands are only available in the NERD tree buffer.
146 Bookmark the current node as <name>. If there is already a <name>
147 bookmark, it is overwritten. <name> must not contain spaces.
149 :BookmarkToRoot <bookmark>
150 Make the directory corresponding to <bookmark> the new root. If a treenode
151 corresponding to <bookmark> is already cached somewhere in the tree then
152 the current tree will be used, otherwise a fresh tree will be opened.
153 Note that if <bookmark> points to a file then its parent will be used
156 :RevealBookmark <bookmark>
157 If the node is cached under the current root then it will be revealed
158 (i.e. directory nodes above it will be opened) and the cursor will be
161 :OpenBookmark <bookmark>
162 <bookmark> must point to a file. The file is opened as though |NERDTree-o|
163 was applied. If the node is cached under the current root then it will be
164 revealed and the cursor will be placed on it.
166 :ClearBookmarks [<bookmarks>]
167 Remove all the given bookmarks. If no bookmarks are given then remove all
168 bookmarks on the current node.
171 Remove all bookmarks.
174 Re-read the bookmarks in the |'NERDTreeBookmarksFile'|.
176 See also |:NERDTree| and |:NERDTreeFromBookmark|.
178 ------------------------------------------------------------------------------
179 2.2.3. Invalid Bookmarks *NERDTreeInvalidBookmarks*
181 If invalid bookmarks are detected, the script will issue an error message and
182 the invalid bookmarks will become unavailable for use.
184 These bookmarks will still be stored in the bookmarks file (see
185 |'NERDTreeBookmarksFile'|), down the bottom. There will always be a blank line
186 after the valid bookmarks but before the invalid ones.
188 Each line in the bookmarks file represents one bookmark. The proper format is:
189 <bookmark name><space><full path to the bookmark location>
191 After you have corrected any invalid bookmarks, either restart vim, or go
192 :ReadBookmarks from the NERD tree window.
194 ------------------------------------------------------------------------------
195 2.3. NERD tree Mappings *NERDTreeMappings*
197 Default Description~ help-tag~
200 o.......Open files, directories and bookmarks....................|NERDTree-o|
201 go......Open selected file, but leave cursor in the NERDTree.....|NERDTree-go|
202 t.......Open selected node/bookmark in a new tab.................|NERDTree-t|
203 T.......Same as 't' but keep the focus on the current tab........|NERDTree-T|
204 i.......Open selected file in a split window.....................|NERDTree-i|
205 gi......Same as i, but leave the cursor on the NERDTree..........|NERDTree-gi|
206 s.......Open selected file in a new vsplit.......................|NERDTree-s|
207 gs......Same as s, but leave the cursor on the NERDTree..........|NERDTree-gs|
208 !.......Execute the current file.................................|NERDTree-!|
209 O.......Recursively open the selected directory..................|NERDTree-O|
210 x.......Close the current nodes parent...........................|NERDTree-x|
211 X.......Recursively close all children of the current node.......|NERDTree-X|
212 e.......Edit the current dif.....................................|NERDTree-e|
214 <CR>...............same as |NERDTree-o|.
215 double-click.......same as the |NERDTree-o| map.
216 middle-click.......same as |NERDTree-i| for files, same as
217 |NERDTree-e| for dirs.
219 D.......Delete the current bookmark .............................|NERDTree-D|
221 P.......Jump to the root node....................................|NERDTree-P|
222 p.......Jump to current nodes parent.............................|NERDTree-p|
223 K.......Jump up inside directories at the current tree depth.....|NERDTree-K|
224 J.......Jump down inside directories at the current tree depth...|NERDTree-J|
225 <C-J>...Jump down to the next sibling of the current directory...|NERDTree-C-J|
226 <C-K>...Jump up to the previous sibling of the current directory.|NERDTree-C-K|
228 C.......Change the tree root to the selected dir.................|NERDTree-C|
229 u.......Move the tree root up one directory......................|NERDTree-u|
230 U.......Same as 'u' except the old root node is left open........|NERDTree-U|
231 r.......Recursively refresh the current directory................|NERDTree-r|
232 R.......Recursively refresh the current root.....................|NERDTree-R|
233 m.......Display the filesystem menu..............................|NERDTree-m|
234 cd......Change the CWD to the dir of the selected node...........|NERDTree-cd|
236 I.......Toggle whether hidden files displayed....................|NERDTree-I|
237 f.......Toggle whether the file filters are used.................|NERDTree-f|
238 F.......Toggle whether files are displayed.......................|NERDTree-F|
239 B.......Toggle whether the bookmark table is displayed...........|NERDTree-B|
241 q.......Close the NERDTree window................................|NERDTree-q|
242 ?.......Toggle the display of the quick help.....................|NERDTree-?|
244 ------------------------------------------------------------------------------
247 Map option: NERDTreeMapActivateNode
248 Applies to: files and directories.
250 If a file node is selected, it is opened in the previous window.
252 If a directory is selected it is opened or closed depending on its current
255 If a bookmark that links to a directory is selected then that directory
256 becomes the new root.
258 If a bookmark that links to a file is selected then that file is opened in the
261 ------------------------------------------------------------------------------
267 If a file node is selected, it is opened in the previous window, but the
268 cursor does not move.
270 The key combo for this mapping is always "g" + NERDTreeMapActivateNode (see
273 ------------------------------------------------------------------------------
276 Map option: NERDTreeMapOpenInTab
277 Applies to: files and directories.
279 Opens the selected file in a new tab. If a directory is selected, a fresh
280 NERD Tree for that directory is opened in a new tab.
282 If a bookmark which points to a directory is selected, open a NERD tree for
283 that directory in a new tab. If the bookmark points to a file, open that file
286 ------------------------------------------------------------------------------
289 Map option: NERDTreeMapOpenInTabSilent
290 Applies to: files and directories.
292 The same as |NERDTree-t| except that the focus is kept in the current tab.
294 ------------------------------------------------------------------------------
297 Map option: NERDTreeMapOpenSplit
300 Opens the selected file in a new split window and puts the cursor in the new
303 ------------------------------------------------------------------------------
309 The same as |NERDTree-i| except that the cursor is not moved.
311 The key combo for this mapping is always "g" + NERDTreeMapOpenSplit (see
314 ------------------------------------------------------------------------------
317 Map option: NERDTreeMapOpenVSplit
320 Opens the selected file in a new vertically split window and puts the cursor in
323 ------------------------------------------------------------------------------
329 The same as |NERDTree-s| except that the cursor is not moved.
331 The key combo for this mapping is always "g" + NERDTreeMapOpenVSplit (see
334 ------------------------------------------------------------------------------
337 Map option: NERDTreeMapExecute
340 Executes the selected file, prompting for arguments first.
342 ------------------------------------------------------------------------------
345 Map option: NERDTreeMapOpenRecursively
346 Applies to: directories.
348 Recursively opens the selelected directory.
350 All files and directories are cached, but if a directory would not be
351 displayed due to file filters (see |'NERDTreeIgnore'| |NERDTree-f|) or the
352 hidden file filter (see |'NERDTreeShowHidden'|) then its contents are not
353 cached. This is handy, especially if you have .svn directories.
355 ------------------------------------------------------------------------------
358 Map option: NERDTreeMapCloseDir
359 Applies to: files and directories.
361 Closes the parent of the selected node.
363 ------------------------------------------------------------------------------
366 Map option: NERDTreeMapCloseChildren
367 Applies to: directories.
369 Recursively closes all children of the selected directory.
371 Tip: To quickly "reset" the tree, use |NERDTree-P| with this mapping.
373 ------------------------------------------------------------------------------
376 Map option: NERDTreeMapOpenExpl
377 Applies to: files and directories.
379 |:edit|s the selected directory, or the selected file's directory. This could
380 result in a NERD tree or a netrw being opened, depending on
381 |'NERDTreeHijackNetrw'|.
383 ------------------------------------------------------------------------------
386 Map option: NERDTreeMapDeleteBookmark
387 Applies to: lines in the bookmarks table
389 Deletes the currently selected bookmark.
391 ------------------------------------------------------------------------------
394 Map option: NERDTreeMapJumpRoot
395 Applies to: no restrictions.
397 Jump to the tree root.
399 ------------------------------------------------------------------------------
402 Map option: NERDTreeMapJumpParent
403 Applies to: files and directories.
405 Jump to the parent node of the selected node.
407 ------------------------------------------------------------------------------
410 Map option: NERDTreeMapJumpFirstChild
411 Applies to: files and directories.
413 Jump to the first child of the current nodes parent.
415 If the cursor is already on the first node then do the following:
416 * loop back thru the siblings of the current nodes parent until we find an
417 open dir with children
418 * go to the first child of that node
420 ------------------------------------------------------------------------------
423 Map option: NERDTreeMapJumpLastChild
424 Applies to: files and directories.
426 Jump to the last child of the current nodes parent.
428 If the cursor is already on the last node then do the following:
429 * loop forward thru the siblings of the current nodes parent until we find
430 an open dir with children
431 * go to the last child of that node
433 ------------------------------------------------------------------------------
436 Map option: NERDTreeMapJumpNextSibling
437 Applies to: files and directories.
439 Jump to the next sibling of the selected node.
441 ------------------------------------------------------------------------------
444 Map option: NERDTreeMapJumpPrevSibling
445 Applies to: files and directories.
447 Jump to the previous sibling of the selected node.
449 ------------------------------------------------------------------------------
452 Map option: NERDTreeMapChdir
453 Applies to: directories.
455 Make the selected directory node the new tree root. If a file is selected, its
458 ------------------------------------------------------------------------------
461 Map option: NERDTreeMapUpdir
462 Applies to: no restrictions.
464 Move the tree root up a dir (like doing a "cd ..").
466 ------------------------------------------------------------------------------
469 Map option: NERDTreeMapUpdirKeepOpen
470 Applies to: no restrictions.
472 Like |NERDTree-u| except that the old tree root is kept open.
474 ------------------------------------------------------------------------------
477 Map option: NERDTreeMapRefresh
478 Applies to: files and directories.
480 If a dir is selected, recursively refresh that dir, i.e. scan the filesystem
481 for changes and represent them in the tree.
483 If a file node is selected then the above is done on it's parent.
485 ------------------------------------------------------------------------------
488 Map option: NERDTreeMapRefreshRoot
489 Applies to: no restrictions.
491 Recursively refresh the tree root.
493 ------------------------------------------------------------------------------
496 Map option: NERDTreeMapFilesystemMenu
497 Applies to: files and directories.
499 Display the filesystem menu. See |NERDTreeFilesysMenu| for details.
501 ------------------------------------------------------------------------------
504 Map option: NERDTreeMapChdir
505 Applies to: files and directories.
507 Change vims current working directory to that of the selected node.
509 ------------------------------------------------------------------------------
512 Map option: NERDTreeMapToggleHidden
513 Applies to: no restrictions.
515 Toggles whether hidden files (i.e. "dot files") are displayed.
517 ------------------------------------------------------------------------------
520 Map option: NERDTreeMapToggleFilters
521 Applies to: no restrictions.
523 Toggles whether file filters are used. See |'NERDTreeIgnore'| for details.
525 ------------------------------------------------------------------------------
528 Map option: NERDTreeMapToggleFiles
529 Applies to: no restrictions.
531 Toggles whether file nodes are displayed.
533 ------------------------------------------------------------------------------
536 Map option: NERDTreeMapToggleBookmarks
537 Applies to: no restrictions.
539 Toggles whether the bookmarks table is displayed.
541 ------------------------------------------------------------------------------
544 Map option: NERDTreeMapQuit
545 Applies to: no restrictions.
547 Closes the NERDtree window.
549 ------------------------------------------------------------------------------
552 Map option: NERDTreeMapHelp
553 Applies to: no restrictions.
555 Toggles whether the quickhelp is displayed.
557 ------------------------------------------------------------------------------
558 2.3. The filesystem menu *NERDTreeFilesysMenu*
560 The purpose of the filesystem menu is to allow you to perform basic filesystem
561 operations quickly from the NERD tree rather than the console.
563 The filesystem menu can be accessed with 'm' mapping and has four supported
571 To add a node move the cursor onto (or anywhere inside) the directory you wish
572 to create the new node inside. Select the 'add node' option from the
573 filesystem menu and type a filename. If the filename you type ends with a '/'
574 character then a directory will be created. Once the operation is completed,
575 the cursor is placed on the new node.
578 To move/rename a node, put the cursor on it and select the 'move' option from
579 the filesystem menu. Enter the new location for the node and it will be
580 moved. If the old file is open in a buffer, you will be asked if you wish to
581 delete that buffer. Once the operation is complete the cursor will be placed
585 To delete a node put the cursor on it and select the 'delete' option from the
586 filesystem menu. After confirmation the node will be deleted. If a file is
587 deleted but still exists as a buffer you will be given the option to delete
591 To copy a node put the cursor on it and select the 'copy' option from the
592 filesystem menu. Enter the new location and you're done. Note: copying is
593 currently only supported for *nix operating systems. If someone knows a
594 one line copying command for windows that doesnt require user confirmation
595 then id be grateful if you'd email me.
597 ==============================================================================
598 3. Customisation *NERDTreeOptions*
601 ------------------------------------------------------------------------------
602 3.1. Customisation summary *NERDTreeOptionSummary*
604 The script provides the following options that can customise the behaviour the
605 NERD tree. These options should be set in your vimrc.
607 |'loaded_nerd_tree'| Turns off the script.
609 |'NERDChristmasTree'| Tells the NERD tree to make itself colourful
612 |'NERDTreeAutoCenter'| Controls whether the NERD tree window centers
613 when the cursor moves within a specified
614 distance to the top/bottom of the window.
615 |'NERDTreeAutoCenterThreshold'| Controls the sensitivity of autocentering.
617 |'NERDTreeCaseSensitiveSort'| Tells the NERD tree whether to be case
618 sensitive or not when sorting nodes.
620 |'NERDTreeChDirMode'| Tells the NERD tree if/when it should change
621 vim's current working directory.
623 |'NERDTreeHighlightCursorline'| Tell the NERD tree whether to highlight the
626 |'NERDTreeHijackNetrw'| Tell the NERD tree whether to replace the netrw
627 autocommands for exploring local directories.
629 |'NERDTreeIgnore'| Tells the NERD tree which files to ignore.
631 |'NERDTreeBookmarksFile'| Where the bookmarks are stored.
633 |'NERDTreeMouseMode'| Tells the NERD tree how to handle mouse
636 |'NERDTreeQuitOnOpen'| Closes the tree window after opening a file.
638 |'NERDTreeShowBookmarks'| Tells the NERD tree whether to display the
639 bookmarks table on startup.
641 |'NERDTreeShowFiles'| Tells the NERD tree whether to display files
642 in the tree on startup.
644 |'NERDTreeShowHidden'| Tells the NERD tree whether to display hidden
647 |'NERDTreeShowLineNumbers'| Tells the NERD tree whether to display line
648 numbers in the tree window.
650 |'NERDTreeSortOrder'| Tell the NERD tree how to sort the nodes in
653 |'NERDTreeStatusline'| Set a statusline for NERD tree windows.
655 |'NERDTreeWinPos'| Tells the script where to put the NERD tree
658 |'NERDTreeWinSize'| Sets the window size when the NERD tree is
661 ------------------------------------------------------------------------------
662 3.2. Customisation details *NERDTreeOptionDetails*
664 To enable any of the below options you should put the given line in your
668 If this plugin is making you feel homicidal, it may be a good idea to turn it
669 off with this line in your vimrc: >
670 let loaded_nerd_tree=1
672 ------------------------------------------------------------------------------
673 *'NERDChristmasTree'*
677 If this option is set to 1 then some extra syntax highlighting elements are
678 added to the nerd tree to make it more colourful.
680 Set it to 0 for a more vanilla looking tree.
682 ------------------------------------------------------------------------------
683 *'NERDTreeAutoCenter'*
687 If set to 1, the NERD tree window will center around the cursor if it moves to
688 within |'NERDTreeAutoCenterThreshold'| lines of the top/bottom of the window.
690 This is ONLY done in response to tree navigation mappings,
691 i.e. |NERDTree-J| |NERDTree-K| |NERDTree-C-J| |NERDTree-C-K| |NERDTree-p|
694 The centering is done with a |zz| operation.
696 ------------------------------------------------------------------------------
697 *'NERDTreeAutoCenterThreshold'*
698 Values: Any natural number.
701 This option controls the "sensitivity" of the NERD tree auto centering. See
702 |'NERDTreeAutoCenter'| for details.
704 ------------------------------------------------------------------------------
705 *'NERDTreeCaseSensitiveSort'*
709 By default the NERD tree does not sort nodes case sensitively, i.e. nodes
710 could appear like this: >
717 But, if you set this option to 1 then the case of the nodes will be taken into
718 account. The above nodes would then be sorted like this: >
725 ------------------------------------------------------------------------------
726 *'NERDTreeChDirMode'*
731 Use this option to tell the script when (if at all) to change the current
732 working directory (CWD) for vim.
734 If it is set to 0 then the CWD is never changed by the NERD tree.
736 If set to 1 then the CWD is changed when the NERD tree is first loaded to the
737 directory it is initialized in. For example, if you start the NERD tree with >
738 :NERDTree /home/marty/foobar
740 then the CWD will be changed to /home/marty/foobar and will not be changed
741 again unless you init another NERD tree with a similar command.
743 If the option is set to 2 then it behaves the same as if set to 1 except that
744 the CWD is changed whenever the tree root is changed. For example, if the CWD
745 is /home/marty/foobar and you make the node for /home/marty/foobar/baz the new
746 root then the CWD will become /home/marty/foobar/baz.
748 ------------------------------------------------------------------------------
749 *'NERDTreeHighlightCursorline'*
753 If set to 1, the current cursor line in the NERD tree buffer will be
754 highlighted. This is done using the |'cursorline'| option.
756 ------------------------------------------------------------------------------
757 *'NERDTreeHijackNetrw'*
761 If set to 1, doing a >
762 :edit <some directory>
764 will open up a "secondary" NERD tree instead of a netrw in the target window.
766 Secondary NERD trees behaves slighly different from a regular trees in the
768 1. 'o' will open the selected file in the same window as the tree,
770 2. you can have as many secondary tree as you want in the same tab.
772 ------------------------------------------------------------------------------
774 Values: a list of regular expressions.
777 This option is used to specify which files the NERD tree should ignore. It
778 must be a list of regular expressions. When the NERD tree is rendered, any
779 files/dirs that match any of the regex's in 'NERDTreeIgnore' wont be
782 For example if you put the following line in your vimrc: >
783 let NERDTreeIgnore=['\.vim$', '\~$']
785 then all files ending in .vim or ~ will be ignored.
787 Note: to tell the NERD tree not to ignore any files you must use the following
789 let NERDTreeIgnore=[]
792 The file filters can be turned on and off dynamically with the |NERDTree-f|
795 ------------------------------------------------------------------------------
796 *'NERDTreeBookmarksFile'*
798 Default: $HOME/.NERDTreeBookmarks
800 This is where bookmarks are saved. See |NERDTreeBookmarkCommands|.
802 ------------------------------------------------------------------------------
803 *'NERDTreeMouseMode'*
807 If set to 1 then a double click on a node is required to open it.
808 If set to 2 then a single click will open directory nodes, while a double
809 click will still be required for file nodes.
810 If set to 3 then a single click will open any node.
812 Note: a double click anywhere on a line that a tree node is on will
813 activate it, but all single-click activations must be done on name of the node
814 itself. For example, if you have the following node: >
817 then (to single click activate it) you must click somewhere in
820 ------------------------------------------------------------------------------
821 *'NERDTreeQuitOnOpen'*
826 If set to 1, the NERD tree window will close after opening a file with the
827 |NERDTree-o| or |NERDTree-i| mappings.
829 ------------------------------------------------------------------------------
830 *'NERDTreeShowBookmarks'*
834 If this option is set to 1 then the bookmarks table will be displayed.
836 This option can be toggled dynamically, per tree, with the |NERDTree-B|
839 ------------------------------------------------------------------------------
840 *'NERDTreeShowFiles'*
844 If this option is set to 1 then files are displayed in the NERD tree. If it is
845 set to 0 then only directories are displayed.
847 This option can be toggled dynamically, per tree, with the |NERDTree-F|
848 mapping and is useful for drastically shrinking the tree when you are
849 navigating to a different part of the tree.
851 ------------------------------------------------------------------------------
852 *'NERDTreeShowHidden'*
856 This option tells vim whether to display hidden files by default. This option
857 can be dynamically toggled, per tree, with the |NERDTree-I| mapping. Use one
858 of the follow lines to set this option: >
859 let NERDTreeShowHidden=0
860 let NERDTreeShowHidden=1
863 ------------------------------------------------------------------------------
864 *'NERDTreeShowLineNumbers'*
868 This option tells vim whether to display line numbers for the NERD tree
869 window. Use one of the follow lines to set this option: >
870 let NERDTreeShowLineNumbers=0
871 let NERDTreeShowLineNumbers=1
874 ------------------------------------------------------------------------------
875 *'NERDTreeSortOrder'*
876 Values: a list of regular expressions.
877 Default: ['\/$', '*', '\.swp$', '\.bak$', '\~$']
879 This option is set to a list of regular expressions which are used to
880 specify the order of nodes under their parent.
882 For example, if the option is set to: >
883 ['\.vim$', '\.c$', '\.h$', '*', 'foobar']
885 then all .vim files will be placed at the top, followed by all .c files then
886 all .h files. All files containing the string 'foobar' will be placed at the
887 end. The star is a special flag: it tells the script that every node that
888 doesnt match any of the other regexps should be placed here.
890 If no star is present in 'NERDTreeSortOrder' then one is automatically
891 appended to the array.
893 The regex '\/$' should be used to match directory nodes.
895 After this sorting is done, the files in each group are sorted alphabetically.
900 (3) ['\/$', '\.rb$', '\.php$', '*', '\.swp$', '\.bak$', '\~$']
902 1. Directories will appear last, everything else will appear above.
903 2. Everything will simply appear in alphabetical order.
904 3. Dirs will appear first, then ruby and php. Swap files, bak files and vim
905 backup files will appear last with everything else preceding them.
907 ------------------------------------------------------------------------------
908 *'NERDTreeStatusline'*
909 Values: Any valid statusline setting.
910 Default: %{b:NERDTreeRoot.path.strForOS(0)}
912 Tells the script what to use as the |'statusline'| setting for NERD tree
915 Note that the statusline is set using |:let-&| not |:set| so escaping spaces
918 Setting this option to -1 will will deactivate it so that your global
919 statusline setting is used instead.
921 ------------------------------------------------------------------------------
923 Values: "left" or "right"
926 This option is used to determine where NERD tree window is placed on the
929 This option makes it possible to use two different explorer plugins
930 simultaneously. For example, you could have the taglist plugin on the left of
931 the window and the NERD tree on the right.
933 ------------------------------------------------------------------------------
935 Values: a positive integer.
938 This option is used to change the size of the NERD tree when it is loaded.
940 ==============================================================================
941 4. Hacking the NERD tree *NERDTreeHacking*
945 The script provides 2 public functions for your hacking pleasure. Their
947 function! NERDTreeGetCurrentNode()
948 function! NERDTreeGetCurrentPath()
950 The first returns the node object that the cursor is currently on, while the
951 second returns the corresponding path object.
953 This is probably a good time to mention that the script implements prototype
954 style OO. To see the functions that each class provides you can read look at
957 Use the node objects to manipulate the structure of the tree. Use the path
958 objects to access the files/directories the tree nodes represent.
960 The NERD tree filetype ~
962 NERD tree buffers have a filetype of "nerdtree". You can use this to hack the
963 NERD tree via autocommands (on |FileType|) or via an ftplugin.
965 For example, putting this code in ~/.vim/ftplugin/nerdtree.vim would override
966 the o mapping, making it open the selected node in a new gvim instance. >
968 nnoremap <silent> <buffer> o :call <sid>openInNewVimInstance()<cr>
969 function! s:openInNewVimInstance()
970 let p = NERDTreeGetCurrentPath()
972 silent exec "!gvim " . p.strForOS(1) . "&"
976 This way you can add new mappings or :commands or override any existing
979 ==============================================================================
980 5. About *NERDTreeAbout*
982 The author of the NERD tree is a terrible terrible monster called Martyzilla
983 who gobbles up small children with milk and sugar for breakfast.
985 He can be reached at martin_grenfell at msn.com. He would love to hear from
986 you, so feel free to send him suggestions and/or comments about this plugin.
987 Don't be shy --- the worst he can do is slaughter you and stuff you in the
990 The latest stable versions can be found at
991 http://www.vim.org/scripts/script.php?script_id=1658
993 The latest dev versions are on github
994 http://github.com/scrooloose/nerdtree
997 ==============================================================================
998 6. Changelog *NERDTreeChangelog*
1001 - fix a bug where a non-listed no-name buffer was getting created every
1002 time the tree windows was created, thanks to Derek Wyatt and owen1
1003 - make <CR> behave the same as the 'o' mapping
1004 - some helptag fixes in the doc, thanks strull
1005 - fix a bug when using :set nohidden and opening a file where the previous
1006 buf was modified. Thanks iElectric
1011 - add mappings to open files in a vsplit, see :help NERDTree-s and :help
1013 - make the statusline for the nerd tree window default to something
1014 hopefully more useful. See :help 'NERDTreeStatusline'
1016 - make the hijack netrw functionality work when vim is started with "vim
1017 <some dir>" (thanks to Alf Mikula for the patch).
1018 - fix a bug where the CWD wasnt being changed for some operations even when
1019 NERDTreeChDirMode==2 (thanks to Lucas S. Buchala)
1020 - add -bar to all the nerd tree :commands so they can chain with other
1021 :commands (thanks to tpope)
1022 - fix bugs when ignorecase was set (thanks to nach)
1023 - fix a bug with the relative path code (thanks to nach)
1024 - fix a bug where doing a :cd would cause :NERDTreeToggle to fail (thanks nach)
1029 - fix bugs with :NERDTreeToggle and :NERDTreeMirror when 'hidden
1031 - fix a bug where :NERDTree <path> would fail if <path> was relative and
1032 didnt start with a ./ or ../ Thanks to James Kanze.
1033 - make the q mapping work with secondary (:e <dir> style) trees,
1035 - fix a bunch of small bugs with secondary trees
1037 More insane refactoring.
1040 - hijack netrw so that doing an :edit <directory> will put a NERD tree in
1041 the window rather than a netrw browser. See :help 'NERDTreeHijackNetrw'
1042 - allow sharing of trees across tabs, see :help :NERDTreeMirror
1043 - remove "top" and "bottom" as valid settings for NERDTreeWinPos
1044 - change the '<tab>' mapping to 'i'
1045 - change the 'H' mapping to 'I'
1046 - lots of refactoring
1048 ==============================================================================
1049 7. Credits *NERDTreeCredits*
1051 Thanks to the following people for testing, bug reports, ideas etc. Without
1052 you I probably would have got bored of the hacking the NERD tree and
1053 just downloaded pr0n instead.
1055 Tim Carey-Smith (halorgium)
1062 Michael Geddes (frogonwheels)
1076 Matt Wozniski (godlygeek)
1080 Simon Peter Nicholls
1086 James Vega (jamessan)
1087 Frederic Chanal (nach)
1091 ==============================================================================
1092 8. License *NERDTreeLicense*
1094 The NERD tree is released under the wtfpl.
1095 See http://sam.zoy.org/wtfpl/COPYING.