Compare commits

...

3 Commits
5.1.2 ... 5.2.1

Author SHA1 Message Date
Phil Runninger
ca16df25fa Fix nerdtree#version() on Windows. 2019-07-01 23:29:56 -04:00
Phil Runninger
cce6fb373f Expand functionality of <CR> mapping (#1011)
* Define default values for new variables governing new "Default Open".

"Default Open" means to open a file with the Enter key (which of course
can be changed.) The key can be changed in the vimrc, and there is a
variable for specifying the Opener parameters for opening the node. This
lets the user decide whether Enter (or another key) will open a file in
the current tab or a new one, and whether or not to open the file again
in the tab or jump to a window where the file is already open.

* Remove the old mapping for <CR>, a duplicate of 'o'.

<CR> will be defined like all the other keys, in plugin/NERD_tree.vim

* Assign functions to the new <CR> key mapping.

Three separate functions handle directories, files, and bookmarks.

* Rename variables: NERDTreeCustomOpen and NERDTreeCustomOpenArgs

* Add documentation for NERDTreeCustomOpenArgs and NERDTree-<CR>.

* Make key mapping variables be indexed in the Vim help

* Remove angle brackets from <CR> to see if help navigation improves.

* Rename functions from defaultOpen... to customOpen...

* Use separate options for file and directory nodes.

* Update documentation for separate file/directory options.

* Update version number and change log.

* Change CR to <CR> in help tags.

* Fix missing backtick in patch number.

* Update the quickhelp text.

* Update Pull Request template.

* Update change log with simpler formatting of patch number.

* Get NERDTree version number directly from CHANGELOG.md

* Reformat the lists of contributors in the Change Log.

* Initialize the version text, just in case the while loop finds nothing.
2019-07-01 22:13:20 -04:00
Phil Runninger
1c803b36f6 Remove @mentions from PR template and change log. They weren't working. (#1009)
* Remove @mentions from PR template and change log. They weren't working.

* Update version number and change log.
2019-06-27 08:03:50 -04:00
9 changed files with 304 additions and 240 deletions

View File

@@ -23,7 +23,7 @@ After reading, and before submitting your issue, please remove this introductory
#### Environment (for bug reports) #### Environment (for bug reports)
- [ ] Operating System: - [ ] Operating System:
- [ ] Vim/Neovim version `:version`: - [ ] Vim/Neovim version `:version`:
- [ ] NERDTree version `git rev-parse --short HEAD`: - [ ] NERDTree version `:echo nerdtree#version(0)` or `git rev-parse --short HEAD`:
- [ ] A link to my [vimrc](), or - [ ] A link to my [vimrc](), or
- [ ] vimrc settings - [ ] vimrc settings
- [ ] NERDTree variables - [ ] NERDTree variables

View File

@@ -1,22 +1,20 @@
<!-- Enter the issue number this PR addresses below. If none, remove the line. -->
### Description of Changes ### Description of Changes
Closes # <!-- Issue number this PR addresses. If none, remove this line. -->
Closes #
--- ---
### New Version Info ### New Version Info
- [ ] Derive a new version number. Increment the: - [ ] Derive a new version number. Increment the:
- [ ] `MAJOR` version when you make incompatible API changes, - [ ] `MAJOR` version when you make incompatible API changes
- [ ] `MINOR` version when you add functionality in a backwards-compatible manner, and - [ ] `MINOR` version when you add functionality in a backwards-compatible manner
- [ ] `PATCH` version when you make backwards-compatible bug fixes. - [ ] `PATCH` version when you make backwards-compatible bug fixes
- [ ] Update version number in [autoload/nerdtree.vim](https://github.com/scrooloose/nerdtree/blob/master/autoload/nerdtree.vim#L7) - [ ] Update [CHANGELOG.md](https://github.com/scrooloose/nerdtree/blob/master/CHANGELOG.md), following this format/example:
- [ ] Update the ChangeLog, following this format/example:
``` ```
MAJOR.MINOR... #### MAJOR.MINOR...
- **.PATCH**: PR Title (Author) #PR Number - **.PATCH**: PR Title (Author) #PR Number
### 5.1... #### 5.1...
- **.1**: Update Changelog and create PR Template (@PhilRunninger) #1007 - **.1**: Update Changelog and create PR Template (PhilRunninger) #1007
- **.0**: Too many changes for one patch... - **.0**: Too many changes for one patch...
``` ```

View File

@@ -1,118 +1,122 @@
# Change Log # Change Log
### 5.1... #### 5.2...
- **`.2`**: Fix NERDTree opening with the wrong size. (@PhilRunninger) #1008 - **.1**: Fix nerdtree#version() on Windows. (PhilRunninger) N/A
- **`.1`**: Update Changelog and create PR Template (@PhilRunninger) #1007 - **.0**: Expand functionality of `<CR>` mapping. (PhilRunninger) #1011
- **`.0`**: Too many changes for one patch... #### 5.1...
- Refresh a dir_node if the file wasn't found in it, and look once more. (@PhilRunninger) #1005 - **.3**: Remove @mentions from PR template and change log. They weren't working. (PhilRunninger) #1009
- Add a "copy path to clipboard" menu option (@PhilRunninger) #1002 - **.2**: Fix NERDTree opening with the wrong size. (PhilRunninger) #1008
- Enable root refresh on "vim ." a different way than #999. (@PhilRunninger) #1001 - **.1**: Update Changelog and create PR Template (PhilRunninger) #1007
- Fix refreshroot (@PhilRunninger) #999 - **.0**: Too many changes for one patch...
- Change version check to look for 703 not 730 (@vhalis) #994 - Refresh a dir_node if the file wasn't found in it, and look once more. (PhilRunninger) #1005
- Change minimum vim (@PhilRunninger) #991 - Add a "copy path to clipboard" menu option (PhilRunninger) #1002
- Allow multi-character DirArrows (@PhilRunninger) #985 - Enable root refresh on "vim ." a different way than #999. (PhilRunninger) #1001
- Remove redraw! while still clearing last message empty string. (@PhilRunninger) #979 - Fix refreshroot (PhilRunninger) #999
- fix _initChildren function value set to numChildrenCached error (@terryding77) #969 - Change version check to look for 703 not 730 (vhalis) #994
- On Windows, do a case-insensitive comparison of paths. (@PhilRunninger) #967 - Change minimum vim (PhilRunninger) #991
- Remove the "Please wait... DONE" messages. (@PhilRunninger) #966 - Allow multi-character DirArrows (PhilRunninger) #985
- Smarter delimiter default (@PhilRunninger) #963 - Remove redraw! while still clearing last message empty string. (PhilRunninger) #979
- Update directory .vimdc readme example (@spencerdcarlson) #961 - fix _initChildren function value set to numChildrenCached error (terryding77) #969
- Preview bookmarks (@PhilRunninger) #956 - On Windows, do a case-insensitive comparison of paths. (PhilRunninger) #967
- Add new value to NERDTreeQuitOnOpen to close bookmark table (@PhilRunninger) #955 - Remove the "Please wait... DONE" messages. (PhilRunninger) #966
- Add an :EditBookmarks command to edit the bookmarks file (@PhilRunninger) #954 - Smarter delimiter default (PhilRunninger) #963
- Before copying, turn off &shellslash. Restore after copy is finished. (@PhilRunninger) #952 - Update directory .vimdc readme example (spencerdcarlson) #961
- Set a maximum window size when zooming. (@PhilRunninger) #950 - Preview bookmarks (PhilRunninger) #956
- Confirm the wipeout of a unsaved buffer whose file has been renamed. (@PhilRunninger) #949 - Add new value to NERDTreeQuitOnOpen to close bookmark table (PhilRunninger) #955
- Escape a backslash so it can be used in a key mapping. (@PhilRunninger) #948 - Add an :EditBookmarks command to edit the bookmarks file (PhilRunninger) #954
- Add a NERDTreeMinimalMenu feature (@tuzz) #938 - Before copying, turn off &shellslash. Restore after copy is finished. (PhilRunninger) #952
- fixed root path error for windows (@zcodes) #935 - Set a maximum window size when zooming. (PhilRunninger) #950
- Restore getDirChildren for use in nerdtree-project-plugin. (@PhilRunninger) #929 - Confirm the wipeout of a unsaved buffer whose file has been renamed. (PhilRunninger) #949
- Document NERDTreeNodeDelimiter #912 (@PhilRunninger) #926 - Escape a backslash so it can be used in a key mapping. (PhilRunninger) #948
- Allow modification of menu keybindings (@Leandros) #923 - Add a NERDTreeMinimalMenu feature (tuzz) #938
- Add two more disqualifications for isCascadable(). (@PhilRunninger) #914 - fixed root path error for windows (zcodes) #935
- Allow highlighting more than one flag. (@kristijanhusak) #908 - Restore getDirChildren for use in nerdtree-project-plugin. (PhilRunninger) #929
- Support sorting files and directories by modification time. (@PhilRunninger) #901 - Document NERDTreeNodeDelimiter #912 (PhilRunninger) #926
- Parse . and .. from path string with trailing slash. (@PhilRunninger) #899 - Allow modification of menu keybindings (Leandros) #923
- Force sort to recalculate the cached sortKey. (@PhilRunninger) #898 - Add two more disqualifications for isCascadable(). (PhilRunninger) #914
- Add NERDTreeRefreshRoot command (@wgfm) #897 - Allow highlighting more than one flag. (kristijanhusak) #908
- Call Resolve on the file's path when calling :NERDTreeFind. (@PhilRunninger) #896 - Support sorting files and directories by modification time. (PhilRunninger) #901
- Catch all errors, not just NERDTree errors. (@PhilRunninger) #894 - Parse . and .. from path string with trailing slash. (PhilRunninger) #899
- Fix typo in help file (@lvoisin) #892 - Force sort to recalculate the cached sortKey. (PhilRunninger) #898
- Make NERDTreeCreator set the `'nolist'` option (@lifecrisis) #889 - Add NERDTreeRefreshRoot command (wgfm) #897
- Refresh buffers after `m`, `m` operation on a folder (@PhilRunninger) #888 - Call Resolve on the file's path when calling :NERDTreeFind. (PhilRunninger) #896
- Use a better arg for FINDSTR when using the m,l command in Windows. (@PhilRunninger) #887 - Catch all errors, not just NERDTree errors. (PhilRunninger) #894
- Fix the <C-J>/<C-K> motions, which currently fail with cascades (@lifecrisis) #886 - Fix typo in help file (lvoisin) #892
- Function "s:UI.getLineNum()" doesn't always work on cascades. (@lifecrisis) #882 - Make NERDTreeCreator set the `'nolist'` option (lifecrisis) #889
- NERDTreeCWD: reset CWD if changed by NERDTreeFocus (@PhilRunninger) #878 - Refresh buffers after `m`, `m` operation on a folder (PhilRunninger) #888
- Use <count>tabnext instead of <count>gt to allow users to remap gt. (@PhilRunninger) #877 - Use a better arg for FINDSTR when using the m,l command in Windows. (PhilRunninger) #887
- Do a case sensitive comparison of new/existing buffers. (@PhilRunninger) #875 - Fix the <C-J>/<C-K> motions, which currently fail with cascades (lifecrisis) #886
- Fix opening sub-directories that have commas in their name. (@PhilRunninger) #873 - Function "s:UI.getLineNum()" doesn't always work on cascades. (lifecrisis) #882
- Add new command to open NERDTree in the root of a VCS repository. (@PhilRunninger) #872 - NERDTreeCWD: reset CWD if changed by NERDTreeFocus (PhilRunninger) #878
- Make sure the path to the bookmarks file exists before writing it. (@PhilRunninger) #871 - Use <count>tabnext instead of <count>gt to allow users to remap gt. (PhilRunninger) #877
- Unzoom NERDTree when opening a file (@PhilRunninger) #870 - Do a case sensitive comparison of new/existing buffers. (PhilRunninger) #875
- Support unusual characters in file and directory names (@PhilRunninger) #868 - Fix opening sub-directories that have commas in their name. (PhilRunninger) #873
- Reword renamed-buffer prompt to be more clear (@aflock) #867 - Add new command to open NERDTree in the root of a VCS repository. (PhilRunninger) #872
- Default to placing cursor on root when closing bookmark table (@lifecrisis) #866 - Make sure the path to the bookmarks file exists before writing it. (PhilRunninger) #871
- Fix issues with sorting of nodes (@PhilRunninger) #856 - Unzoom NERDTree when opening a file (PhilRunninger) #870
- Better OSX detection (@bubba-h57) #853 - Support unusual characters in file and directory names (PhilRunninger) #868
- Bugfix - ensure keymaps dictionary exists before using it (@mnussbaum) #852 - Reword renamed-buffer prompt to be more clear (aflock) #867
- Decrease startup-time by avoiding linear-time iteration over key mappings (@mnussbaum) #851 - Default to placing cursor on root when closing bookmark table (lifecrisis) #866
- Add code to sort mappings in quickhelp (@lifecrisis) #849 - Fix issues with sorting of nodes (PhilRunninger) #856
- Use ":clearjumps" in new NERDTree windows (@lifecrisis) #844 - Better OSX detection (bubba-h57) #853
- Like m-c did before, create parent directories if needed on m-m. (@PhilRunninger) #840 - Bugfix - ensure keymaps dictionary exists before using it (mnussbaum) #852
- BUGFIX: Repair a problem with the `'u'` mapping. (@lifecrisis) #838 - Decrease startup-time by avoiding linear-time iteration over key mappings (mnussbaum) #851
- Make the NERDTree buffer writable when rendering it. (@PhilRunninger) #837 - Add code to sort mappings in quickhelp (lifecrisis) #849
- Code cleanup: Remove unsupported bookmark table mappings (@lifecrisis) #835 - Use ":clearjumps" in new NERDTree windows (lifecrisis) #844
- Replace strcharpart() with substitute() for backward compatibility (@bravestarr) #834 - Like m-c did before, create parent directories if needed on m-m. (PhilRunninger) #840
- Fixed error `unknown function strcharpart` for older versions of Vim (@hav4ik) #833 - BUGFIX: Repair a problem with the `'u'` mapping. (lifecrisis) #838
- Clear output when NERDTree menu is aborted (@lifecrisis) #832 - Make the NERDTree buffer writable when rendering it. (PhilRunninger) #837
- Display a path with multi-byte characters correctly when it is truncated (@bravestarr) #830 - Code cleanup: Remove unsupported bookmark table mappings (lifecrisis) #835
- Support revealing file and executing file with xdg-open for Linux (@ngnmhieu) #824 - Replace strcharpart() with substitute() for backward compatibility (bravestarr) #834
- If node isn't open, count children on disk before deleting. (@PhilRunninger) #822 - Fixed error `unknown function strcharpart` for older versions of Vim (hav4ik) #833
- Add new variable g:NERDTreeRemoveFileCmd (@kutsan) #816 - Clear output when NERDTree menu is aborted (lifecrisis) #832
- Use a better check for existence of the NERDTree buffer. (@PhilRunninger) #814 - Display a path with multi-byte characters correctly when it is truncated (bravestarr) #830
- Fix focussing previous buffer when closing NERDTree (@mrubli) #801 - Support revealing file and executing file with xdg-open for Linux (ngnmhieu) #824
- Update the docs for "NERDTreeStatusline" (@lifecrisis) #796 - If node isn't open, count children on disk before deleting. (PhilRunninger) #822
- BUGFIX: Unstable behavior in the "getPath()" method (@lifecrisis) #795 - Add new variable g:NERDTreeRemoveFileCmd (kutsan) #816
- Revert the bugfix from pull request #785 (@lifecrisis) #794 - Use a better check for existence of the NERDTree buffer. (PhilRunninger) #814
- BUGFIX: Allow ":NERDTreeFind" to discover hidden files (@lifecrisis) #786 - Fix focussing previous buffer when closing NERDTree (mrubli) #801
- BUGFIX: Allow ":NERDTreeFind" to reveal new files (@lifecrisis) #785 - Update the docs for "NERDTreeStatusline" (lifecrisis) #796
- Add modelines (@lifecrisis) #782 - BUGFIX: Unstable behavior in the "getPath()" method (lifecrisis) #795
- Change the type of completion used by NERDTreeFind (@lifecrisis) #781 - Revert the bugfix from pull request #785 (lifecrisis) #794
- change NERDTreeFind with args (@zhenyangze) #778 - BUGFIX: Allow ":NERDTreeFind" to discover hidden files (lifecrisis) #786
- Style Choice: Using confirm() when deleting a bookmark (@lifecrisis) #777 - BUGFIX: Allow ":NERDTreeFind" to reveal new files (lifecrisis) #785
- remove useless substitute when `file =~# "/$"` (@skyblueee) #773 - Add modelines (lifecrisis) #782
- remove useless removeLeadingSpaces in _stripMarkup (@skyblueee) #772 - Change the type of completion used by NERDTreeFind (lifecrisis) #781
- Make the "o" mapping consistent with "x" (@lifecrisis) #769 - change NERDTreeFind with args (zhenyangze) #778
- Fix a problem with the "x" handler (@lifecrisis) #768 - Style Choice: Using confirm() when deleting a bookmark (lifecrisis) #777
- Clean up the handler for the "x" mapping (@lifecrisis) #767 - remove useless substitute when `file =~# "/$"` (skyblueee) #773
- Revert change to tab opening method (@lifecrisis) #766 - remove useless removeLeadingSpaces in _stripMarkup (skyblueee) #772
- BUGFIX: Add back support for "b:NERDTreeRoot" (@lifecrisis) #765 - Make the "o" mapping consistent with "x" (lifecrisis) #769
- Fix broken "t" and "T" mappings, tabs now open at end (@lifecrisis) #759 - Fix a problem with the "x" handler (lifecrisis) #768
- Update doc with already existing mapping variables (@asnr) #699 - Clean up the handler for the "x" mapping (lifecrisis) #767
- Fix the broken g:NERDTreeBookmarksSort setting (@lifecrisis) #696 - Revert change to tab opening method (lifecrisis) #766
- Correct NERDTreeIgnore pattern in doc (@cntoplolicon) #648 - BUGFIX: Add back support for "b:NERDTreeRoot" (lifecrisis) #765
- Remove empty segments when splitting path (@sooth-sayer) #574 - Fix broken "t" and "T" mappings, tabs now open at end (lifecrisis) #759
- Suppress autocmds less agressively (@wincent) #578 #691 - Update doc with already existing mapping variables (asnr) #699
- Fix the broken g:NERDTreeBookmarksSort setting (lifecrisis) #696
- Correct NERDTreeIgnore pattern in doc (cntoplolicon) #648
- Remove empty segments when splitting path (sooth-sayer) #574
- Suppress autocmds less agressively (wincent) #578 #691
- Add an Issues template to ask for more info initially. - Add an Issues template to ask for more info initially.
- Fix markdown headers in readme (@josephfrazier) #676 - Fix markdown headers in readme (josephfrazier) #676
- Don't touch @o and @h registers when rendering - Don't touch @o and @h registers when rendering
- Fix bug with files and directories with dollar signs (@alegen) #649 - Fix bug with files and directories with dollar signs (alegen) #649
- Reuse/reopen existing window trees where possible #244 - Reuse/reopen existing window trees where possible #244
- Remove NERDTree.previousBuf() - Remove NERDTree.previousBuf()
- Change color of arrow (@Leeiio) #630 - Change color of arrow (Leeiio) #630
- Improved a tip in README.markdown (@ggicci) #628 - Improved a tip in README.markdown (ggicci) #628
- Shorten delete confimration of empty directory to `y` (@mikeperri) #530 - Shorten delete confimration of empty directory to `y` (mikeperri) #530
- Fix API call to open directory tree in window (@devm33) #533 - Fix API call to open directory tree in window (devm33) #533
- Change default arrows on non-Windows platforms (@gwilk) #546 - Change default arrows on non-Windows platforms (gwilk) #546
- Update to README - combine cd and git clone (@zwhitchcox) #584 - Update to README - combine cd and git clone (zwhitchcox) #584
- Update to README - Tip: start NERDTree when vim starts (@therealplato) #593 - Update to README - Tip: start NERDTree when vim starts (therealplato) #593
- Escape filename when moving an open buffer (@zacharyvoase) #595 - Escape filename when moving an open buffer (zacharyvoase) #595
- Fixed incorrect :helptags command in README (@curran) #619 - Fixed incorrect :helptags command in README (curran) #619
- Fixed incomplete escaping of folder arrows (@adityanatraj) #548 - Fixed incomplete escaping of folder arrows (adityanatraj) #548
- Added NERDTreeCascadeSingleChildDir option (@juanibiapina) #558 - Added NERDTreeCascadeSingleChildDir option (juanibiapina) #558
- Replace strchars() with backward compatible workaround. - Replace strchars() with backward compatible workaround.
- Add support for copy command in Windows (@SkylerLipthay) #231 - Add support for copy command in Windows (SkylerLipthay) #231
- Fixed typo in README.markdown - :Helptags -> :helptags - Fixed typo in README.markdown - :Helptags -> :helptags
- Rename "primary" and "secondary" trees to "tab" and "window" trees. - Rename "primary" and "secondary" trees to "tab" and "window" trees.
- Move a bunch of buffer level variables into the NERDTree and UI classes. - Move a bunch of buffer level variables into the NERDTree and UI classes.
@@ -121,7 +125,7 @@
- On windows default to + and ~ for expand/collapse directory symbols. - On windows default to + and ~ for expand/collapse directory symbols.
- Lots more refactoring. Move a bunch of b: level vars into b:NERDTree and friends. - Lots more refactoring. Move a bunch of b: level vars into b:NERDTree and friends.
### 5.0.0 #### 5.0.0
- Refactor the code significantly: - Refactor the code significantly:
* Break the classes out into their own files. * Break the classes out into their own files.
* Make the majority of the code OO - previously large parts were effectively a tangle of "global" methods. * Make the majority of the code OO - previously large parts were effectively a tangle of "global" methods.
@@ -130,110 +134,76 @@
- add magic [[dir]] and [[file]] flags to NERDTreeIgnore - add magic [[dir]] and [[file]] flags to NERDTreeIgnore
- add support for custom path filters. See :help NERDTreeAddPathFilter() - add support for custom path filters. See :help NERDTreeAddPathFilter()
- add path listener API. See :help NERDTreePathListenerAPI. - add path listener API. See :help NERDTreePathListenerAPI.
- expand the fs menu functionality to list file properties (@PhilRunninger, @apbarrero, @JESii) - expand the fs menu functionality to list file properties (PhilRunninger, apbarrero, JESii)
- make bookmarks work with `~` home shortcuts (@hiberabyss) - make bookmarks work with `~` home shortcuts (hiberabyss)
- show OSX specific fsmenu options in regular vim on mac (@evindor) - show OSX specific fsmenu options in regular vim on mac (evindor)
- make dir arrow icons configurable (@PickRelated) - make dir arrow icons configurable (PickRelated)
- optimise node sorting performance when opening large dirs (@vtsang) - optimise node sorting performance when opening large dirs (vtsang)
- make the root note render prettier by truncating it at a path slash (@gcmt) - make the root note render prettier by truncating it at a path slash (gcmt)
- remove NERDChristmasTree option - its always christmas now - remove NERDChristmasTree option - its always christmas now
- add "cascade" open and closing for dirs containing only another single dir. See :help NERDTreeCascadeOpenSingleChildDir (@pendulm) - add "cascade" open and closing for dirs containing only another single dir. See :help NERDTreeCascadeOpenSingleChildDir (pendulm)
- Many other fixes, doc updates and contributions from: - Many other fixes, doc updates and contributions from: **actionshrimp**, **agrussellknives**, **alvan**, **AndrewRadev**, **cperl82** (*many small fixes*), **devmanhinton**, **egalpin**, **franksort**, **gastropoda**, **handcraftedbits**, **kelaban**, **lucascaton**, **mixvin**, **pendulm**, **SchDen**, **shanesmith**, **staeff**, **stephenprater**, **toiffel**, **Twinside**, **WoLpH**, **xiaodili**, **zhangoose**
- @actionshrimp
- @SchDen
- @egalpin
- @cperl82 - many small fixes
- @toiffel
- @WoLpH
- @handcraftedbits
- @devmanhinton
- @xiaodili
- @zhangoose
- @gastropoda
- @mixvin
- @alvan
- @lucascaton
- @kelaban
- @shanesmith
- @staeff
- @pendulm
- @stephenprater
- @franksort
- @agrussellknives
- @AndrewRadev
- @Twinside
### 4.2.0 #### 4.2.0
- Add NERDTreeDirArrows option to make the UI use pretty arrow chars instead of the old +~| chars to define the tree structure (@sickill) - Add NERDTreeDirArrows option to make the UI use pretty arrow chars instead of the old +~| chars to define the tree structure (sickill)
- shift the syntax highlighting out into its own syntax file (@gnap) - shift the syntax highlighting out into its own syntax file (gnap)
- add some mac specific options to the filesystem menu - for macvim only (@andersonfreitas) - add some mac specific options to the filesystem menu - for macvim only (andersonfreitas)
- Add NERDTreeMinimalUI option to remove some non functional parts of the nerdtree ui (@camthompson) - Add NERDTreeMinimalUI option to remove some non functional parts of the nerdtree ui (camthompson)
- tweak the behaviour of :NERDTreeFind - see :help :NERDTreeFind for the new behaviour (@benjamingeiger) - tweak the behaviour of :NERDTreeFind - see :help :NERDTreeFind for the new behaviour (benjamingeiger)
- if no name is given to :Bookmark, make it default to the name of the target file/dir (@minyoung) - if no name is given to :Bookmark, make it default to the name of the target file/dir (minyoung)
- use `file` completion when doing copying, create, and move operations (@EvanDotPro) - use `file` completion when doing copying, create, and move operations (EvanDotPro)
- lots of misc bug fixes from: - lots of misc bug fixes from: **AndrewRadev**, **Bogdanov**, **camthompson**, **kml**, **mathias**, **paddyoloughlin**, **scottstvnsn**, **sdewald**, **Vitaly**, **wycats**, me RAWR!
- @paddyoloughlin
- @sdewald
- @camthompson
- @Vitaly
- @Bogdanov
- @AndrewRadev
- @mathias
- @scottstvnsn
- @kml
- @wycats
- me RAWR!
### 4.1.0 #### 4.1.0
- features: - features:
- NERDTreeFind to reveal the node for the current buffer in the tree, see `|NERDTreeFind|`. This effectively merges the FindInNERDTree plugin (by Doug McInnes) into the script. - NERDTreeFind to reveal the node for the current buffer in the tree, see `|NERDTreeFind|`. This effectively merges the FindInNERDTree plugin (by **Doug McInnes**) into the script.
- make NERDTreeQuitOnOpen apply to the t/T keymaps too. Thanks to Stefan Ritter and Rémi Prévost. - make NERDTreeQuitOnOpen apply to the t/T keymaps too. Thanks to **Stefan Ritter** and **Rémi Prévost**.
- truncate the root node if wider than the tree window. Thanks to Victor Gonzalez. - truncate the root node if wider than the tree window. Thanks to **Victor Gonzalez**.
- bugfixes: - bugfixes:
- really fix window state restoring - really fix window state restoring
- fix some win32 path escaping issues. Thanks to Stephan Baumeister, Ricky, jfilip1024, and Chris Chambers - fix some win32 path escaping issues. Thanks to **Stephan Baumeister**, **Ricky**, **jfilip1024**, and **Chris Chambers**.
### 4.0.0 #### 4.0.0
- add a new programmable menu system (see `:help NERDTreeMenu`). - add a new programmable menu system (see `:help NERDTreeMenu`).
- add new APIs to add menus/menu-items to the menu system as well as custom key mappings to the NERD tree buffer (see `:help NERDTreeAPI`). - add new APIs to add menus/menu-items to the menu system as well as custom key mappings to the NERD tree buffer (see `:help NERDTreeAPI`).
- removed the old API functions - removed the old API functions
- added a mapping to maximize/restore the size of nerd tree window, thanks to Guillaume Duranceau for the patch. See :help NERDTree-A for details. - added a mapping to maximize/restore the size of nerd tree window, thanks to Guillaume Duranceau for the patch. See :help NERDTree-A for details.
- fix a bug where secondary nerd trees (netrw hijacked trees) and NERDTreeQuitOnOpen didnt play nicely, thanks to Curtis Harvey. - fix a bug where secondary nerd trees (netrw hijacked trees) and NERDTreeQuitOnOpen didnt play nicely, thanks to **Curtis Harvey**.
- fix a bug where the script ignored directories whose name ended in a dot, thanks to Aggelos Orfanakos for the patch. - fix a bug where the script ignored directories whose name ended in a dot, thanks to **Aggelos Orfanakos** for the patch.
- fix a bug when using the x mapping on the tree root, thanks to Bryan Venteicher for the patch. - fix a bug when using the x mapping on the tree root, thanks to **Bryan Venteicher** for the patch.
- fix a bug where the cursor position/window size of the nerd tree buffer wasnt being stored on closing the window, thanks to Richard Hart. - fix a bug where the cursor position/window size of the nerd tree buffer wasnt being stored on closing the window, thanks to **Richard Hart**.
- fix a bug where NERDTreeMirror would mirror the wrong tree - fix a bug where NERDTreeMirror would mirror the wrong tree
### 3.1.1 #### 3.1.1
- fix a bug where a non-listed no-name buffer was getting created every time the tree windows was created, thanks to Derek Wyatt and owen1 - fix a bug where a non-listed no-name buffer was getting created every time the tree windows was created, thanks to **Derek Wyatt** and **owen1**
- make `<CR>` behave the same as the `o` mapping - make `<CR>` behave the same as the `o` mapping
- some helptag fixes in the doc, thanks @strull - some helptag fixes in the doc, thanks **strull**.
- fix a bug when using `:set nohidden` and opening a file where the previous buf was modified. Thanks @iElectric - fix a bug when using `:set nohidden` and opening a file where the previous buf was modified. Thanks **iElectric**.
- other minor fixes - other minor fixes
### 3.1.0 #### 3.1.0
- New features: - New features:
- add mappings to open files in a vsplit, see `:help NERDTree-s` and `:help NERDTree-gs` - add mappings to open files in a vsplit, see `:help NERDTree-s` and `:help NERDTree-gs`
- make the statusline for the nerd tree window default to something hopefully more useful. See `:help 'NERDTreeStatusline'` - make the statusline for the nerd tree window default to something hopefully more useful. See `:help 'NERDTreeStatusline'`
- Bugfixes: - Bugfixes:
- make the hijack netrw functionality work when vim is started with `vim <some dir>` (thanks to Alf Mikula for the patch). - make the hijack netrw functionality work when vim is started with `vim <some dir>` (thanks to **Alf Mikula** for the patch).
- fix a bug where the CWD wasnt being changed for some operations even when NERDTreeChDirMode==2 (thanks to Lucas S. Buchala) - fix a bug where the CWD wasnt being changed for some operations even when NERDTreeChDirMode==2 (thanks to **Lucas S. Buchala**)
- add -bar to all the nerd tree :commands so they can chain with other :commands (thanks to @tpope) - add -bar to all the nerd tree :commands so they can chain with other :commands (thanks to **tpope**)
- fix bugs when ignorecase was set (thanks to @nach) - fix bugs when ignorecase was set (thanks to **nach**)
- fix a bug with the relative path code (thanks to @nach) - fix a bug with the relative path code (thanks to **nach**)
- fix a bug where doing a `:cd` would cause `:NERDTreeToggle` to fail (thanks @nach) - fix a bug where doing a `:cd` would cause `:NERDTreeToggle` to fail (thanks **nach**)
### 3.0.1 #### 3.0.1
- Bugfixes: - Bugfixes:
- fix bugs with :NERDTreeToggle and :NERDTreeMirror when `'hidden'` was not set - fix bugs with :NERDTreeToggle and :NERDTreeMirror when `'hidden'` was not set
- fix a bug where `:NERDTree <path>` would fail if `<path>` was relative and didnt start with a `./` or `../` Thanks to James Kanze. - fix a bug where `:NERDTree <path>` would fail if `<path>` was relative and didnt start with a `./` or `../` Thanks to **James Kanze**.
- make the `q` mapping work with secondary (`:e <dir>` style) trees, thanks to @jamessan - make the `q` mapping work with secondary (`:e <dir>` style) trees, thanks to **jamessan**
- fix a bunch of small bugs with secondary trees - fix a bunch of small bugs with secondary trees
- More insane refactoring. - More insane refactoring.
### 3.0.0 #### 3.0.0
- hijack netrw so that doing an `:edit <directory>` will put a NERD tree in the window rather than a netrw browser. See :help 'NERDTreeHijackNetrw' - hijack netrw so that doing an `:edit <directory>` will put a NERD tree in the window rather than a netrw browser. See :help 'NERDTreeHijackNetrw'
- allow sharing of trees across tabs, see `:help :NERDTreeMirror` - allow sharing of trees across tabs, see `:help :NERDTreeMirror`
- remove "top" and "bottom" as valid settings for NERDTreeWinPos - remove "top" and "bottom" as valid settings for NERDTreeWinPos

View File

@@ -3,13 +3,38 @@ if exists("g:loaded_nerdtree_autoload")
endif endif
let g:loaded_nerdtree_autoload = 1 let g:loaded_nerdtree_autoload = 1
function! nerdtree#version() let s:rootNERDTreePath = resolve(expand("<sfile>:p:h:h"))
return '5.1.2' function! nerdtree#version(...)
let l:changelog = readfile(join([s:rootNERDTreePath, "CHANGELOG.md"], nerdtree#slash()))
let l:text = 'Unknown'
let l:line = 0
while l:line <= len(l:changelog)
if l:changelog[l:line] =~ '\d\+\.\d\+'
let l:text = substitute(l:changelog[l:line], '.*\(\d\+.\d\+\).*', '\1', '')
let l:text .= substitute(l:changelog[l:line+1], '^.\{-}\(\.\d\+\).\{-}:\(.*\)', a:0>0 ? '\1:\2' : '\1', '')
break
endif
let l:line += 1
endwhile
return l:text
endfunction endfunction
" SECTION: General Functions {{{1 " SECTION: General Functions {{{1
"============================================================ "============================================================
function! nerdtree#slash()
if nerdtree#runningWindows()
if exists('+shellslash') && &shellslash
return '/'
endif
return '\'
endif
return '/'
endfunction
"FUNCTION: nerdtree#and(x,y) {{{2 "FUNCTION: nerdtree#and(x,y) {{{2
" Implements and() function for Vim <= 7.2 " Implements and() function for Vim <= 7.2
function! nerdtree#and(x,y) function! nerdtree#and(x,y)

View File

@@ -14,6 +14,9 @@ function! nerdtree#ui_glue#createDefaultBindings()
call NERDTreeAddKeyMap({ 'key': '<2-LeftMouse>', 'scope': "Bookmark", 'callback': s."activateBookmark" }) call NERDTreeAddKeyMap({ 'key': '<2-LeftMouse>', 'scope': "Bookmark", 'callback': s."activateBookmark" })
call NERDTreeAddKeyMap({ 'key': '<2-LeftMouse>', 'scope': "all", 'callback': s."activateAll" }) call NERDTreeAddKeyMap({ 'key': '<2-LeftMouse>', 'scope': "all", 'callback': s."activateAll" })
call NERDTreeAddKeyMap({ 'key': g:NERDTreeMapCustomOpen, 'scope':'FileNode', 'callback': s."customOpenFile"})
call NERDTreeAddKeyMap({ 'key': g:NERDTreeMapCustomOpen, 'scope':'DirNode', 'callback': s."customOpenDir"})
call NERDTreeAddKeyMap({ 'key': g:NERDTreeMapCustomOpen, 'scope':'Bookmark', 'callback': s."customOpenBookmark"})
call NERDTreeAddKeyMap({ 'key': g:NERDTreeMapActivateNode, 'scope': "DirNode", 'callback': s."activateDirNode" }) call NERDTreeAddKeyMap({ 'key': g:NERDTreeMapActivateNode, 'scope': "DirNode", 'callback': s."activateDirNode" })
call NERDTreeAddKeyMap({ 'key': g:NERDTreeMapActivateNode, 'scope': "FileNode", 'callback': s."activateFileNode" }) call NERDTreeAddKeyMap({ 'key': g:NERDTreeMapActivateNode, 'scope': "FileNode", 'callback': s."activateFileNode" })
@@ -76,6 +79,35 @@ endfunction
"SECTION: Interface bindings {{{1 "SECTION: Interface bindings {{{1
"============================================================ "============================================================
"FUNCTION: s:customOpenFile() {{{1
" Open file node with the "custom" key, initially <CR>.
function! s:customOpenFile(node)
call a:node.activate(s:initCustomOpenArgs().file)
endfunction
"FUNCTION: s:customOpenDir() {{{1
" Open directory node with the "custom" key, initially <CR>.
function! s:customOpenDir(node)
call s:activateDirNode(a:node, s:initCustomOpenArgs().dir)
endfunction
"FUNCTION: s:customOpenBookmark() {{{1
" Open bookmark node with the "custom" key, initially <CR>.
function! s:customOpenBookmark(node)
if node.isDirectory
call a:node.activate(b:NERDTree, s:initCustomOpenArgs().dir)
else
call a:node.activate(b:NERDTree, s:initCustomOpenArgs().file)
endif
endfunction
"FUNCTION: s:initCustomOpenArgs() {{{1
" Make sure NERDTreeCustomOpenArgs has needed keys
function! s:initCustomOpenArgs()
let g:NERDTreeCustomOpenArgs = get(g:, 'NERDTreeCustomOpenArgs', {})
return extend(g:NERDTreeCustomOpenArgs, {'file':{'reuse': 'all', 'where': 'p'}, 'dir':{}}, 'keep')
endfunction
"FUNCTION: s:activateAll() {{{1 "FUNCTION: s:activateAll() {{{1
"handle the user activating the updir line "handle the user activating the updir line
function! s:activateAll() function! s:activateAll()
@@ -84,15 +116,16 @@ function! s:activateAll()
endif endif
endfunction endfunction
" FUNCTION: s:activateDirNode(directoryNode) {{{1 " FUNCTION: s:activateDirNode(directoryNode, options) {{{1
function! s:activateDirNode(directoryNode) " Open a directory with optional options
function! s:activateDirNode(directoryNode, ...)
if a:directoryNode.isRoot() && a:directoryNode.isOpen if a:directoryNode.isRoot() && a:directoryNode.isOpen
call nerdtree#echo('cannot close tree root') call nerdtree#echo('cannot close tree root')
return return
endif endif
call a:directoryNode.activate() call a:directoryNode.activate((a:0 > 0) ? a:1 : {})
endfunction endfunction
"FUNCTION: s:activateFileNode() {{{1 "FUNCTION: s:activateFileNode() {{{1

View File

@@ -247,12 +247,12 @@ i........Open selected file in a split window.......................|NERDTree-i|
gi.......Same as i, but leave the cursor on the NERDTree...........|NERDTree-gi| gi.......Same as i, but leave the cursor on the NERDTree...........|NERDTree-gi|
s........Open selected file in a new vsplit.........................|NERDTree-s| s........Open selected file in a new vsplit.........................|NERDTree-s|
gs.......Same as s, but leave the cursor on the NERDTree...........|NERDTree-gs| gs.......Same as s, but leave the cursor on the NERDTree...........|NERDTree-gs|
<CR>.....User-definable custom open action.......................|NERDTree-<CR>|
O........Recursively open the selected directory....................|NERDTree-O| O........Recursively open the selected directory....................|NERDTree-O|
x........Close the current nodes parent.............................|NERDTree-x| x........Close the current nodes parent.............................|NERDTree-x|
X........Recursively close all children of the current node.........|NERDTree-X| X........Recursively close all children of the current node.........|NERDTree-X|
e........Edit the current dir.......................................|NERDTree-e| e........Edit the current dir.......................................|NERDTree-e|
<CR>............same as |NERDTree-o|.
double-click....same as |NERDTree-o|. double-click....same as |NERDTree-o|.
middle-click....same as |NERDTree-i| for files, and |NERDTree-e| for dirs. middle-click....same as |NERDTree-i| for files, and |NERDTree-e| for dirs.
@@ -319,7 +319,7 @@ The default key combo for this mapping is "g" + NERDTreeMapActivateNode (see
------------------------------------------------------------------------------ ------------------------------------------------------------------------------
*NERDTree-t* *NERDTree-t*
Default key: t Default key: t
Map setting: NERDTreeMapOpenInTab Map setting: *NERDTreeMapOpenInTab*
Applies to: files and directories. Applies to: files and directories.
Opens the selected file in a new tab. If a directory is selected, a fresh Opens the selected file in a new tab. If a directory is selected, a fresh
@@ -332,7 +332,7 @@ in a new tab.
------------------------------------------------------------------------------ ------------------------------------------------------------------------------
*NERDTree-T* *NERDTree-T*
Default key: T Default key: T
Map setting: NERDTreeMapOpenInTabSilent Map setting: *NERDTreeMapOpenInTabSilent*
Applies to: files and directories. Applies to: files and directories.
The same as |NERDTree-t| except that the focus is kept in the current tab. The same as |NERDTree-t| except that the focus is kept in the current tab.
@@ -340,7 +340,7 @@ The same as |NERDTree-t| except that the focus is kept in the current tab.
------------------------------------------------------------------------------ ------------------------------------------------------------------------------
*NERDTree-i* *NERDTree-i*
Default key: i Default key: i
Map setting: NERDTreeMapOpenSplit Map setting: *NERDTreeMapOpenSplit*
Applies to: files. Applies to: files.
Opens the selected file in a new split window and puts the cursor in the new Opens the selected file in a new split window and puts the cursor in the new
@@ -349,7 +349,7 @@ window.
------------------------------------------------------------------------------ ------------------------------------------------------------------------------
*NERDTree-gi* *NERDTree-gi*
Default key: gi Default key: gi
Map setting: NERDTreeMapPreviewSplit Map setting: *NERDTreeMapPreviewSplit*
Applies to: files. Applies to: files.
The same as |NERDTree-i| except that the cursor is not moved. The same as |NERDTree-i| except that the cursor is not moved.
@@ -360,7 +360,7 @@ The default key combo for this mapping is "g" + NERDTreeMapOpenSplit (see
------------------------------------------------------------------------------ ------------------------------------------------------------------------------
*NERDTree-s* *NERDTree-s*
Default key: s Default key: s
Map setting: NERDTreeMapOpenVSplit Map setting: *NERDTreeMapOpenVSplit*
Applies to: files. Applies to: files.
Opens the selected file in a new vertically split window and puts the cursor Opens the selected file in a new vertically split window and puts the cursor
@@ -369,7 +369,7 @@ in the new window.
------------------------------------------------------------------------------ ------------------------------------------------------------------------------
*NERDTree-gs* *NERDTree-gs*
Default key: gs Default key: gs
Map setting: NERDTreeMapPreviewVSplit Map setting: *NERDTreeMapPreviewVSplit*
Applies to: files. Applies to: files.
The same as |NERDTree-s| except that the cursor is not moved. The same as |NERDTree-s| except that the cursor is not moved.
@@ -377,10 +377,19 @@ The same as |NERDTree-s| except that the cursor is not moved.
The default key combo for this mapping is "g" + NERDTreeMapOpenVSplit (see The default key combo for this mapping is "g" + NERDTreeMapOpenVSplit (see
|NERDTree-s|). |NERDTree-s|).
------------------------------------------------------------------------------
*NERDTree-<CR>*
Default key: <CR>
Map setting: *NERDTreeMapCustomOpen*
Applies to: files, directories, and bookmarks
Performs a customized open action on the selected node. This allows the user
to define an action that behaves differently from any of the standard
keys. See |NERDTreeCustomOpenArgs| for more details.
------------------------------------------------------------------------------ ------------------------------------------------------------------------------
*NERDTree-O* *NERDTree-O*
Default key: O Default key: O
Map setting: NERDTreeMapOpenRecursively Map setting: *NERDTreeMapOpenRecursively*
Applies to: directories. Applies to: directories.
Recursively opens the selected directory. Recursively opens the selected directory.
@@ -393,7 +402,7 @@ cached. This is handy, especially if you have .svn directories.
------------------------------------------------------------------------------ ------------------------------------------------------------------------------
*NERDTree-x* *NERDTree-x*
Default key: x Default key: x
Map setting: NERDTreeMapCloseDir Map setting: *NERDTreeMapCloseDir*
Applies to: files and directories. Applies to: files and directories.
Closes the parent of the selected node. Closes the parent of the selected node.
@@ -401,7 +410,7 @@ Closes the parent of the selected node.
------------------------------------------------------------------------------ ------------------------------------------------------------------------------
*NERDTree-X* *NERDTree-X*
Default key: X Default key: X
Map setting: NERDTreeMapCloseChildren Map setting: *NERDTreeMapCloseChildren*
Applies to: directories. Applies to: directories.
Recursively closes all children of the selected directory. Recursively closes all children of the selected directory.
@@ -411,7 +420,7 @@ Tip: To quickly "reset" the tree, use |NERDTree-P| with this mapping.
------------------------------------------------------------------------------ ------------------------------------------------------------------------------
*NERDTree-e* *NERDTree-e*
Default key: e Default key: e
Map setting: NERDTreeMapOpenExpl Map setting: *NERDTreeMapOpenExpl*
Applies to: files and directories. Applies to: files and directories.
|:edit|s the selected directory, or the selected file's directory. This could |:edit|s the selected directory, or the selected file's directory. This could
@@ -421,7 +430,7 @@ result in a NERDTree or a netrw being opened, depending on
------------------------------------------------------------------------------ ------------------------------------------------------------------------------
*NERDTree-D* *NERDTree-D*
Default key: D Default key: D
Map setting: NERDTreeMapDeleteBookmark Map setting: *NERDTreeMapDeleteBookmark*
Applies to: lines in the bookmarks table Applies to: lines in the bookmarks table
Deletes the currently selected bookmark. Deletes the currently selected bookmark.
@@ -429,7 +438,7 @@ Deletes the currently selected bookmark.
------------------------------------------------------------------------------ ------------------------------------------------------------------------------
*NERDTree-P* *NERDTree-P*
Default key: P Default key: P
Map setting: NERDTreeMapJumpRoot Map setting: *NERDTreeMapJumpRoot*
Applies to: no restrictions. Applies to: no restrictions.
Jump to the tree root. Jump to the tree root.
@@ -437,7 +446,7 @@ Jump to the tree root.
------------------------------------------------------------------------------ ------------------------------------------------------------------------------
*NERDTree-p* *NERDTree-p*
Default key: p Default key: p
Map setting: NERDTreeMapJumpParent Map setting: *NERDTreeMapJumpParent*
Applies to: files and directories. Applies to: files and directories.
Jump to the parent node of the selected node. Jump to the parent node of the selected node.
@@ -445,7 +454,7 @@ Jump to the parent node of the selected node.
------------------------------------------------------------------------------ ------------------------------------------------------------------------------
*NERDTree-K* *NERDTree-K*
Default key: K Default key: K
Map setting: NERDTreeMapJumpFirstChild Map setting: *NERDTreeMapJumpFirstChild*
Applies to: files and directories. Applies to: files and directories.
Jump to the first child of the current nodes parent. Jump to the first child of the current nodes parent.
@@ -458,7 +467,7 @@ If the cursor is already on the first node then do the following:
------------------------------------------------------------------------------ ------------------------------------------------------------------------------
*NERDTree-J* *NERDTree-J*
Default key: J Default key: J
Map setting: NERDTreeMapJumpLastChild Map setting: *NERDTreeMapJumpLastChild*
Applies to: files and directories. Applies to: files and directories.
Jump to the last child of the current nodes parent. Jump to the last child of the current nodes parent.
@@ -471,7 +480,7 @@ If the cursor is already on the last node then do the following:
------------------------------------------------------------------------------ ------------------------------------------------------------------------------
*NERDTree-C-J* *NERDTree-C-J*
Default key: <C-J> Default key: <C-J>
Map setting: NERDTreeMapJumpNextSibling Map setting: *NERDTreeMapJumpNextSibling*
Applies to: files and directories. Applies to: files and directories.
Jump to the next sibling of the selected node. Jump to the next sibling of the selected node.
@@ -479,7 +488,7 @@ Jump to the next sibling of the selected node.
------------------------------------------------------------------------------ ------------------------------------------------------------------------------
*NERDTree-C-K* *NERDTree-C-K*
Default key: <C-K> Default key: <C-K>
Map setting: NERDTreeMapJumpPrevSibling Map setting: *NERDTreeMapJumpPrevSibling*
Applies to: files and directories. Applies to: files and directories.
Jump to the previous sibling of the selected node. Jump to the previous sibling of the selected node.
@@ -487,7 +496,7 @@ Jump to the previous sibling of the selected node.
------------------------------------------------------------------------------ ------------------------------------------------------------------------------
*NERDTree-C* *NERDTree-C*
Default key: C Default key: C
Map setting: NERDTreeMapChangeRoot Map setting: *NERDTreeMapChangeRoot*
Applies to: files and directories. Applies to: files and directories.
Make the selected directory node the new tree root. If a file is selected, its Make the selected directory node the new tree root. If a file is selected, its
@@ -496,7 +505,7 @@ parent is used.
------------------------------------------------------------------------------ ------------------------------------------------------------------------------
*NERDTree-u* *NERDTree-u*
Default key: u Default key: u
Map setting: NERDTreeMapUpdir Map setting: *NERDTreeMapUpdir*
Applies to: no restrictions. Applies to: no restrictions.
Move the tree root up a dir (like doing a "cd .."). Move the tree root up a dir (like doing a "cd ..").
@@ -504,7 +513,7 @@ Move the tree root up a dir (like doing a "cd ..").
------------------------------------------------------------------------------ ------------------------------------------------------------------------------
*NERDTree-U* *NERDTree-U*
Default key: U Default key: U
Map setting: NERDTreeMapUpdirKeepOpen Map setting: *NERDTreeMapUpdirKeepOpen*
Applies to: no restrictions. Applies to: no restrictions.
Like |NERDTree-u| except that the old tree root is kept open. Like |NERDTree-u| except that the old tree root is kept open.
@@ -512,7 +521,7 @@ Like |NERDTree-u| except that the old tree root is kept open.
------------------------------------------------------------------------------ ------------------------------------------------------------------------------
*NERDTree-r* *NERDTree-r*
Default key: r Default key: r
Map setting: NERDTreeMapRefresh Map setting: *NERDTreeMapRefresh*
Applies to: files and directories. Applies to: files and directories.
If a dir is selected, recursively refresh that dir, i.e. scan the filesystem If a dir is selected, recursively refresh that dir, i.e. scan the filesystem
@@ -523,7 +532,7 @@ If a file node is selected then the above is done on it's parent.
------------------------------------------------------------------------------ ------------------------------------------------------------------------------
*NERDTree-R* *NERDTree-R*
Default key: R Default key: R
Map setting: NERDTreeMapRefreshRoot Map setting: *NERDTreeMapRefreshRoot*
Applies to: no restrictions. Applies to: no restrictions.
Recursively refresh the tree root. Recursively refresh the tree root.
@@ -531,7 +540,7 @@ Recursively refresh the tree root.
------------------------------------------------------------------------------ ------------------------------------------------------------------------------
*NERDTree-m* *NERDTree-m*
Default key: m Default key: m
Map setting: NERDTreeMapMenu Map setting: *NERDTreeMapMenu*
Applies to: files and directories. Applies to: files and directories.
Display the NERDTree menu. See |NERDTreeMenu| for details. Display the NERDTree menu. See |NERDTreeMenu| for details.
@@ -539,7 +548,7 @@ Display the NERDTree menu. See |NERDTreeMenu| for details.
------------------------------------------------------------------------------ ------------------------------------------------------------------------------
*NERDTree-cd* *NERDTree-cd*
Default key: cd Default key: cd
Map setting: NERDTreeMapChdir Map setting: *NERDTreeMapChdir*
Applies to: files and directories. Applies to: files and directories.
Change Vim's current working directory to that of the selected node. Change Vim's current working directory to that of the selected node.
@@ -547,7 +556,7 @@ Change Vim's current working directory to that of the selected node.
------------------------------------------------------------------------------ ------------------------------------------------------------------------------
*NERDTree-CD* *NERDTree-CD*
Default key: CD Default key: CD
Map setting: NERDTreeMapCWD Map setting: *NERDTreeMapCWD*
Applies to: no restrictions. Applies to: no restrictions.
Change the NERDTree root to Vim's current working directory. Change the NERDTree root to Vim's current working directory.
@@ -555,7 +564,7 @@ Change the NERDTree root to Vim's current working directory.
------------------------------------------------------------------------------ ------------------------------------------------------------------------------
*NERDTree-I* *NERDTree-I*
Default key: I Default key: I
Map setting: NERDTreeMapToggleHidden Map setting: *NERDTreeMapToggleHidden*
Applies to: no restrictions. Applies to: no restrictions.
Toggles whether hidden files (i.e. "dot files") are displayed. Toggles whether hidden files (i.e. "dot files") are displayed.
@@ -563,7 +572,7 @@ Toggles whether hidden files (i.e. "dot files") are displayed.
------------------------------------------------------------------------------ ------------------------------------------------------------------------------
*NERDTree-f* *NERDTree-f*
Default key: f Default key: f
Map setting: NERDTreeMapToggleFilters Map setting: *NERDTreeMapToggleFilters*
Applies to: no restrictions. Applies to: no restrictions.
Toggles whether file filters are used. See |NERDTreeIgnore| for details. Toggles whether file filters are used. See |NERDTreeIgnore| for details.
@@ -571,7 +580,7 @@ Toggles whether file filters are used. See |NERDTreeIgnore| for details.
------------------------------------------------------------------------------ ------------------------------------------------------------------------------
*NERDTree-F* *NERDTree-F*
Default key: F Default key: F
Map setting: NERDTreeMapToggleFiles Map setting: *NERDTreeMapToggleFiles*
Applies to: no restrictions. Applies to: no restrictions.
Toggles whether file nodes are displayed. Toggles whether file nodes are displayed.
@@ -579,7 +588,7 @@ Toggles whether file nodes are displayed.
------------------------------------------------------------------------------ ------------------------------------------------------------------------------
*NERDTree-B* *NERDTree-B*
Default key: B Default key: B
Map setting: NERDTreeMapToggleBookmarks Map setting: *NERDTreeMapToggleBookmarks*
Applies to: no restrictions. Applies to: no restrictions.
Toggles whether the bookmarks table is displayed. Toggles whether the bookmarks table is displayed.
@@ -587,7 +596,7 @@ Toggles whether the bookmarks table is displayed.
------------------------------------------------------------------------------ ------------------------------------------------------------------------------
*NERDTree-q* *NERDTree-q*
Default key: q Default key: q
Map setting: NERDTreeMapQuit Map setting: *NERDTreeMapQuit*
Applies to: no restrictions. Applies to: no restrictions.
Closes the NERDTree window. Closes the NERDTree window.
@@ -595,7 +604,7 @@ Closes the NERDTree window.
------------------------------------------------------------------------------ ------------------------------------------------------------------------------
*NERDTree-A* *NERDTree-A*
Default key: A Default key: A
Map setting: NERDTreeMapToggleZoom Map setting: *NERDTreeMapToggleZoom*
Applies to: no restrictions. Applies to: no restrictions.
Maximize (zoom) and minimize the NERDTree window. Maximize (zoom) and minimize the NERDTree window.
@@ -603,7 +612,7 @@ Maximize (zoom) and minimize the NERDTree window.
------------------------------------------------------------------------------ ------------------------------------------------------------------------------
*NERDTree-?* *NERDTree-?*
Default key: ? Default key: ?
Map setting: NERDTreeMapHelp Map setting: *NERDTreeMapHelp*
Applies to: no restrictions. Applies to: no restrictions.
Toggles whether the quickhelp is displayed. Toggles whether the quickhelp is displayed.
@@ -625,7 +634,7 @@ Related tags: |NERDTree-m| |NERDTreeApi|
------------------------------------------------------------------------------ ------------------------------------------------------------------------------
*NERDTreeMenu-j* *NERDTreeMenu-j*
Default key: j Default key: j
Map option: NERDTreeMenuDown Map option: *NERDTreeMenuDown*
Applies to: The NERDTree menu. Applies to: The NERDTree menu.
Moves the cursor down. Moves the cursor down.
@@ -633,7 +642,7 @@ Moves the cursor down.
------------------------------------------------------------------------------ ------------------------------------------------------------------------------
*NERDTreeMenu-k* *NERDTreeMenu-k*
Default key: k Default key: k
Map option: NERDTreeMenuUp Map option: *NERDTreeMenuUp*
Applies to: The NERDTree menu. Applies to: The NERDTree menu.
Moves the cursor up. Moves the cursor up.
@@ -754,6 +763,9 @@ the NERDTree. These settings should be set in your vimrc, using `:let`.
file or directory name from the rest of the file or directory name from the rest of the
characters on the line of text. characters on the line of text.
|NERDTreeCustomOpenArgs| A dictionary with values that control how a node
is opened with the |NERDTree-<CR>| key.
------------------------------------------------------------------------------ ------------------------------------------------------------------------------
3.2. Customisation details *NERDTreeSettingsDetails* 3.2. Customisation details *NERDTreeSettingsDetails*
@@ -1233,6 +1245,32 @@ when specifying by hex or Unicode. >
let NERDTreeNodeDelimiter="\u00a0" "non-breaking space let NERDTreeNodeDelimiter="\u00a0" "non-breaking space
let NERDTreeNodeDelimiter="😀" "smiley face let NERDTreeNodeDelimiter="😀" "smiley face
< <
------------------------------------------------------------------------------
*NERDTreeCustomOpenArgs*
Values: A nested dictionary, as described below
Default: {'file': {'reuse': 'all', 'where': 'p'}, 'dir': {}}
This dictionary contains two keys, 'file' and 'dir', whose values each are
another dictionary. The inner dictionary is a set of parameters used by
|NERDTree-<CR>| to open a file or directory. Setting these parameters allows you
to customize the way the node is opened. The default value matches what
|NERDTree-o| does. To change that behavior, use these keys and
values in the inner dictionaries:
'where': specifies whether the node should be opened in a new split ("h" or
"v"), in a new tab ("t") or, in the last window ("p").
'reuse': if file is already shown in a window, jump there; takes values
"all", "currenttab", or empty
'keepopen': boolean (0 or 1); if true, the tree window will not be closed
'stay': boolean (0 or 1); if true, remain in tree window after opening
For example:
To open files and directories (creating a new NERDTree) in a new tab, >
{'file':{'where': 't'}, 'dir':{'where':'t'}}
<
To open a file always in the current tab, and expand directories in place, >
{'file': {'reuse':'currenttab', 'where':'p', 'keepopen':1, 'stay':1}}
<
============================================================================== ==============================================================================
4. The NERDTree API *NERDTreeAPI* 4. The NERDTree API *NERDTreeAPI*

View File

@@ -13,9 +13,6 @@ let g:NERDTreeCreator = s:Creator
" FUNCTION: s:Creator._bindMappings() {{{1 " FUNCTION: s:Creator._bindMappings() {{{1
function! s:Creator._bindMappings() function! s:Creator._bindMappings()
"make <cr> do the same as the activate node mapping
nnoremap <silent> <buffer> <cr> :call nerdtree#ui_glue#invokeKeyMap(g:NERDTreeMapActivateNode)<cr>
call g:NERDTreeKeyMap.BindAll() call g:NERDTreeKeyMap.BindAll()
command! -buffer -nargs=? Bookmark :call nerdtree#ui_glue#bookmarkNode('<args>') command! -buffer -nargs=? Bookmark :call nerdtree#ui_glue#bookmarkNode('<args>')

View File

@@ -28,7 +28,6 @@ function! s:UI._dumpHelp()
let help .= "\" ============================\n" let help .= "\" ============================\n"
let help .= "\" File node mappings~\n" let help .= "\" File node mappings~\n"
let help .= "\" ". (g:NERDTreeMouseMode ==# 3 ? "single" : "double") ."-click,\n" let help .= "\" ". (g:NERDTreeMouseMode ==# 3 ? "single" : "double") ."-click,\n"
let help .= "\" <CR>,\n"
if self.nerdtree.isTabTree() if self.nerdtree.isTabTree()
let help .= "\" ". g:NERDTreeMapActivateNode .": open in prev window\n" let help .= "\" ". g:NERDTreeMapActivateNode .": open in prev window\n"
else else
@@ -44,6 +43,7 @@ function! s:UI._dumpHelp()
let help .= "\" ". g:NERDTreeMapPreviewSplit .": preview split\n" let help .= "\" ". g:NERDTreeMapPreviewSplit .": preview split\n"
let help .= "\" ". g:NERDTreeMapOpenVSplit .": open vsplit\n" let help .= "\" ". g:NERDTreeMapOpenVSplit .": open vsplit\n"
let help .= "\" ". g:NERDTreeMapPreviewVSplit .": preview vsplit\n" let help .= "\" ". g:NERDTreeMapPreviewVSplit .": preview vsplit\n"
let help .= "\" ". g:NERDTreeMapCustomOpen .": custom open\n"
let help .= "\"\n\" ----------------------------\n" let help .= "\"\n\" ----------------------------\n"
let help .= "\" Directory node mappings~\n" let help .= "\" Directory node mappings~\n"
@@ -52,6 +52,7 @@ function! s:UI._dumpHelp()
let help .= "\" ". g:NERDTreeMapOpenRecursively .": recursively open node\n" let help .= "\" ". g:NERDTreeMapOpenRecursively .": recursively open node\n"
let help .= "\" ". g:NERDTreeMapOpenInTab.": open in new tab\n" let help .= "\" ". g:NERDTreeMapOpenInTab.": open in new tab\n"
let help .= "\" ". g:NERDTreeMapOpenInTabSilent .": open in new tab silently\n" let help .= "\" ". g:NERDTreeMapOpenInTabSilent .": open in new tab silently\n"
let help .= "\" ". g:NERDTreeMapCustomOpen .": custom open\n"
let help .= "\" ". g:NERDTreeMapCloseDir .": close parent of node\n" let help .= "\" ". g:NERDTreeMapCloseDir .": close parent of node\n"
let help .= "\" ". g:NERDTreeMapCloseChildren .": close all child nodes of\n" let help .= "\" ". g:NERDTreeMapCloseChildren .": close all child nodes of\n"
let help .= "\" current node recursively\n" let help .= "\" current node recursively\n"
@@ -66,6 +67,7 @@ function! s:UI._dumpHelp()
let help .= "\" ". g:NERDTreeMapPreview .": find dir in tree\n" let help .= "\" ". g:NERDTreeMapPreview .": find dir in tree\n"
let help .= "\" ". g:NERDTreeMapOpenInTab.": open in new tab\n" let help .= "\" ". g:NERDTreeMapOpenInTab.": open in new tab\n"
let help .= "\" ". g:NERDTreeMapOpenInTabSilent .": open in new tab silently\n" let help .= "\" ". g:NERDTreeMapOpenInTabSilent .": open in new tab silently\n"
let help .= "\" ". g:NERDTreeMapCustomOpen .": custom open\n"
let help .= "\" ". g:NERDTreeMapDeleteBookmark .": delete bookmark\n" let help .= "\" ". g:NERDTreeMapDeleteBookmark .": delete bookmark\n"
let help .= "\"\n\" ----------------------------\n" let help .= "\"\n\" ----------------------------\n"

View File

@@ -121,6 +121,7 @@ endif
"SECTION: Init variable calls for key mappings {{{2 "SECTION: Init variable calls for key mappings {{{2
call s:initVariable("g:NERDTreeMapCustomOpen", "<CR>")
call s:initVariable("g:NERDTreeMapActivateNode", "o") call s:initVariable("g:NERDTreeMapActivateNode", "o")
call s:initVariable("g:NERDTreeMapChangeRoot", "C") call s:initVariable("g:NERDTreeMapChangeRoot", "C")
call s:initVariable("g:NERDTreeMapChdir", "cd") call s:initVariable("g:NERDTreeMapChdir", "cd")