A tree explorer plugin for vim.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1085 lines
45 KiB

16 years ago
  1. *NERD_tree.txt* A tree explorer plugin that owns your momma!
  2. omg its ... ~
  3. ________ ________ _ ____________ ____ __________ ____________~
  4. /_ __/ / / / ____/ / | / / ____/ __ \/ __ \ /_ __/ __ \/ ____/ ____/~
  5. / / / /_/ / __/ / |/ / __/ / /_/ / / / / / / / /_/ / __/ / __/ ~
  6. / / / __ / /___ / /| / /___/ _, _/ /_/ / / / / _, _/ /___/ /___ ~
  7. /_/ /_/ /_/_____/ /_/ |_/_____/_/ |_/_____/ /_/ /_/ |_/_____/_____/ ~
  8. Reference Manual~
  9. ==============================================================================
  10. CONTENTS *NERDTree-contents*
  11. 1.Intro...................................|NERDTree|
  12. 2.Functionality provided..................|NERDTreeFunctionality|
  13. 2.1 Global commands...................|NERDTreeGlobalCommands|
  14. 2.2 Bookmark commands.................|NERDTreeBookmarkCommands|
  15. 2.3 NERD tree mappings................|NERDTreeMappings|
  16. 2.4 The filesystem menu...............|NERDTreeFilesysMenu|
  17. 3.Options.................................|NERDTreeOptions|
  18. 3.1 Option summary....................|NERDTreeOptionSummary|
  19. 3.2 Option details....................|NERDTreeOptionDetails|
  20. 4.Public functions........................|NERDTreePublicFunctions|
  21. 5.TODO list...............................|NERDTreeTodo|
  22. 6.The Author..............................|NERDTreeAuthor|
  23. 7.Changelog...............................|NERDTreeChangelog|
  24. 8.Credits.................................|NERDTreeCredits|
  25. ==============================================================================
  26. 1. Intro *NERDTree*
  27. What is this "NERD tree"??
  28. The NERD tree allows you to explore your filesystem and to open files and
  29. directories. It presents the filesystem to you in the form of a tree which you
  30. manipulate with the keyboard and/or mouse. It also allows you to perform
  31. simple filesystem operations so you can alter the tree dynamically.
  32. The following features and functionality are provided by the NERD tree:
  33. * Files and directories are displayed in a hierarchical tree structure
  34. * Different highlighting is provided for the following types of nodes:
  35. * files
  36. * directories
  37. * sym-links
  38. * windows .lnk files
  39. * read-only files
  40. * Many (customisable) mappings are provided to manipulate the tree:
  41. * Mappings to open/close/explore directory nodes
  42. * Mappings to open files in new/existing windows/tabs
  43. * Mappings to change the current root of the tree
  44. * Mappings to navigate around the tree
  45. * ...
  46. * Directories and files can be bookmarked.
  47. * Most NERD tree navigation can also be done with the mouse
  48. * Dynamic customisation of tree content
  49. * custom file filters to prevent e.g. vim backup files being displayed
  50. * optional displaying of hidden files (. files)
  51. * files can be "turned off" so that only directories are displayed
  52. * A textual filesystem menu is provided which allows you to
  53. create/delete/rename file and directory nodes as well as copy (for
  54. supported OSs)
  55. * The position and size of the NERD tree window can be customised
  56. * The order in which the nodes in the tree are listed can be customised.
  57. * A model of your filesystem is created/maintained as you explore it. This
  58. has several advantages:
  59. * All filesystem information is cached and is only re-read on demand
  60. * If you revisit a part of the tree that you left earlier in your
  61. session, the directory nodes will be opened/closed as you left them
  62. * The script remembers the cursor position and window position in the NERD
  63. tree so you can toggle it off (or just close the tree window) and then
  64. reopen it (with NERDTreeToggle) the NERD tree window will appear EXACTLY
  65. as you left it
  66. * You can have a separate NERD tree for each tab
  67. ==============================================================================
  68. 2. Functionality provided *NERDTreeFunctionality*
  69. ------------------------------------------------------------------------------
  70. 2.1. Global Commands *NERDTreeGlobalCommands*
  71. :NERDTree [<start-directory> | <bookmark>] *:NERDTree*
  72. Opens a fresh NERD tree. The root of the tree depends on the argument
  73. given. There are 3 cases: If no argument is given, the current directory
  74. will be used. If a directory is given, that will be used. If a bookmark
  75. name is given, the corresponding directory will be used. For example: >
  76. :NERDTree /home/marty/vim7/src
  77. :NERDTree foo (foo is the name of a bookmark)
  78. <
  79. :NERDTreeFromBookmark <bookmark> *:NERDTreeFromBookmark*
  80. Opens a fresh NERD tree with the root initialized to the dir for
  81. <bookmark>. This only reason to use this command over :NERDTree is for
  82. the completion (which is for bookmarks rather than directories).
  83. :NERDTreeToggle [<start-directory> | <bookmark>] *:NERDTreeToggle*
  84. If a NERD tree already exists for this tab, it is reopened and rendered
  85. again. If no NERD tree exists for this tab then this command acts the
  86. same as the |:NERDTree| command.
  87. :NERDTreeClose
  88. Close the NERD tree in this tab.
  89. ------------------------------------------------------------------------------
  90. 2.2. Bookmark Commands *NERDTreeBookmarkCommands*
  91. Bookmarks in the NERD tree are a way to tag files or directories of interest.
  92. For example, you could use bookmarks to tag all of your project directories.
  93. See also |:NERDTree| and |:NERDTreeFromBookmark|.
  94. Note that the following commands are only available in the NERD tree buffer.
  95. :Bookmark <name>
  96. Bookmark the current node as <name>. If there is already a <name>
  97. bookmark, it is overwritten. <name> must consist of alphanumeric
  98. characters and underscores.
  99. :BookmarkToRoot <bookmark>
  100. Make the directory corresponding to <bookmark> the new root. If a treenode
  101. corresponding to <bookmark> is already cached somewhere in the tree then
  102. the current tree will be used, otherwise a fresh tree will be opened.
  103. Note that if <bookmark> points to a file then its parent will be used
  104. instead.
  105. :RevealBookmark <bookmark>
  106. If the node is cached under the current root then it will be revealed
  107. (i.e. directory nodes above it will be opened) and the cursor will be
  108. placed on it.
  109. :OpenBookmark <bookmark>
  110. <bookmark> must point to a file. The file is opened as though |NERDTree-o|
  111. was applied. If the node is cached under the current root then it will be
  112. revealed and the cursor will be placed on it.
  113. :ClearBookmarks [<bookmarks>]
  114. Remove all the given bookmarks. If no bookmarks are given then remove all
  115. bookmarks on the current node.
  116. :ClearAllBookmarks
  117. Remove all bookmarks.
  118. ------------------------------------------------------------------------------
  119. 2.3. NERD tree Mappings *NERDTreeMappings*
  120. Default Description~ help-tag~
  121. Key~
  122. o.......Open selected file, or expand selected dir...............|NERDTree-o|
  123. go......Open selected file, but leave cursor in the NERDTree.....|NERDTree-go|
  124. t.......Open selected node in a new tab..........................|NERDTree-t|
  125. T.......Same as 't' but keep the focus on the current tab........|NERDTree-T|
  126. <tab>...Open selected file in a split window.....................|NERDTree-tab|
  127. g<tab>..Same as <tab>, but leave the cursor on the NERDTree......|NERDTree-gtab|
  128. !.......Execute the current file.................................|NERDTree-!|
  129. O.......Recursively open the selected directory..................|NERDTree-O|
  130. x.......Close the current nodes parent...........................|NERDTree-x|
  131. X.......Recursively close all children of the current node.......|NERDTree-X|
  132. e.......Open a netrw for the current dir.........................|NERDTree-e|
  133. double-click.......same as the |NERDTree-o| map.
  134. middle-click.......same as |NERDTree-tab| for files, same as
  135. |NERDTree-e| for dirs.
  136. P.......Jump to the root node....................................|NERDTree-P|
  137. p.......Jump to current nodes parent.............................|NERDTree-p|
  138. K.......Jump up inside directories at the current tree depth.....|NERDTree-K|
  139. J.......Jump down inside directories at the current tree depth...|NERDTree-J|
  140. <C-j>...Jump down to the next sibling of the current directory...|NERDTree-c-j|
  141. <C-k>...Jump up to the previous sibling of the current directory.|NERDTree-c-k|
  142. C.......Change the tree root to the selected dir.................|NERDTree-C|
  143. u.......Move the tree root up one directory......................|NERDTree-u|
  144. U.......Same as 'u' except the old root node is left open........|NERDTree-U|
  145. r.......Recursively refresh the current directory................|NERDTree-r|
  146. R.......Recursively refresh the current root.....................|NERDTree-R|
  147. m.......Display the filesystem menu..............................|NERDTree-m|
  148. cd......Change the CWD to the dir of the selected node...........|NERDTree-cd|
  149. H.......Toggle whether hidden files displayed....................|NERDTree-H|
  150. f.......Toggle whether the file filters are used.................|NERDTree-f|
  151. F.......Toggle whether files are displayed.......................|NERDTree-F|
  152. q.......Close the NERDTree window................................|NERDTree-q|
  153. ?.......Toggle the display of the quick help.....................|NERDTree-?|
  154. ------------------------------------------------------------------------------
  155. *NERDTree-o*
  156. Default key: o
  157. Map option: NERDTreeMapActivateNode
  158. Applies to: files and directories.
  159. If a file node is selected, it is opened in the previous window. If a
  160. directory is selected it is opened or closed depending on its current state.
  161. ------------------------------------------------------------------------------
  162. *NERDTree-go*
  163. Default key: go
  164. Map option: None
  165. Applies to: files.
  166. If a file node is selected, it is opened in the previous window, but the
  167. cursor does not move.
  168. The key combo for this mapping is always "g" + NERDTreeMapActivateNode (see
  169. |NERDTree-o|).
  170. ------------------------------------------------------------------------------
  171. *NERDTree-t*
  172. Default key: t
  173. Map option: NERDTreeMapOpenInTab
  174. Applies to: files and directories.
  175. Opens the selected file in a new tab. If a directory is selected, a netrw is
  176. opened in a new tab.
  177. ------------------------------------------------------------------------------
  178. *NERDTree-T*
  179. Default key: T
  180. Map option: NERDTreeMapOpenInTabSilent
  181. Applies to: files and directories.
  182. The same as |NERDTree-t| except that the focus is kept in the current tab.
  183. ------------------------------------------------------------------------------
  184. *NERDTree-tab*
  185. Default key: <tab>
  186. Map option: NERDTreeMapOpenSplit
  187. Applies to: files.
  188. Opens the selected file in a new split window and puts the cursor in the new
  189. window.
  190. ------------------------------------------------------------------------------
  191. *NERDTree-gtab*
  192. Default key: g<tab>
  193. Map option: None
  194. Applies to: files.
  195. The same as |NERDTree-tab| except that the cursor is not moved.
  196. The key combo for this mapping is always "g" + NERDTreeMapOpenSplit (see
  197. |NERDTree-tab|).
  198. ------------------------------------------------------------------------------
  199. *NERDTree-!*
  200. Default key: !
  201. Map option: NERDTreeMapExecute
  202. Applies to: files.
  203. Executes the selected file, prompting for arguments first.
  204. ------------------------------------------------------------------------------
  205. *NERDTree-O*
  206. Default key: O
  207. Map option: NERDTreeMapOpenRecursively
  208. Applies to: directories.
  209. Recursively opens the selelected directory.
  210. All files and directories are cached, but if a directory would not be
  211. displayed due to file filters (see |NERDTreeIgnore| |NERDTree-f|) or the
  212. hidden file filter (see |NERDTreeShowHidden|) then it is not opened. This is
  213. handy, especially if you have .svn directories.
  214. ------------------------------------------------------------------------------
  215. *NERDTree-x*
  216. Default key: x
  217. Map option: NERDTreeMapCloseDir
  218. Applies to: files and directories.
  219. Closes the parent of the selected node.
  220. ------------------------------------------------------------------------------
  221. *NERDTree-X*
  222. Default key: X
  223. Map option: NERDTreeMapCloseChildren
  224. Applies to: directories.
  225. Recursively closes all children of the selected directory.
  226. Tip: To quickly "reset" the tree, use |NERDTree-P| with this mapping.
  227. ------------------------------------------------------------------------------
  228. *NERDTree-e*
  229. Default key: e
  230. Map option: NERDTreeMapOpenExpl
  231. Applies to: files and directories.
  232. Opens a netrw on the selected directory, or the selected file's directory.
  233. ------------------------------------------------------------------------------
  234. *NERDTree-P*
  235. Default key: P
  236. Map option: NERDTreeMapJumpRoot
  237. Applies to: no restrictions.
  238. Jump to the tree root.
  239. ------------------------------------------------------------------------------
  240. *NERDTree-p*
  241. Default key: p
  242. Map option: NERDTreeMapJumpParent
  243. Applies to: files and directories.
  244. Jump to the parent node of the selected node.
  245. ------------------------------------------------------------------------------
  246. *NERDTree-K*
  247. Default key: K
  248. Map option: NERDTreeMapJumpFirstChild
  249. Applies to: files and directories.
  250. Jump to the first child of the current nodes parent.
  251. If the cursor is already on the first node then do the following:
  252. * loop back thru the siblings of the current nodes parent until we find an
  253. open dir with children
  254. * go to the first child of that node
  255. ------------------------------------------------------------------------------
  256. *NERDTree-J*
  257. Default key: J
  258. Map option: NERDTreeMapJumpLastChild
  259. Applies to: files and directories.
  260. Jump to the last child of the current nodes parent.
  261. If the cursor is already on the last node then do the following:
  262. * loop forward thru the siblings of the current nodes parent until we find
  263. an open dir with children
  264. * go to the last child of that node
  265. ------------------------------------------------------------------------------
  266. *NERDTree-c-j*
  267. Default key: <C-j>
  268. Map option: NERDTreeMapJumpNextSibling
  269. Applies to: files and directories.
  270. If a dir node is selected, jump to the next sibling of that node.
  271. If a file node is selected, jump to the next sibling of that nodes parent.
  272. ------------------------------------------------------------------------------
  273. *NERDTree-c-k*
  274. Default key: <C-k>
  275. Map option: NERDTreeMapJumpPrevSibling
  276. Applies to: files and directories.
  277. If a dir node is selected, jump to the previous sibling of that node.
  278. If a file node is selected, jump to the previous sibling of that nodes parent.
  279. ------------------------------------------------------------------------------
  280. *NERDTree-C*
  281. Default key: C
  282. Map option: NERDTreeMapChdir
  283. Applies to: directories.
  284. Make the selected directory node the new tree root. If a file is selected, its
  285. parent is used.
  286. ------------------------------------------------------------------------------
  287. *NERDTree-u*
  288. Default key: u
  289. Map option: NERDTreeMapUpdir
  290. Applies to: no restrictions.
  291. Move the tree root up a dir (like doing a "cd ..").
  292. ------------------------------------------------------------------------------
  293. *NERDTree-U*
  294. Default key: U
  295. Map option: NERDTreeMapUpdirKeepOpen
  296. Applies to: no restrictions.
  297. Like |NERDTree-u| except that the old tree root is kept open.
  298. ------------------------------------------------------------------------------
  299. *NERDTree-r*
  300. Default key: r
  301. Map option: NERDTreeMapRefresh
  302. Applies to: files and directories.
  303. If a dir is selected, recursively refresh that dir, i.e. scan the filesystem
  304. for changes and represent them in the tree.
  305. If a file node is selected then the above is done on it's parent.
  306. ------------------------------------------------------------------------------
  307. *NERDTree-R*
  308. Default key: R
  309. Map option: NERDTreeMapRefreshRoot
  310. Applies to: no restrictions.
  311. Recursively refresh the tree root.
  312. ------------------------------------------------------------------------------
  313. *NERDTree-m*
  314. Default key: m
  315. Map option: NERDTreeMapFilesystemMenu
  316. Applies to: files and directories.
  317. Display the filesystem menu. See |NERDTreeFilesysMenu| for details.
  318. ------------------------------------------------------------------------------
  319. *NERDTree-H*
  320. Default key: H
  321. Map option: NERDTreeMapToggleHidden
  322. Applies to: no restrictions.
  323. Toggles whether hidden files are displayed. Hidden files are any
  324. file/directory that starts with a "."
  325. ------------------------------------------------------------------------------
  326. *NERDTree-f*
  327. Default key: f
  328. Map option: NERDTreeMapToggleFilters
  329. Applies to: no restrictions.
  330. Toggles whether file filters are used. See |NERDTreeIgnore| for details.
  331. ------------------------------------------------------------------------------
  332. *NERDTree-F*
  333. Default key: F
  334. Map option: NERDTreeMapToggleFiles
  335. Applies to: no restrictions.
  336. Toggles whether file nodes are displayed.
  337. ------------------------------------------------------------------------------
  338. *NERDTree-q*
  339. Default key: q
  340. Map option: NERDTreeMapQuit
  341. Applies to: no restrictions.
  342. Closes the NERDtree window.
  343. ------------------------------------------------------------------------------
  344. *NERDTree-?*
  345. Default key: ?
  346. Map option: NERDTreeMapHelp
  347. Applies to: no restrictions.
  348. Toggles whether the quickhelp is displayed.
  349. ------------------------------------------------------------------------------
  350. 2.3. The filesystem menu *NERDTreeFilesysMenu*
  351. The purpose of the filesystem menu is to allow you to perform basic filesystem
  352. operations quickly from the NERD tree rather than the console.
  353. The filesystem menu can be accessed with 'm' mapping and has four supported
  354. operations: >
  355. 1. Adding nodes.
  356. 2. Move nodes.
  357. 3. Deleting nodes.
  358. 3. Copying nodes.
  359. <
  360. 1. Adding nodes:
  361. To add a node move the cursor onto (or anywhere inside) the directory you wish
  362. to create the new node inside. Select the 'add node' option from the
  363. filesystem menu and type a filename. If the filename you type ends with a '/'
  364. character then a directory will be created. Once the operation is completed,
  365. the cursor is placed on the new node.
  366. 2. Move nodes:
  367. To move/rename a node, put the cursor on it and select the 'move' option from
  368. the filesystem menu. Enter the new location for the node and it will be
  369. moved. If the old file is open in a buffer, you will be asked if you wish to
  370. delete that buffer. Once the operation is complete the cursor will be placed
  371. on the renamed node.
  372. 3. Deleting nodes:
  373. To delete a node put the cursor on it and select the 'delete' option from the
  374. filesystem menu. After confirmation the node will be deleted. If a file is
  375. deleted but still exists as a buffer you will be given the option to delete
  376. that buffer.
  377. 4. Copying nodes:
  378. To copy a node put the cursor on it and select the 'copy' option from the
  379. filesystem menu. Enter the new location and you're done. Note: copying is
  380. currently only supported for *nix operating systems. If someone knows a
  381. one line copying command for windows that doesnt require user confirmation
  382. then id be grateful if you'd email me.
  383. ==============================================================================
  384. 3. Customisation *NERDTreeOptions*
  385. ------------------------------------------------------------------------------
  386. 3.1. Customisation summary *NERDTreeOptionSummary*
  387. The script provides the following options that can customise the behaviour the
  388. NERD tree. These options should be set in your vimrc.
  389. |loaded_nerd_tree| Turns off the script.
  390. |NERDChristmasTree| Tells the NERD tree to make itself colourful
  391. and pretty.
  392. |NERDTreeAutoCenter| Controls whether the NERD tree window centers
  393. when the cursor moves within a specified
  394. distance to the top/bottom of the window.
  395. |NERDTreeAutoCenterThreshold| Controls the sensitivity of autocentering.
  396. |NERDTreeCaseSensitiveSort| Tells the NERD tree whether to be case
  397. sensitive or not when sorting nodes.
  398. |NERDTreeChDirMode| Tells the NERD tree if/when it should change
  399. vim's current working directory.
  400. |NERDTreeHighlightCursorline| Tell the NERD tree whether to highlight the
  401. current cursor line.
  402. |NERDTreeIgnore| Tells the NERD tree which files to ignore.
  403. |NERDTreeBookmarksFile| Where the bookmarks are stored.
  404. |NERDTreeMouseMode| Tells the NERD tree how to handle mouse
  405. clicks.
  406. |NERDTreeShowFiles| Tells the NERD tree whether to display files
  407. in the tree on startup.
  408. |NERDTreeShowHidden| Tells the NERD tree whether to display hidden
  409. files on startup.
  410. |NERDTreeShowLineNumbers| Tells the NERD tree whether to display line
  411. numbers in the tree window.
  412. |NERDTreeSortOrder| Tell the NERD tree how to sort the nodes in
  413. the tree.
  414. |NERDTreeSplitVertical| Tells the script whether the NERD tree should
  415. be created by splitting the window vertically
  416. or horizontally.
  417. |NERDTreeWinPos| Tells the script where to put the NERD tree
  418. window.
  419. |NERDTreeWinSize| Sets the window size when the NERD tree is
  420. opened.
  421. ------------------------------------------------------------------------------
  422. 3.2. Customisation details *NERDTreeOptionDetails*
  423. To enable any of the below options you should put the given line in your
  424. ~/.vimrc
  425. *loaded_nerd_tree*
  426. If this plugin is making you feel homicidal, it may be a good idea to turn it
  427. off with this line in your vimrc: >
  428. let loaded_nerd_tree=1
  429. <
  430. ------------------------------------------------------------------------------
  431. *NERDChristmasTree*
  432. Values: 0 or 1.
  433. Default: 1.
  434. If this option is set to 1 then some extra syntax highlighting elements are
  435. added to the nerd tree to make it more colourful.
  436. Set it to 0 for a more vanilla looking tree.
  437. ------------------------------------------------------------------------------
  438. *NERDTreeAutoCenter*
  439. Values: 0 or 1.
  440. Default: 1
  441. If set to 1, the NERD tree window will center around the cursor if it moves to
  442. within |NERDTreeAutoCenterThreshold| lines of the top/bottom of the window.
  443. This is ONLY done in response to tree navigation mappings,
  444. i.e. |NERDTree-J| |NERDTree-K| |NERDTree-C-J| |NERDTree-c-K| |NERDTree-p|
  445. |NERDTree-P|
  446. The centering is done with a |zz| operation.
  447. ------------------------------------------------------------------------------
  448. *NERDTreeAutoCenterThreshold*
  449. Values: Any natural number.
  450. Default: 3
  451. This option controls the "sensitivity" of the NERD tree auto centering. See
  452. |NERDTreeAutoCenter| for details.
  453. ------------------------------------------------------------------------------
  454. *NERDTreeCaseSensitiveSort*
  455. Values: 0 or 1.
  456. Default: 0.
  457. By default the NERD tree does not sort nodes case sensitively, i.e. nodes
  458. could appear like this: >
  459. bar.c
  460. Baz.c
  461. blarg.c
  462. boner.c
  463. Foo.c
  464. <
  465. But, if you set this option to 1 then the case of the nodes will be taken into
  466. account. The above nodes would then be sorted like this: >
  467. Baz.c
  468. Foo.c
  469. bar.c
  470. blarg.c
  471. boner.c
  472. <
  473. ------------------------------------------------------------------------------
  474. *NERDTreeChDirMode*
  475. Values: 0, 1 or 2.
  476. Default: 1.
  477. Use this option to tell the script when (if at all) to change the current
  478. working directory (CWD) for vim.
  479. If it is set to 0 then the CWD is never changed by the NERD tree.
  480. If set to 1 then the CWD is changed when the NERD tree is first loaded to the
  481. directory it is initialized in. For example, if you start the NERD tree with >
  482. :NERDTree /home/marty/foobar
  483. <
  484. then the CWD will be changed to /home/marty/foobar and will not be changed
  485. again unless you init another NERD tree with a similar command.
  486. If the option is set to 2 then it behaves the same as if set to 1 except that
  487. the CWD is changed whenever the tree root is changed. For example, if the CWD
  488. is /home/marty/foobar and you make the node for /home/marty/foobar/baz the new
  489. root then the CWD will become /home/marty/foobar/baz.
  490. Authors note: at work i have this option set to 1 because i have a giant ctags
  491. file in the root dir of my project. This way i can initialise the NERD tree
  492. with the root dir of my project and always have ctags available to me --- no
  493. matter where i go with the NERD tree.
  494. ------------------------------------------------------------------------------
  495. *NERDTreeHighlightCursorline*
  496. Values: 0 or 1.
  497. Default: 1.
  498. If set to 1, the current cursor line in the NERD tree buffer will be
  499. highlighted. This is done using the |cursorline| option.
  500. ------------------------------------------------------------------------------
  501. *NERDTreeIgnore*
  502. Values: a list of regular expressions.
  503. Default: ['\~$'].
  504. This option is used to specify which files the NERD tree should ignore. It
  505. must be a list of regular expressions. When the NERD tree is rendered, any
  506. files/dirs that match any of the regex's in NERDTreeIgnore wont be displayed.
  507. For example if you put the following line in your vimrc: >
  508. let NERDTreeIgnore=['\.vim$', '\~$']
  509. <
  510. then all files ending in .vim or ~ will be ignored.
  511. Note: to tell the NERD tree not to ignore any files you must use the following
  512. line: >
  513. let NERDTreeIgnore=[]
  514. <
  515. The file filters can be turned on and off dynamically with the |NERDTree-f|
  516. mapping.
  517. ------------------------------------------------------------------------------
  518. *NERDTreeBookmarksFile*
  519. Values: a path
  520. Default: $HOME/.NERDTreeBookmarks
  521. This is where bookmarks are saved. See |NERDTreeBookmarkCommands|.
  522. ------------------------------------------------------------------------------
  523. *NERDTreeMouseMode*
  524. Values: 1, 2 or 3.
  525. Default: 1.
  526. If set to 1 then a double click on a node is required to open it.
  527. If set to 2 then a single click will open directory nodes, while a double
  528. click will still be required for file nodes.
  529. If set to 3 then a single click will open any node.
  530. Note: a double click anywhere on a line that a tree node is on will
  531. activate it, but all single-click activations must be done on name of the node
  532. itself. For example, if you have the following node: >
  533. | | |-application.rb
  534. <
  535. then (to single click activate it) you must click somewhere in
  536. 'application.rb'.
  537. ------------------------------------------------------------------------------
  538. *NERDTreeShowFiles*
  539. Values: 0 or 1.
  540. Default: 1.
  541. If this option is set to 1 then files are displayed in the NERD tree. If it is
  542. set to 0 then only directories are displayed.
  543. This option can be toggled dynamically with the |NERDTree-F| mapping and is
  544. useful for drastically shrinking the tree when you are navigating to a
  545. different part of the tree.
  546. ------------------------------------------------------------------------------
  547. *NERDTreeShowHidden*
  548. Values: 0 or 1.
  549. Default: 0.
  550. This option tells vim whether to display hidden files by default. This option
  551. can be dynamically toggled with the |NERDTree-H| mapping.
  552. Use one of the follow lines to set this option: >
  553. let NERDTreeShowHidden=0
  554. let NERDTreeShowHidden=1
  555. <
  556. ------------------------------------------------------------------------------
  557. *NERDTreeShowLineNumbers*
  558. Values: 0 or 1.
  559. Default: 0.
  560. This option tells vim whether to display line numbers for the NERD tree
  561. window. Use one of the follow lines to set this option: >
  562. let NERDTreeShowLineNumbers=0
  563. let NERDTreeShowLineNumbers=1
  564. <
  565. ------------------------------------------------------------------------------
  566. *NERDTreeSortOrder*
  567. Values: a list of regular expressions.
  568. Default: ['\/$', '*', '\.swp$', '\.bak$', '\~$']
  569. This option is set to a list of regular expressions which are used to
  570. specify the order of nodes under their parent.
  571. For example, if the option is set to: >
  572. ['\.vim$', '\.c$', '\.h$', '*', 'foobar']
  573. <
  574. then all .vim files will be placed at the top, followed by all .c files then
  575. all .h files. All files containing the string 'foobar' will be placed at the
  576. end. The star is a special flag: it tells the script that every node that
  577. doesnt match any of the other regexps should be placed here.
  578. If no star is present in NERDTreeSortOrder then one is automatically appended
  579. to the array.
  580. The regex '\/$' should be used to match directory nodes.
  581. After this sorting is done, the files in each group are sorted alphabetically.
  582. Other examples: >
  583. (1) ['*', '\/$']
  584. (2) []
  585. (3) ['\/$', '\.rb$', '\.php$', '*', '\.swp$', '\.bak$', '\~$']
  586. <
  587. 1. Directories will appear last, everything else will appear above.
  588. 2. Everything will simply appear in alphabetical order.
  589. 3. Dirs will appear first, then ruby and php. Swap files, bak files and vim
  590. backup files will appear last with everything else preceding them.
  591. ------------------------------------------------------------------------------
  592. *NERDTreeSplitVertical*
  593. Values: 0 or 1.
  594. Default: 1.
  595. This option, along with |NERDTreeWinPos|, is used to determine where the NERD
  596. tree window appears.
  597. If it is set to 1 then the NERD tree window will appear on either the left or
  598. right side of the screen (depending on the |NERDTreeWinPos| option).
  599. If it set to 0 then the NERD tree window will appear at the top of the screen.
  600. ------------------------------------------------------------------------------
  601. *NERDTreeWinPos*
  602. Values: 0 or 1.
  603. Default: 1.
  604. This option works in conjunction with the |NERDTreeSplitVertical| option to
  605. determine where NERD tree window is placed on the screen.
  606. If the option is set to 1 then the NERD tree will appear on the left or top of
  607. the screen (depending on the value of |NERDTreeSplitVertical|). If set to 0,
  608. the window will appear on the right or bottom of the screen.
  609. This option is makes it possible to use two different explorer type
  610. plugins simultaneously. For example, you could have the taglist plugin on the
  611. left of the window and the NERD tree on the right.
  612. ------------------------------------------------------------------------------
  613. *NERDTreeWinSize*
  614. Values: a positive integer.
  615. Default: 31.
  616. This option is used to change the size of the NERD tree when it is loaded.
  617. ==============================================================================
  618. *NERDTreePublicFunctions*
  619. 5. Public functions ~
  620. The script provides 2 public functions for your hacking pleasure. Their
  621. signatures are: >
  622. function! NERDTreeGetCurrentNode()
  623. function! NERDTreeGetCurrentPath()
  624. <
  625. The first returns the node object that the cursor is currently on, while the
  626. second returns the corresponding path object.
  627. This is probably a good time to mention that the script implements prototype
  628. style OO. To see the functions that each class provides you can read look at
  629. the code.
  630. Use the node objects to manipulate the structure of the tree. Use the path
  631. objects to access the data the tree represents and to make changes to the
  632. filesystem.
  633. ==============================================================================
  634. 5. TODO list *NERDTreeTodo*
  635. Window manager integration?
  636. ==============================================================================
  637. 6. The Author *NERDTreeAuthor*
  638. The author of the NERD tree is a terrible terrible monster called Martyzilla
  639. who gobbles up small children with milk and sugar for breakfast. He has an odd
  640. love/hate relationship with computers (but monsters hate everything by nature
  641. you know...) which can be awkward for him since he is a pro computer nerd for
  642. a living.
  643. He can be reached at martin_grenfell at msn.com. He would love to hear from
  644. you, so feel free to send him suggestions and/or comments about this plugin.
  645. Don't be shy --- the worst he can do is slaughter you and stuff you in the
  646. fridge for later ;)
  647. ==============================================================================
  648. 7. Changelog *NERDTreeChangelog*
  649. 2.10.0
  650. - added bookmarks, see :help NERDTreeBookmarkCommands for details. Thanks
  651. to Piotr Czachur for all his testing and suggestions.
  652. - fixed screen jumping bug with when &scrolloff != 0
  653. - fixed some bugs with copying nodes
  654. - other random fixes
  655. 2.9.0
  656. - path handling improvements, thanks to Zhang Shuhan for heaps of
  657. testing/bug reports
  658. * improved how paths are stored, now the script will no longer get
  659. confused about drives on MF Windows
  660. * made the script way better at handling paths with strange characters
  661. in them (eg '$@; etc)
  662. - applied a patch from Cory Echols
  663. * add the command :NERDTreeClose to close the tree for the current tab
  664. * set the filetype for the NERD tree buffer to "nerdtree"
  665. 2.8.0
  666. - added an option to enable/disable line numbers in the NERD tree window,
  667. thanks to Olivier Yiptong for the email.
  668. 2.7.1
  669. - Changed the keys for the filesystem menu to be mnemonic rather than
  670. arbitrary integers
  671. - Documented the copying functionality in the filesystem menu
  672. 2.7.0
  673. - Bug fix: Now when you have the tree on the right and you open it with
  674. multiple windows stacked, it will take up the full height of the vim
  675. window.
  676. - Now line numbers always turned off in the tree by default
  677. - Implemented copying of nodes (via the filesystem menu) for *nix/macosx
  678. - took the help doc out of the script and repackaged the whole thing as a
  679. zip
  680. 2.6.2
  681. - Now when you try to open a file node into a window that is modified, the
  682. window is not split if the &hidden option is set. Thanks to Niels Aan
  683. de Brugh for this suggestion.
  684. 2.6.1
  685. - Fixed a major bug with the <tab> mapping. Thanks to Zhang Weiwu for
  686. emailing me.
  687. 2.6.0
  688. - Extended the behaviour of <c-j/k>. Now if the cursor is on a file node
  689. and you use <c-j/k> the cursor will jump to its PARENTS next/previous
  690. sibling. Go :help NERDTree-c-j and :help NERDTree-c-k for info.
  691. - Extended the behaviour of the J/K mappings. Now if the cursor is on the
  692. last child of a node and you push J/K it will jump down to the last child
  693. of the next/prev of its parents siblings that is open and has children.
  694. Go :help NERDTree-J and :help NERDTree-K for info.
  695. - The goal of these changes is to make tree navigation faster.
  696. - Reorganised the help page a bit.
  697. - Removed the E mapping.
  698. - bugfixes
  699. 2.5.0
  700. - Added an option to enforce case sensitivity when sorting tree nodes.
  701. Read :help NERDTreeCaseSensitiveSort for details. (thanks to Michael
  702. Madsen for emailing me about this). Case sensitivity defaults to off.
  703. - Made the script echo a "please wait" style message when opening large
  704. directories. Thanks to AOYAMA Shotaro for this suggestion.
  705. - Added 2 public functions that can be used to retrieve the treenode and
  706. path that the cursor is on. Read :help NERDTreePublicFunctions for
  707. details (thanks again to AOYAMA Shotaro for the idea :).
  708. - added 2 new mappings for file nodes: "g<tab>" and "go". These are the
  709. same as the "<tab>" and "o" maps except that the cursor stays in the
  710. NERDTree. Note: these maps are slaved to the o and <tab> mappings, so if
  711. eg you remap "<tab>" to "i" then the "g<tab>" map will also be changed
  712. to "gi".
  713. - Renamed many of the help tags to be simpler.
  714. - Simplified the ascii "graphics" for the filesystem menu
  715. - Fixed bugs.
  716. - Probably created bugs.
  717. - Refactoring.
  718. 2.4.0
  719. - Added the P mapping to jump to the tree root.
  720. - Added window centering functionality that can be triggered when doing
  721. using any of the tree nav mappings. Essentially, if the cursor comes
  722. within a certain distance of the top/bottom of the window then a zz is
  723. done in the window. Two related options were added: NERDTreeAutoCenter
  724. to turn this functionality on/off, and NERDTreeAutoCenterThreshold to
  725. control how close the cursor has to be to the window edge to trigger the
  726. centering.
  727. 2.3.0
  728. - Tree navigation changes:
  729. - Added J and K mappings to jump to last/first child of the current dir.
  730. Options to customise these mappings have also been added.
  731. - Remapped the jump to next/prev sibling commands to be <C-j> and <C-k> by
  732. default.
  733. These changes should hopefully make tree navigation mappings easier to
  734. remember and use as the j and k keys are simply reused 3 times (twice
  735. with modifier keys).
  736. - Made it so that, when any of the tree filters are toggled, the cursor
  737. stays with the selected node (or goes to its parent/grandparent/... if
  738. that node is no longer visible)
  739. - Fixed an error in the doc for the mouse mode option.
  740. - Made the quickhelp correctly display the current single/double click
  741. mappings for opening nodes as specified by the NERDTreeMouseMode option.
  742. - Fixed a bug where the script was spazzing after prompting you to delete
  743. a modified buffer when using the filesystem menu.
  744. - Refactoring
  745. 2.2.3
  746. - Refactored the :echo output from the script.
  747. - Fixed some minor typos in the doc.
  748. - Made some minor changes to the output of the 'Tree filtering mappings'
  749. part of the quickhelp
  750. 2.2.2
  751. - More bugfixes... doh.
  752. 2.2.1
  753. - Bug fix that was causing an exception when closing the nerd tree. Thanks
  754. to Tim carey-smith and Yu Jun for pointing this out.
  755. 2.2.0
  756. - Now 'cursorline' is set in the NERD tree buffer by default. See :help
  757. NERDTreeHighlightCursorline for how to disable it.
  758. 2.1.2
  759. - Stopped the script from clobbering the 1,2,3 .. 9 registers.
  760. - Made it "silent!"ly delete buffers when renaming/deleting file nodes.
  761. - Minor correction to the doc
  762. - Fixed a bug when refreshing that was occurring when the node you
  763. refreshed had been deleted externally.
  764. - Fixed a bug that was occurring when you open a file that is already open
  765. and modified.
  766. 2.1.1
  767. - Added a bit more info about the buffers you are prompted to delete when
  768. renaming/deleting nodes from the filesystem menu that are already loaded
  769. into buffers.
  770. - Refactoring and bugfixes
  771. 2.1.0
  772. - Finally removed the blank line that always appears at the top of the
  773. NERDTree buffer
  774. - Added NERDTreeMouseMode option. If set to 1, then a double click is
  775. required to activate all nodes, if set to 2 then a single click will
  776. activate directory nodes, if set to 3 then a single click will activate
  777. all nodes.
  778. - Now if you delete a file node and have it open in a buffer you are given
  779. the option to delete that buffer as well. Similarly if you rename a file
  780. you are given the option to delete any buffers containing the old file
  781. (if any exist)
  782. - When you rename or create a node, the cursor is now put on the new node,
  783. this makes it easy immediately edit the new file.
  784. - Fixed a bug with the ! mapping that was occurring on windows with paths
  785. containing spaces.
  786. - Made all the mappings customisable. See |NERD_tree-mappings| for
  787. details. A side effect is that a lot of the "double mappings" have
  788. disappeared. E.g 'o' is now the key that is used to activate a node,
  789. <CR> is no longer mapped to the same.
  790. - Made the script echo warnings in some places rather than standard echos
  791. - Insane amounts of refactoring all over the place.
  792. 2.0.0
  793. - Added two new NERDChristmasTree decorations. First person to spot them
  794. and email me gets a free copy of the NERDTree.
  795. - Made it so that when you jump around the tree (with the p, s and S
  796. mappings) it is counted as a jump by vim. This means if you, eg, push
  797. 'p' one too many times then you can go `` or ctrl-o.
  798. - Added a new option called NERDTreeSortOrder which takes an array of
  799. regexs and is used to determine the order that the treenodes are listed
  800. in. Go :help NERDTreeSortOrder for details.
  801. - Removed the NERDTreeSortDirs option because it is consumed by
  802. NERDTreeSortOrder
  803. - Added the 'i' mapping which is the same as <tab> but requires less
  804. effort to reach.
  805. - Added the ! mapping which is used to execute file in the tree (after it
  806. prompts you for arguments etc)
  807. ==============================================================================
  808. 8. Credits *NERDTreeCredits*
  809. Thanks to Tim Carey-Smith for testing/using the NERD tree from the first
  810. pre-beta version, for his many suggestions and for his constant stream of bug
  811. complaints.
  812. Thanks to Vigil for trying it out before the first release :) and suggesting
  813. that mappings to open files in new tabs should be implemented.
  814. Thanks to Nick Brettell for testing, fixing my spelling and suggesting i put a
  815. .. (up a directory)
  816. line in the gui.
  817. Thanks to Thomas Scott Urban - the author of the vtreeexplorer plugin - whose
  818. gui code i borrowed from.
  819. Thanks to Terrance Cohen for pointing out a bug where the script was changing
  820. vims CWD all over the show.
  821. Thanks to Yegappan Lakshmanan (author of Taglist and other orgasmically
  822. wonderful plugins) for telling me how to fix a bug that was causing vim to go
  823. into visual mode everytime you double clicked a node :)
  824. Thanks to Jason Mills for sending me a fix that allows windows paths to use
  825. forward slashes as well as backward.
  826. Thanks to Michael Geddes (frogonwheels on #vim at freenode) for giving me some
  827. tips about syntax highlighting when i was doing highlighting for the
  828. quickhelp.
  829. Thanks to Yu Jun for emailing me about a bug that was occurring when closing
  830. the tree.
  831. Thanks to Michael Madsen for emailing me about making case sensitivity
  832. optional when sorting nodes.
  833. Thanks to AOYAMA Shotaro for suggesting that i echo a "please wait" message
  834. when opening large directories.
  835. Thanks to Michael Madsen for requesting the NERDTreeCaseSensitiveSort option.
  836. Thanks to AOYAMA Shotaro for suggesting that a "please wait" style message be
  837. echoed when opening large directories. Also, thanks for the suggestion of
  838. having public functions in the script to access the internal data :D
  839. Thanks to Zhang Weiwu for emailing me about a bug with the the <tab> mapping
  840. in 2.6.0
  841. Thanks to Niels Aan de Brugh for the suggestion that the script now split the
  842. window if you try to open a file in a window containing a modified buffer when
  843. the &hidden option is set.
  844. Thanks to Olivier Yiptong for prompting me to make line numbers in the
  845. NERD tree window optional.
  846. Thanks to Zhang Shuhan for all of his emails and testing to help improve the
  847. NERD tree path handling.
  848. Thanks to Cory Echols for sending a patch to add the :NERDTreeClose command and
  849. set the NERD tree buffers filetype to 'nerdtree'
  850. Thanks to Piotr Czachur for all his suggestions and testing for the bookmarks
  851. feature.