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.

104 lines
4.5 KiB

  1. The NERD Tree
  2. =============
  3. Intro
  4. -----
  5. The NERD tree allows you to explore your filesystem and to open files and
  6. directories. It presents the filesystem to you in the form of a tree which you
  7. manipulate with the keyboard and/or mouse. It also allows you to perform
  8. simple filesystem operations.
  9. The following features and functionality are provided by the NERD tree:
  10. * Files and directories are displayed in a hierarchical tree structure
  11. * Different highlighting is provided for the following types of nodes:
  12. * files
  13. * directories
  14. * sym-links
  15. * windows .lnk files
  16. * read-only files
  17. * executable files
  18. * Many (customisable) mappings are provided to manipulate the tree:
  19. * Mappings to open/close/explore directory nodes
  20. * Mappings to open files in new/existing windows/tabs
  21. * Mappings to change the current root of the tree
  22. * Mappings to navigate around the tree
  23. * ...
  24. * Directories and files can be bookmarked.
  25. * Most NERD tree navigation can also be done with the mouse
  26. * Filtering of tree content (can be toggled at runtime)
  27. * custom file filters to prevent e.g. vim backup files being displayed
  28. * optional displaying of hidden files (. files)
  29. * files can be "turned off" so that only directories are displayed
  30. * The position and size of the NERD tree window can be customised
  31. * The order in which the nodes in the tree are listed can be customised.
  32. * A model of your filesystem is created/maintained as you explore it. This
  33. has several advantages:
  34. * All filesystem information is cached and is only re-read on demand
  35. * If you revisit a part of the tree that you left earlier in your
  36. session, the directory nodes will be opened/closed as you left them
  37. * The script remembers the cursor position and window position in the NERD
  38. tree so you can toggle it off (or just close the tree window) and then
  39. reopen it (with NERDTreeToggle) the NERD tree window will appear exactly
  40. as you left it
  41. * You can have a separate NERD tree for each tab, share trees across tabs,
  42. or a mix of both.
  43. * By default the script overrides the default file browser (netw), so if
  44. you :edit a directory a (slighly modified) NERD tree will appear in the
  45. current window
  46. * A programmable menu system is provided (simulates right clicking on a node)
  47. * one default menu plugin is provided to perform basic filesytem
  48. operations (create/delete/move/copy files/directories)
  49. * There's an API for adding your own keymappings
  50. Installation
  51. ------------
  52. [pathogen.vim](https://github.com/tpope/vim-pathogen) is the recommended way to install nerdtree.
  53. cd ~/.vim/bundle
  54. git clone https://github.com/scrooloose/nerdtree.git
  55. Then reload vim, run `:helptags`, and check out `:help NERD_tree.txt`.
  56. Faq
  57. ---
  58. __Q. Can I have the nerdtree on every tab automatically?__
  59. A. Nope. If this is something you want then chances are you aren't using tabs
  60. and buffers as they were intended to be used. Read this
  61. http://stackoverflow.com/questions/102384/using-vims-tabs-like-buffers
  62. If you are interested in this behaviour then consider [vim-nerdtree-tabs](https://github.com/jistr/vim-nerdtree-tabs)
  63. __Q. How can I open a NERDTree automatically when vim starts up?__
  64. A. Stick this in your vimrc: `autocmd vimenter * NERDTree`
  65. __Q. How can I open a NERDTree automatically when vim starts up if no files were specified?__
  66. A. Stick this in your vimrc `autocmd vimenter * if !argc() | NERDTree | endif`
  67. __Q. How can I close vim if the only window left open is a NERDTree?__
  68. A. Stick this in your vimrc:
  69. `autocmd bufenter * if (winnr("$") == 1 && exists("b:NERDTreeType") && b:NERDTreeType == "primary") | q | endif`
  70. Changelog
  71. ---------
  72. 4.2.0 (2011-12-28)
  73. * Add NERDTreeDirArrows option to make the UI use pretty arrow chars instead of the old +~| chars to define the tree structure (sickill)
  74. * shift the syntax highlighting out into its own syntax file (gnap) * add some mac specific options to the filesystem menu - for macvim only (andersonfreitas)
  75. * Add NERDTreeMinimalUI option to remove some non functional parts of the nerdtree ui (camthompson)
  76. * tweak the behaviour of :NERDTreeFind - see :help :NERDTreeFind for the new behaviour (benjamingeiger)
  77. * if no name is given to :Bookmark, make it default to the name of the target file/dir (minyoung)
  78. * use 'file' completion when doing copying, create, and move operations (EvanDotPro)
  79. * lots of misc bug fixes (paddyoloughlin, sdewald, camthompson, Vitaly Bogdanov, AndrewRadev, mathias, scottstvnsn, kml, wycats, me RAWR!)