1
0
mirror of https://github.com/amix/vimrc synced 2025-06-16 09:35:01 +08:00

Updated plugins

This commit is contained in:
Amir Salihefendic
2019-08-22 17:36:17 +02:00
parent 6711ae6453
commit 3aefdbd21a
244 changed files with 9486 additions and 3395 deletions

View File

@ -1,28 +0,0 @@
<!--- To assist in resolving your issue, provide as much information as possible. -->
### Environment
<!--- Describe your Vim/NERDTree setup. -->
* Operating System:
* Vim version `:version`:
* NERDTree version `git rev-parse --short HEAD`:
* NERDTree settings applied in your vimrc, if any:
```vim
```
### Process
<!--- List the steps that will recreate the issue. -->
1.
### Current Result
<!--- Describe what you you currently experience from this process. -->
### Expected Result
<!--- Describe what you would have expected from this process. -->
### Screenshot(s)
### Possible Fix
<!--- If you have explored the code, share what you've found. -->

View File

@ -0,0 +1,45 @@
---
name: "Bug Report"
about: "NERDTree is misbehaving? Tell us about it."
labels: bug
---
<!-- Attention! Please Read!
Please fill out ALL the information below so that the issue can be fully
understood. Omitting information will delay the resolution of your issue. It
will be labeled "Needs More Info", and may be closed until there is enough
information.
Keep in mind that others may have the same question in the future. The better
your information, the more likely they'll be able to help themselves. -->
#### Self-Diagnosis
<!-- Check the boxes after creating the issue, or use [x]. -->
- [ ] I have searched the [issues](https://github.com/scrooloose/nerdtree/issues) for an answer to my question.
- [ ] I have reviewed the NERDTree documentation. `:h NERDTree`
- [ ] I have reviewed the [Wiki](https://github.com/scrooloose/nerdtree/wiki).
- [ ] I have searched the web for an answer to my question.
#### Environment (for bug reports)
- [ ] Operating System:
- [ ] Vim/Neovim version `:echo v:version`:
- [ ] NERDTree version, found on 1st line in NERDTree quickhelp `?`:
- [ ] vimrc settings
- [ ] NERDTree variables
```vim
```
- Other NERDTree-dependent Plugins
- [ ] jistr/vim-nerdtree-tabs
- [ ] ryanoasis/vim-devicons
- [ ] tiagofumo/vim-nerdtree-syntax-highlight
- [ ] Xuyuanp/nerdtree-git-plugin
- [ ] Others (specify):
- [ ] I've verified the issue occurs with only NERDTree installed.
#### Steps to Reproduce the Issue
1.
#### Current Result (Include screenshots where appropriate.)
#### Expected Result

View File

@ -0,0 +1,8 @@
---
name: "Feature Request"
about: "What new feature are you requesting for NERDTree?"
labels: "feature request"
---
#### Description

View File

@ -0,0 +1,24 @@
---
name: "General Question"
about: "Having trouble setting up NERDTree? Need clarification on a setting? Ask your question here."
labels: "general question"
---
<!-- Attention! Please Read!
Please fill out ALL the information below so that the issue can be fully
understood. Omitting information will delay the resolution of your issue. It
will be labeled "Needs More Info", and may be closed until there is enough
information.
Keep in mind that others may have the same question in the future. The better
your information, the more likely they'll be able to help themselves. -->
#### Self-Diagnosis
<!-- Check the boxes after creating the issue, or use [x]. -->
- [ ] I have searched the [issues](https://github.com/scrooloose/nerdtree/issues) for an answer to my question.
- [ ] I have reviewed the NERDTree documentation. `:h NERDTree`
- [ ] I have reviewed the [Wiki](https://github.com/scrooloose/nerdtree/wiki).
- [ ] I have searched the web for an answer to my question.
#### State Your Question

View File

@ -0,0 +1,13 @@
### Description of Changes
Closes # <!-- Issue number this PR addresses. If none, remove this line. -->
---
### New Version Info
- [ ] Derive a new version number. Increment the:
- [ ] `MAJOR` version when you make incompatible API changes
- [ ] `MINOR` version when you add functionality in a backwards-compatible manner
- [ ] `PATCH` version when you make backwards-compatible bug fixes
- [ ] Update [CHANGELOG.md](https://github.com/scrooloose/nerdtree/blob/master/CHANGELOG.md), following the established pattern.
- [ ] Tag the merge commit, e.g. `git tag -a 3.1.4 -m "v3.1.4" && git push origin --tags`

View File

@ -1,179 +0,0 @@
Next
- Fix broken "t" and "T" mappings, tabs now open at end (lifecrisis) #759
- 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.
- Fix markdown headers in readme (josephfrazier) #676
- Don't touch @o and @h registers when rendering
- Fix bug with files and directories with dollar signs (alegen) #649
- Reuse/reopen existing window trees where possible #244
- Remove NERDTree.previousBuf()
- Change color of arrow (Leeiio) #630
- Improved a tip in README.markdown (ggicci) #628
- Shorten delete confimration of empty directory to 'y' (mikeperri) #530
- Fix API call to open directory tree in window (devm33) #533
- Change default arrows on non-Windows platforms (gwilk) #546
- Update to README - combine cd and git clone (zwhitchcox) #584
- Update to README - Tip: start NERDTree when vim starts (therealplato) #593
- Escape filename when moving an open buffer (zacharyvoase) #595
- Fixed incorrect :helptags command in README (curran) #619
- Fixed incomplete escaping of folder arrows (adityanatraj) #548
- Added NERDTreeCascadeSingleChildDir option (juanibiapina) #558
- Replace strchars() with backward compatible workaround.
- Add support for copy command in Windows (SkylerLipthay) #231
- Fixed typo in README.markdown - :Helptags -> :helptags
- Rename "primary" and "secondary" trees to "tab" and "window" trees.
- Move a bunch of buffer level variables into the NERDTree and UI classes.
- Display cascading dirs on one line to save vertical/horizontal space (@matt-gardner: brainstorming/testing)
- Remove the old style UI - Remove 'NERDTreeDirArrows' option.
- 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.
5.0.0
- Refactor the code significantly:
* 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.
- Add an API to assign flags to nodes. This allows VCS plugins like
https://github.com/Xuyuanp/nerdtree-git-plugin to exist. Thanks to
Xuyuanp for helping design/test/build said API.
- add 'scope' argument to the key map API see :help NERDTreeAddKeyMap()
- add magic [[dir]] and [[file]] flags to NERDTreeIgnore
- add support for custom path filters. See :help NERDTreeAddPathFilter()
- add path listener API. See :help NERDTreePathListenerAPI.
- expand the fs menu functionality to list file properties (PhilRunninger,
apbarrero, JESii)
- make bookmarks work with `~` home shortcuts (hiberabyss)
- show OSX specific fsmenu options in regular vim on mac (evindor)
- make dir arrow icons configurable (PickRelated)
- optimise node sorting performance when opening large dirs (vtsang)
- make the root note render prettier by truncating it at a path slash (gcmt)
- remove NERDChristmasTree option - its always christmas now
- add "cascade" open and closing for dirs containing only another single
dir. See :help NERDTreeCascadeOpenSingleChildDir (pendulm)
Many other fixes, doc updates and contributions from:
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
- 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)
- 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)
- 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)
- use 'file' completion when doing copying, create, and move
operations (EvanDotPro)
- lots of misc bug fixes (paddyoloughlin, sdewald, camthompson, Vitaly
Bogdanov, AndrewRadev, mathias, scottstvnsn, kml, wycats, me RAWR!)
4.1.0
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.
- 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.
bugfixes:
- really fix window state restoring
- fix some win32 path escaping issues. Thanks to Stephan Baumeister, Ricky,
jfilip1024, and Chris Chambers
4.0.0
- 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).
- 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.
- 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 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 NERDTreeMirror would mirror the wrong tree
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
- make <CR> behave the same as the 'o' mapping
- 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
- other minor fixes
3.1.0
New features:
- 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'
Bugfixes:
- 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)
- 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 a bug with the relative path code (thanks to nach)
- fix a bug where doing a :cd would cause :NERDTreeToggle to fail (thanks nach)
3.0.1
Bugfixes:
- 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.
- make the q mapping work with secondary (:e <dir> style) trees,
thanks to jamessan
- fix a bunch of small bugs with secondary trees
More insane refactoring.
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'
- allow sharing of trees across tabs, see :help :NERDTreeMirror
- remove "top" and "bottom" as valid settings for NERDTreeWinPos
- change the '<tab>' mapping to 'i'
- change the 'H' mapping to 'I'
- lots of refactoring

View File

@ -0,0 +1,222 @@
# Change Log
#### 5.3...
- **.0**: Add file extension and size to sorting capabilities [#1029](https://github.com/scrooloose/nerdtree/pull/1029)
#### 5.2...
- **.9**: Suppress events for intermediate window/tab/buffer changes [#1026](https://github.com/scrooloose/nerdtree/pull/1026)
- **.8**: Revert [#1019](https://github.com/scrooloose/nerdtree/pull/1019) to fix nvim artifacts and flickering. (PhilRunninger) [#1021](https://github.com/scrooloose/nerdtree/pull/1021)
- **.7**: Use :mode only in neovim. MacVim still needs to use :redraw! [#1019](https://github.com/scrooloose/nerdtree/pull/1019)
- **.6**: In CHANGELOG.md and PR template, make reference to PR a true HTML link. [#1017](https://github.com/scrooloose/nerdtree/pull/1017)
- **.5**: Use `:mode` instead of `:redraw!` when updating menu. (PhilRunninger) [#1016](https://github.com/scrooloose/nerdtree/pull/1016)
- **.4**: When searching for root line num, stop at end of file. (PhilRunninger) [#1015](https://github.com/scrooloose/nerdtree/pull/1015)
- **.3**: Fix `<CR>` key map on the bookmark (lkebin) [#1014](https://github.com/scrooloose/nerdtree/pull/1014)
- **.2**: Make Enter work on the `.. ( up a dir )` line (PhilRunninger) [#1013](https://github.com/scrooloose/nerdtree/pull/1013)
- **.1**: Fix nerdtree#version() on Windows. (PhilRunninger)
- **.0**: Expand functionality of `<CR>` mapping. (PhilRunninger) [#1011](https://github.com/scrooloose/nerdtree/pull/1011)
#### 5.1...
- **.3**: Remove @mentions from PR template and change log. They weren't working. (PhilRunninger) [#1009](https://github.com/scrooloose/nerdtree/pull/1009)
- **.2**: Fix NERDTree opening with the wrong size. (PhilRunninger) [#1008](https://github.com/scrooloose/nerdtree/pull/1008)
- **.1**: Update Changelog and create PR Template (PhilRunninger) [#1007](https://github.com/scrooloose/nerdtree/pull/1007)
- **.0**: Too many changes for one patch...
- Refresh a dir_node if the file wasn't found in it, and look once more. (PhilRunninger) [#1005](https://github.com/scrooloose/nerdtree/pull/1005)
- Add a "copy path to clipboard" menu option (PhilRunninger) [#1002](https://github.com/scrooloose/nerdtree/pull/1002)
- Enable root refresh on "vim ." a different way than [#999](https://github.com/scrooloose/nerdtree/pull/999). (PhilRunninger) [#1001](https://github.com/scrooloose/nerdtree/pull/1001)
- Fix refreshroot (PhilRunninger) [#999](https://github.com/scrooloose/nerdtree/pull/999)
- Change version check to look for 703 not 730 (vhalis) [#994](https://github.com/scrooloose/nerdtree/pull/994)
- Change minimum vim (PhilRunninger) [#991](https://github.com/scrooloose/nerdtree/pull/991)
- Allow multi-character DirArrows (PhilRunninger) [#985](https://github.com/scrooloose/nerdtree/pull/985)
- Remove redraw! while still clearing last message empty string. (PhilRunninger) [#979](https://github.com/scrooloose/nerdtree/pull/979)
- fix `_initChildren` function value set to numChildrenCached error (terryding77) [#969](https://github.com/scrooloose/nerdtree/pull/969)
- On Windows, do a case-insensitive comparison of paths. (PhilRunninger) [#967](https://github.com/scrooloose/nerdtree/pull/967)
- Remove the **Please wait... DONE** messages. (PhilRunninger) [#966](https://github.com/scrooloose/nerdtree/pull/966)
- Smarter delimiter default (PhilRunninger) [#963](https://github.com/scrooloose/nerdtree/pull/963)
- Update directory .vimdc readme example (spencerdcarlson) [#961](https://github.com/scrooloose/nerdtree/pull/961)
- Preview bookmarks (PhilRunninger) [#956](https://github.com/scrooloose/nerdtree/pull/956)
- Add new value to NERDTreeQuitOnOpen to close bookmark table (PhilRunninger) [#955](https://github.com/scrooloose/nerdtree/pull/955)
- Add an :EditBookmarks command to edit the bookmarks file (PhilRunninger) [#954](https://github.com/scrooloose/nerdtree/pull/954)
- Before copying, turn off &shellslash. Restore after copy is finished. (PhilRunninger) [#952](https://github.com/scrooloose/nerdtree/pull/952)
- Set a maximum window size when zooming. (PhilRunninger) [#950](https://github.com/scrooloose/nerdtree/pull/950)
- Confirm the wipeout of a unsaved buffer whose file has been renamed. (PhilRunninger) [#949](https://github.com/scrooloose/nerdtree/pull/949)
- Escape a backslash so it can be used in a key mapping. (PhilRunninger) [#948](https://github.com/scrooloose/nerdtree/pull/948)
- Add a NERDTreeMinimalMenu feature (tuzz) [#938](https://github.com/scrooloose/nerdtree/pull/938)
- fixed root path error for windows (zcodes) [#935](https://github.com/scrooloose/nerdtree/pull/935)
- Restore getDirChildren for use in nerdtree-project-plugin. (PhilRunninger) [#929](https://github.com/scrooloose/nerdtree/pull/929)
- Document NERDTreeNodeDelimiter [#912](https://github.com/scrooloose/nerdtree/pull/912) (PhilRunninger) [#926](https://github.com/scrooloose/nerdtree/pull/926)
- Allow modification of menu keybindings (Leandros) [#923](https://github.com/scrooloose/nerdtree/pull/923)
- Add two more disqualifications for isCascadable(). (PhilRunninger) [#914](https://github.com/scrooloose/nerdtree/pull/914)
- Allow highlighting more than one flag. (kristijanhusak) [#908](https://github.com/scrooloose/nerdtree/pull/908)
- Support sorting files and directories by modification time. (PhilRunninger) [#901](https://github.com/scrooloose/nerdtree/pull/901)
- Parse . and .. from path string with trailing slash. (PhilRunninger) [#899](https://github.com/scrooloose/nerdtree/pull/899)
- Force sort to recalculate the cached sortKey. (PhilRunninger) [#898](https://github.com/scrooloose/nerdtree/pull/898)
- Add NERDTreeRefreshRoot command (wgfm) [#897](https://github.com/scrooloose/nerdtree/pull/897)
- Call Resolve on the file's path when calling :NERDTreeFind. (PhilRunninger) [#896](https://github.com/scrooloose/nerdtree/pull/896)
- Catch all errors, not just NERDTree errors. (PhilRunninger) [#894](https://github.com/scrooloose/nerdtree/pull/894)
- Fix typo in help file (lvoisin) [#892](https://github.com/scrooloose/nerdtree/pull/892)
- Make NERDTreeCreator set the `'nolist'` option (lifecrisis) [#889](https://github.com/scrooloose/nerdtree/pull/889)
- Refresh buffers after `m`, `m` operation on a folder (PhilRunninger) [#888](https://github.com/scrooloose/nerdtree/pull/888)
- Use a better arg for FINDSTR when using the m,l command in Windows. (PhilRunninger) [#887](https://github.com/scrooloose/nerdtree/pull/887)
- Fix the <C-J>/<C-K> motions, which currently fail with cascades (lifecrisis) [#886](https://github.com/scrooloose/nerdtree/pull/886)
- Function "s:UI.getLineNum()" doesn't always work on cascades. (lifecrisis) [#882](https://github.com/scrooloose/nerdtree/pull/882)
- NERDTreeCWD: reset CWD if changed by NERDTreeFocus (PhilRunninger) [#878](https://github.com/scrooloose/nerdtree/pull/878)
- Use <count>tabnext instead of <count>gt to allow users to remap gt. (PhilRunninger) [#877](https://github.com/scrooloose/nerdtree/pull/877)
- Do a case sensitive comparison of new/existing buffers. (PhilRunninger) [#875](https://github.com/scrooloose/nerdtree/pull/875)
- Fix opening sub-directories that have commas in their name. (PhilRunninger) [#873](https://github.com/scrooloose/nerdtree/pull/873)
- Add new command to open NERDTree in the root of a VCS repository. (PhilRunninger) [#872](https://github.com/scrooloose/nerdtree/pull/872)
- Make sure the path to the bookmarks file exists before writing it. (PhilRunninger) [#871](https://github.com/scrooloose/nerdtree/pull/871)
- Unzoom NERDTree when opening a file (PhilRunninger) [#870](https://github.com/scrooloose/nerdtree/pull/870)
- Support unusual characters in file and directory names (PhilRunninger) [#868](https://github.com/scrooloose/nerdtree/pull/868)
- Reword renamed-buffer prompt to be more clear (aflock) [#867](https://github.com/scrooloose/nerdtree/pull/867)
- Default to placing cursor on root when closing bookmark table (lifecrisis) [#866](https://github.com/scrooloose/nerdtree/pull/866)
- Fix issues with sorting of nodes (PhilRunninger) [#856](https://github.com/scrooloose/nerdtree/pull/856)
- Better OSX detection (bubba-h57) [#853](https://github.com/scrooloose/nerdtree/pull/853)
- Bugfix - ensure keymaps dictionary exists before using it (mnussbaum) [#852](https://github.com/scrooloose/nerdtree/pull/852)
- Decrease startup-time by avoiding linear-time iteration over key mappings (mnussbaum) [#851](https://github.com/scrooloose/nerdtree/pull/851)
- Add code to sort mappings in quickhelp (lifecrisis) [#849](https://github.com/scrooloose/nerdtree/pull/849)
- Use ":clearjumps" in new NERDTree windows (lifecrisis) [#844](https://github.com/scrooloose/nerdtree/pull/844)
- Like m-c did before, create parent directories if needed on m-m. (PhilRunninger) [#840](https://github.com/scrooloose/nerdtree/pull/840)
- BUGFIX: Repair a problem with the `'u'` mapping. (lifecrisis) [#838](https://github.com/scrooloose/nerdtree/pull/838)
- Make the NERDTree buffer writable when rendering it. (PhilRunninger) [#837](https://github.com/scrooloose/nerdtree/pull/837)
- Code cleanup: Remove unsupported bookmark table mappings (lifecrisis) [#835](https://github.com/scrooloose/nerdtree/pull/835)
- Replace strcharpart() with substitute() for backward compatibility (bravestarr) [#834](https://github.com/scrooloose/nerdtree/pull/834)
- Fixed error `unknown function strcharpart` for older versions of Vim (hav4ik) [#833](https://github.com/scrooloose/nerdtree/pull/833)
- Clear output when NERDTree menu is aborted (lifecrisis) [#832](https://github.com/scrooloose/nerdtree/pull/832)
- Display a path with multi-byte characters correctly when it is truncated (bravestarr) [#830](https://github.com/scrooloose/nerdtree/pull/830)
- Support revealing file and executing file with xdg-open for Linux (ngnmhieu) [#824](https://github.com/scrooloose/nerdtree/pull/824)
- If node isn't open, count children on disk before deleting. (PhilRunninger) [#822](https://github.com/scrooloose/nerdtree/pull/822)
- Add new variable g:NERDTreeRemoveFileCmd (kutsan) [#816](https://github.com/scrooloose/nerdtree/pull/816)
- Use a better check for existence of the NERDTree buffer. (PhilRunninger) [#814](https://github.com/scrooloose/nerdtree/pull/814)
- Fix focussing previous buffer when closing NERDTree (mrubli) [#801](https://github.com/scrooloose/nerdtree/pull/801)
- Update the docs for "NERDTreeStatusline" (lifecrisis) [#796](https://github.com/scrooloose/nerdtree/pull/796)
- BUGFIX: Unstable behavior in the "getPath()" method (lifecrisis) [#795](https://github.com/scrooloose/nerdtree/pull/795)
- Revert the bugfix from pull request [#785](https://github.com/scrooloose/nerdtree/pull/785) (lifecrisis) [#794](https://github.com/scrooloose/nerdtree/pull/794)
- BUGFIX: Allow ":NERDTreeFind" to discover hidden files (lifecrisis) [#786](https://github.com/scrooloose/nerdtree/pull/786)
- BUGFIX: Allow ":NERDTreeFind" to reveal new files (lifecrisis) [#785](https://github.com/scrooloose/nerdtree/pull/785)
- Add modelines (lifecrisis) [#782](https://github.com/scrooloose/nerdtree/pull/782)
- Change the type of completion used by NERDTreeFind (lifecrisis) [#781](https://github.com/scrooloose/nerdtree/pull/781)
- change NERDTreeFind with args (zhenyangze) [#778](https://github.com/scrooloose/nerdtree/pull/778)
- Style Choice: Using confirm() when deleting a bookmark (lifecrisis) [#777](https://github.com/scrooloose/nerdtree/pull/777)
- remove useless substitute when `file =~# "/$"` (skyblueee) [#773](https://github.com/scrooloose/nerdtree/pull/773)
- remove useless removeLeadingSpaces in _stripMarkup (skyblueee) [#772](https://github.com/scrooloose/nerdtree/pull/772)
- Make the "o" mapping consistent with "x" (lifecrisis) [#769](https://github.com/scrooloose/nerdtree/pull/769)
- Fix a problem with the "x" handler (lifecrisis) [#768](https://github.com/scrooloose/nerdtree/pull/768)
- Clean up the handler for the "x" mapping (lifecrisis) [#767](https://github.com/scrooloose/nerdtree/pull/767)
- Revert change to tab opening method (lifecrisis) [#766](https://github.com/scrooloose/nerdtree/pull/766)
- BUGFIX: Add back support for "b:NERDTreeRoot" (lifecrisis) [#765](https://github.com/scrooloose/nerdtree/pull/765)
- Fix broken "t" and "T" mappings, tabs now open at end (lifecrisis) [#759](https://github.com/scrooloose/nerdtree/pull/759)
- Update doc with already existing mapping variables (asnr) [#699](https://github.com/scrooloose/nerdtree/pull/699)
- Fix the broken g:NERDTreeBookmarksSort setting (lifecrisis) [#696](https://github.com/scrooloose/nerdtree/pull/696)
- Correct NERDTreeIgnore pattern in doc (cntoplolicon) [#648](https://github.com/scrooloose/nerdtree/pull/648)
- Remove empty segments when splitting path (sooth-sayer) [#574](https://github.com/scrooloose/nerdtree/pull/574)
- Suppress autocmds less agressively (wincent) [#578](https://github.com/scrooloose/nerdtree/pull/578) [#691](https://github.com/scrooloose/nerdtree/pull/691)
- Add an Issues template to ask for more info initially.
- Fix markdown headers in readme (josephfrazier) [#676](https://github.com/scrooloose/nerdtree/pull/676)
- Don't touch `@o` and `@h` registers when rendering
- Fix bug with files and directories with dollar signs (alegen) [#649](https://github.com/scrooloose/nerdtree/pull/649)
- Reuse/reopen existing window trees where possible [#244](https://github.com/scrooloose/nerdtree/pull/244)
- Remove NERDTree.previousBuf()
- Change color of arrow (Leeiio) [#630](https://github.com/scrooloose/nerdtree/pull/630)
- Improved a tip in README.markdown (ggicci) [#628](https://github.com/scrooloose/nerdtree/pull/628)
- Shorten delete confimration of empty directory to `y` (mikeperri) [#530](https://github.com/scrooloose/nerdtree/pull/530)
- Fix API call to open directory tree in window (devm33) [#533](https://github.com/scrooloose/nerdtree/pull/533)
- Change default arrows on non-Windows platforms (gwilk) [#546](https://github.com/scrooloose/nerdtree/pull/546)
- Update to README - combine cd and git clone (zwhitchcox) [#584](https://github.com/scrooloose/nerdtree/pull/584)
- Update to README - Tip: start NERDTree when vim starts (therealplato) [#593](https://github.com/scrooloose/nerdtree/pull/593)
- Escape filename when moving an open buffer (zacharyvoase) [#595](https://github.com/scrooloose/nerdtree/pull/595)
- Fixed incorrect :helptags command in README (curran) [#619](https://github.com/scrooloose/nerdtree/pull/619)
- Fixed incomplete escaping of folder arrows (adityanatraj) [#548](https://github.com/scrooloose/nerdtree/pull/548)
- Added NERDTreeCascadeSingleChildDir option (juanibiapina) [#558](https://github.com/scrooloose/nerdtree/pull/558)
- Replace strchars() with backward compatible workaround.
- Add support for copy command in Windows (SkylerLipthay) [#231](https://github.com/scrooloose/nerdtree/pull/231)
- Fixed typo in README.markdown - :Helptags -> :helptags
- Rename "primary" and "secondary" trees to "tab" and "window" trees.
- Move a bunch of buffer level variables into the NERDTree and UI classes.
- Display cascading dirs on one line to save vertical/horizontal space (matt-gardner: brainstorming/testing)
- Remove the old style UI - Remove `NERDTreeDirArrows` option.
- 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.
#### 5.0.0
- Refactor the code significantly:
* 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.
- Add an API to assign flags to nodes. This allows VCS plugins like https://github.com/Xuyuanp/nerdtree-git-plugin to exist. Thanks to **Xuyuanp** for helping design/test/build said API.
- add `scope` argument to the key map API see :help NERDTreeAddKeyMap()
- add magic [[dir]] and [[file]] flags to NERDTreeIgnore
- add support for custom path filters. See :help NERDTreeAddPathFilter()
- add path listener API. See :help NERDTreePathListenerAPI.
- expand the fs menu functionality to list file properties (PhilRunninger, apbarrero, JESii)
- make bookmarks work with `~` home shortcuts (hiberabyss)
- show OSX specific fsmenu options in regular vim on mac (evindor)
- make dir arrow icons configurable (PickRelated)
- optimise node sorting performance when opening large dirs (vtsang)
- make the root note render prettier by truncating it at a path slash (gcmt)
- remove NERDChristmasTree option - its always christmas now
- add "cascade" open and closing for dirs containing only another single dir. See :help NERDTreeCascadeOpenSingleChildDir (pendulm)
- 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**
#### 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)
- 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 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)
- 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)
- lots of misc bug fixes from: **AndrewRadev**, **Bogdanov**, **camthompson**, **kml**, **mathias**, **paddyoloughlin**, **scottstvnsn**, **sdewald**, **Vitaly**, **wycats**, me RAWR!
#### 4.1.0
- 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.
- 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**.
- bugfixes:
- really fix window state restoring
- fix some win32 path escaping issues. Thanks to **Stephan Baumeister**, **Ricky**, **jfilip1024**, and **Chris Chambers**.
#### 4.0.0
- 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`).
- 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.
- 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 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 NERDTreeMirror would mirror the wrong tree
#### 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**
- make `<CR>` behave the same as the `o` mapping
- 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**.
- other minor fixes
#### 3.1.0
- New features:
- 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'`
- Bugfixes:
- 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**)
- 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 a bug with the relative path code (thanks to **nach**)
- fix a bug where doing a `:cd` would cause `:NERDTreeToggle` to fail (thanks **nach**)
#### 3.0.1
- Bugfixes:
- 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**.
- make the `q` mapping work with secondary (`:e <dir>` style) trees, thanks to **jamessan**
- fix a bunch of small bugs with secondary trees
- More insane refactoring.
#### 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'
- allow sharing of trees across tabs, see `:help :NERDTreeMirror`
- remove "top" and "bottom" as valid settings for NERDTreeWinPos
- change the `'<tab>'` mapping to `'i'`
- change the `'H'` mapping to `'I'`
- lots of refactoring

View File

@ -3,13 +3,38 @@ if exists("g:loaded_nerdtree_autoload")
endif
let g:loaded_nerdtree_autoload = 1
function! nerdtree#version()
return '5.0.0'
let s:rootNERDTreePath = resolve(expand("<sfile>:p:h:h"))
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
" 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
" Implements and() function for Vim <= 7.2
function! nerdtree#and(x,y)
@ -129,13 +154,13 @@ function! nerdtree#deprecated(func, ...)
endif
endfunction
" FUNCTION: nerdtree#exec(cmd) {{{2
" Same as :exec cmd but with eventignore set for the duration
" to disable the autocommands used by NERDTree (BufEnter,
" BufLeave and VimEnter)
function! nerdtree#exec(cmd)
" FUNCTION: nerdtree#exec(cmd, ignoreAll) {{{2
" Same as :exec cmd but, if ignoreAll is TRUE, set eventignore=all for the duration
function! nerdtree#exec(cmd, ignoreAll)
let old_ei = &ei
set ei=BufEnter,BufLeave,VimEnter
if a:ignoreAll
set ei=all
endif
exec a:cmd
let &ei = old_ei
endfunction

View File

@ -14,6 +14,10 @@ function! nerdtree#ui_glue#createDefaultBindings()
call NERDTreeAddKeyMap({ 'key': '<2-LeftMouse>', 'scope': "Bookmark", 'callback': s."activateBookmark" })
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:NERDTreeMapCustomOpen, 'scope':'all', 'callback': s."activateAll" })
call NERDTreeAddKeyMap({ 'key': g:NERDTreeMapActivateNode, 'scope': "DirNode", 'callback': s."activateDirNode" })
call NERDTreeAddKeyMap({ 'key': g:NERDTreeMapActivateNode, 'scope': "FileNode", 'callback': s."activateFileNode" })
@ -76,6 +80,35 @@ endfunction
"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 a:node.path.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
"handle the user activating the updir line
function! s:activateAll()
@ -84,15 +117,16 @@ function! s:activateAll()
endif
endfunction
" FUNCTION: s:activateDirNode(directoryNode) {{{1
function! s:activateDirNode(directoryNode)
" FUNCTION: s:activateDirNode(directoryNode, options) {{{1
" Open a directory with optional options
function! s:activateDirNode(directoryNode, ...)
if a:directoryNode.isRoot() && a:directoryNode.isOpen
call nerdtree#echo('cannot close tree root')
return
endif
call a:directoryNode.activate()
call a:directoryNode.activate((a:0 > 0) ? a:1 : {})
endfunction
"FUNCTION: s:activateFileNode() {{{1
@ -367,7 +401,7 @@ function! s:jumpToLastChild(node)
call s:jumpToChild(a:node, 1)
endfunction
" FUNCTION: s:jumpToChild(node, last) {{{2
" FUNCTION: s:jumpToChild(node, last) {{{1
" Jump to the first or last child node at the same file system level.
"
" Args:
@ -425,7 +459,7 @@ function! s:jumpToPrevSibling(node)
call s:jumpToSibling(a:node, 0)
endfunction
" FUNCTION: s:jumpToSibling(node, forward) {{{2
" FUNCTION: s:jumpToSibling(node, forward) {{{1
" Move the cursor to the next or previous node at the same file system level.
"
" Args:
@ -540,11 +574,11 @@ function! s:refreshRoot()
call nerdtree#echo("Refreshing the root node. This could take a while...")
let l:curWin = winnr()
call nerdtree#exec(g:NERDTree.GetWinNum() . "wincmd w")
call nerdtree#exec(g:NERDTree.GetWinNum() . "wincmd w", 1)
call b:NERDTree.root.refresh()
call b:NERDTree.render()
redraw
call nerdtree#exec(l:curWin . "wincmd w")
call nerdtree#exec(l:curWin . "wincmd w", 1)
call nerdtree#echo("")
endfunction

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|
s........Open selected file in a new vsplit.........................|NERDTree-s|
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|
x........Close the current nodes parent.............................|NERDTree-x|
X........Recursively close all children of the current node.........|NERDTree-X|
e........Edit the current dir.......................................|NERDTree-e|
<CR>............same as |NERDTree-o|.
double-click....same as |NERDTree-o|.
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*
Default key: t
Map setting: NERDTreeMapOpenInTab
Map setting: *NERDTreeMapOpenInTab*
Applies to: files and directories.
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*
Default key: T
Map setting: NERDTreeMapOpenInTabSilent
Map setting: *NERDTreeMapOpenInTabSilent*
Applies to: files and directories.
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*
Default key: i
Map setting: NERDTreeMapOpenSplit
Map setting: *NERDTreeMapOpenSplit*
Applies to: files.
Opens the selected file in a new split window and puts the cursor in the new
@ -349,7 +349,7 @@ window.
------------------------------------------------------------------------------
*NERDTree-gi*
Default key: gi
Map setting: NERDTreeMapPreviewSplit
Map setting: *NERDTreeMapPreviewSplit*
Applies to: files.
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*
Default key: s
Map setting: NERDTreeMapOpenVSplit
Map setting: *NERDTreeMapOpenVSplit*
Applies to: files.
Opens the selected file in a new vertically split window and puts the cursor
@ -369,7 +369,7 @@ in the new window.
------------------------------------------------------------------------------
*NERDTree-gs*
Default key: gs
Map setting: NERDTreeMapPreviewVSplit
Map setting: *NERDTreeMapPreviewVSplit*
Applies to: files.
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
|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*
Default key: O
Map setting: NERDTreeMapOpenRecursively
Map setting: *NERDTreeMapOpenRecursively*
Applies to: directories.
Recursively opens the selected directory.
@ -393,7 +402,7 @@ cached. This is handy, especially if you have .svn directories.
------------------------------------------------------------------------------
*NERDTree-x*
Default key: x
Map setting: NERDTreeMapCloseDir
Map setting: *NERDTreeMapCloseDir*
Applies to: files and directories.
Closes the parent of the selected node.
@ -401,7 +410,7 @@ Closes the parent of the selected node.
------------------------------------------------------------------------------
*NERDTree-X*
Default key: X
Map setting: NERDTreeMapCloseChildren
Map setting: *NERDTreeMapCloseChildren*
Applies to: directories.
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*
Default key: e
Map setting: NERDTreeMapOpenExpl
Map setting: *NERDTreeMapOpenExpl*
Applies to: files and directories.
|: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*
Default key: D
Map setting: NERDTreeMapDeleteBookmark
Map setting: *NERDTreeMapDeleteBookmark*
Applies to: lines in the bookmarks table
Deletes the currently selected bookmark.
@ -429,7 +438,7 @@ Deletes the currently selected bookmark.
------------------------------------------------------------------------------
*NERDTree-P*
Default key: P
Map setting: NERDTreeMapJumpRoot
Map setting: *NERDTreeMapJumpRoot*
Applies to: no restrictions.
Jump to the tree root.
@ -437,7 +446,7 @@ Jump to the tree root.
------------------------------------------------------------------------------
*NERDTree-p*
Default key: p
Map setting: NERDTreeMapJumpParent
Map setting: *NERDTreeMapJumpParent*
Applies to: files and directories.
Jump to the parent node of the selected node.
@ -445,7 +454,7 @@ Jump to the parent node of the selected node.
------------------------------------------------------------------------------
*NERDTree-K*
Default key: K
Map setting: NERDTreeMapJumpFirstChild
Map setting: *NERDTreeMapJumpFirstChild*
Applies to: files and directories.
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*
Default key: J
Map setting: NERDTreeMapJumpLastChild
Map setting: *NERDTreeMapJumpLastChild*
Applies to: files and directories.
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*
Default key: <C-J>
Map setting: NERDTreeMapJumpNextSibling
Map setting: *NERDTreeMapJumpNextSibling*
Applies to: files and directories.
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*
Default key: <C-K>
Map setting: NERDTreeMapJumpPrevSibling
Map setting: *NERDTreeMapJumpPrevSibling*
Applies to: files and directories.
Jump to the previous sibling of the selected node.
@ -487,7 +496,7 @@ Jump to the previous sibling of the selected node.
------------------------------------------------------------------------------
*NERDTree-C*
Default key: C
Map setting: NERDTreeMapChangeRoot
Map setting: *NERDTreeMapChangeRoot*
Applies to: files and directories.
Make the selected directory node the new tree root. If a file is selected, its
@ -496,7 +505,7 @@ parent is used.
------------------------------------------------------------------------------
*NERDTree-u*
Default key: u
Map setting: NERDTreeMapUpdir
Map setting: *NERDTreeMapUpdir*
Applies to: no restrictions.
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*
Default key: U
Map setting: NERDTreeMapUpdirKeepOpen
Map setting: *NERDTreeMapUpdirKeepOpen*
Applies to: no restrictions.
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*
Default key: r
Map setting: NERDTreeMapRefresh
Map setting: *NERDTreeMapRefresh*
Applies to: files and directories.
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*
Default key: R
Map setting: NERDTreeMapRefreshRoot
Map setting: *NERDTreeMapRefreshRoot*
Applies to: no restrictions.
Recursively refresh the tree root.
@ -531,7 +540,7 @@ Recursively refresh the tree root.
------------------------------------------------------------------------------
*NERDTree-m*
Default key: m
Map setting: NERDTreeMapMenu
Map setting: *NERDTreeMapMenu*
Applies to: files and directories.
Display the NERDTree menu. See |NERDTreeMenu| for details.
@ -539,7 +548,7 @@ Display the NERDTree menu. See |NERDTreeMenu| for details.
------------------------------------------------------------------------------
*NERDTree-cd*
Default key: cd
Map setting: NERDTreeMapChdir
Map setting: *NERDTreeMapChdir*
Applies to: files and directories.
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*
Default key: CD
Map setting: NERDTreeMapCWD
Map setting: *NERDTreeMapCWD*
Applies to: no restrictions.
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*
Default key: I
Map setting: NERDTreeMapToggleHidden
Map setting: *NERDTreeMapToggleHidden*
Applies to: no restrictions.
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*
Default key: f
Map setting: NERDTreeMapToggleFilters
Map setting: *NERDTreeMapToggleFilters*
Applies to: no restrictions.
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*
Default key: F
Map setting: NERDTreeMapToggleFiles
Map setting: *NERDTreeMapToggleFiles*
Applies to: no restrictions.
Toggles whether file nodes are displayed.
@ -579,7 +588,7 @@ Toggles whether file nodes are displayed.
------------------------------------------------------------------------------
*NERDTree-B*
Default key: B
Map setting: NERDTreeMapToggleBookmarks
Map setting: *NERDTreeMapToggleBookmarks*
Applies to: no restrictions.
Toggles whether the bookmarks table is displayed.
@ -587,7 +596,7 @@ Toggles whether the bookmarks table is displayed.
------------------------------------------------------------------------------
*NERDTree-q*
Default key: q
Map setting: NERDTreeMapQuit
Map setting: *NERDTreeMapQuit*
Applies to: no restrictions.
Closes the NERDTree window.
@ -595,7 +604,7 @@ Closes the NERDTree window.
------------------------------------------------------------------------------
*NERDTree-A*
Default key: A
Map setting: NERDTreeMapToggleZoom
Map setting: *NERDTreeMapToggleZoom*
Applies to: no restrictions.
Maximize (zoom) and minimize the NERDTree window.
@ -603,7 +612,7 @@ Maximize (zoom) and minimize the NERDTree window.
------------------------------------------------------------------------------
*NERDTree-?*
Default key: ?
Map setting: NERDTreeMapHelp
Map setting: *NERDTreeMapHelp*
Applies to: no restrictions.
Toggles whether the quickhelp is displayed.
@ -625,7 +634,7 @@ Related tags: |NERDTree-m| |NERDTreeApi|
------------------------------------------------------------------------------
*NERDTreeMenu-j*
Default key: j
Map option: NERDTreeMenuDown
Map option: *NERDTreeMenuDown*
Applies to: The NERDTree menu.
Moves the cursor down.
@ -633,7 +642,7 @@ Moves the cursor down.
------------------------------------------------------------------------------
*NERDTreeMenu-k*
Default key: k
Map option: NERDTreeMenuUp
Map option: *NERDTreeMenuUp*
Applies to: The NERDTree menu.
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
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*
@ -1031,28 +1043,31 @@ window. Use one of the follow lines for this setting: >
Values: a list of regular expressions.
Default: ['\/$', '*', '\.swp$', '\.bak$', '\~$']
This setting is a list of regular expressions which are used to specify the
order of nodes under their parent.
This setting is a list of regular expressions which are used to group or sort
the nodes under their parent.
For example, if the setting is: >
['\.vim$', '\.c$', '\.h$', '*', 'foobar']
<
then all .vim files will be placed at the top, followed by all .c files then
then all .vim files will be grouped at the top, followed by all .c files then
all .h files. All files containing the string 'foobar' will be placed at the
end. The star is a special flag: it tells the script that every node that
doesn't match any of the other regexps should be placed here.
If no star is present in NERDTreeSortOrder then one is automatically
appended to the array.
If no star is present in NERDTreeSortOrder, then one is automatically
appended to the end of the list.
The regex '\/$' should be used to match directory nodes.
A special flag can be used to sort by the modification timestamps of files and
directories. It is either '[[timestamp]]' for ascending, or '[[-timestamp]]'
for descending. If placed at the beginning of the list, files and directories
are sorted by timestamp, and then by the remaining items in the sort order
list. If this flag is in any other position of the list, timestamp sorting is
done secondarily. See examples 4, 5, and 6 below.
Files can also be sorted by 1) the modification timestamp, 2) the size, or 3)
the extension. Directories are always sorted by name. To accomplish this, the
following special flags are used:
[[timestamp]] [[-timestamp]] [[size]] [[-size]] [[extension]]
The hyphen specifies a descending sort; extensions are sorted in ascending
order only. If placed at the beginning of the list, files are sorted according
to these flags first, and then grouped by the remaining items in the list. If
the flags are in any other position of the list, this special sorting is done
secondarily. See examples 4, 5, and 6 below.
After this sorting is done, the files in each group are sorted alphabetically.
@ -1060,20 +1075,20 @@ Examples: >
(1) ['*', '\/$']
(2) []
(3) ['\/$', '\.rb$', '\.php$', '*', '\.swp$', '\.bak$', '\~$']
(4) ['[[timestamp]]']
(5) ['\/$', '*', '[[-timestamp]]']
(6) ['\.md$', '\.c$', '[[-timestamp]]', '*']
(4) ['[[-size]]']
(5) ['\/$', '*', '[[timestamp]]']
(6) ['foo','\/$','[[extension]]']
<
1. Directories will appear last, everything else will appear above.
2. Everything will simply appear in alphabetical order.
3. Dirs will appear first, then ruby and php. Swap files, bak files and vim
backup files will appear last with everything else preceding them.
4. All files and directories are sorted by timestamp, oldest first. If any
files have identical timestamps, they are sorted alphabetically.
5. Directories are first, newest to oldest, then everything else, newest to
oldest.
6. Markdown files first, followed by C source files, then everything else.
Each group is shown newest to oldest.
4. Everything is sorted by size, largest to smallest, with directories
considered to have size 0 bytes.
5. Directories will appear first alphabetically, followed by files, sorted by
timestamp, oldest first.
6. Files and directories matching 'foo' first, followed by other directories,
then all other files. Each section of files is sorted by file extension.
------------------------------------------------------------------------------
*NERDTreeStatusline*
@ -1233,6 +1248,32 @@ when specifying by hex or Unicode. >
let NERDTreeNodeDelimiter="\u00a0" "non-breaking space
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*

View File

@ -159,8 +159,8 @@ endfunction
" FUNCTION: s:Edit() {{{1
" opens the NERDTreeBookmarks file for manual editing
function! s:Bookmark.Edit()
execute "wincmd w"
execute "edit ".g:NERDTreeBookmarksFile
call nerdtree#exec("wincmd w", 1)
call nerdtree#exec("edit ".g:NERDTreeBookmarksFile, 1)
endfunction
" FUNCTION: Bookmark.getNode(nerdtree, searchFromAbsoluteRoot) {{{1

View File

@ -13,9 +13,6 @@ let g:NERDTreeCreator = s:Creator
" FUNCTION: s:Creator._bindMappings() {{{1
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()
command! -buffer -nargs=? Bookmark :call nerdtree#ui_glue#bookmarkNode('<args>')
@ -189,18 +186,20 @@ function! s:Creator._createTreeWin()
let t:NERDTreeBufName = self._nextBufferName()
silent! execute l:splitLocation . 'vertical ' . l:splitSize . ' new'
silent! execute 'edit ' . t:NERDTreeBufName
silent! execute 'vertical resize '. l:splitSize
else
silent! execute l:splitLocation . 'vertical ' . l:splitSize . ' split'
silent! execute 'buffer ' . t:NERDTreeBufName
endif
setlocal winfixwidth
call self._setCommonBufOptions()
if has('patch-7.4.1925')
clearjumps
endif
setlocal winfixwidth
endfunction
" FUNCTION: s:Creator._isBufHidden(nr) {{{1
@ -218,14 +217,14 @@ function! s:Creator.New()
return newCreator
endfunction
" FUNCTION: s:Creator._nextBufferName() {{{2
" FUNCTION: s:Creator._nextBufferName() {{{1
" returns the buffer name for the next nerd tree
function! s:Creator._nextBufferName()
let name = s:Creator.BufNamePrefix() . self._nextBufferNumber()
return name
endfunction
" FUNCTION: s:Creator._nextBufferNumber() {{{2
" FUNCTION: s:Creator._nextBufferNumber() {{{1
" the number to add to the nerd tree buffer name to make the buf name unique
function! s:Creator._nextBufferNumber()
if !exists("s:Creator._NextBufNum")

View File

@ -31,7 +31,11 @@ function! s:MenuController.showMenu()
let l:done = 0
while !l:done
redraw!
if has('nvim')
mode
else
redraw!
endif
call self._echoPrompt()
let l:key = nr2char(getchar())
@ -64,7 +68,7 @@ function! s:MenuController._echoPrompt()
echo "Menu: [" . join(shortcuts, ",") . "] (" . navHelp . " or shortcut): "
else
echo "NERDTree Menu. " . navHelp . " . or the shortcuts indicated"
echo "NERDTree Menu. " . navHelp . ", or the shortcuts indicated"
echo "========================================================="
for i in range(0, len(self.menuItems)-1)

View File

@ -44,19 +44,19 @@ function! s:NERDTree.Close()
let l:useWinId = exists('*win_getid') && exists('*win_gotoid')
if winnr() == s:NERDTree.GetWinNum()
call nerdtree#exec("wincmd p")
call nerdtree#exec("wincmd p", 1)
let l:activeBufOrWin = l:useWinId ? win_getid() : bufnr("")
call nerdtree#exec("wincmd p")
call nerdtree#exec("wincmd p", 1)
else
let l:activeBufOrWin = l:useWinId ? win_getid() : bufnr("")
endif
call nerdtree#exec(s:NERDTree.GetWinNum() . " wincmd w")
close
call nerdtree#exec(s:NERDTree.GetWinNum() . " wincmd w", 1)
call nerdtree#exec("close", 1)
if l:useWinId
call nerdtree#exec("call win_gotoid(" . l:activeBufOrWin . ")")
call nerdtree#exec("call win_gotoid(" . l:activeBufOrWin . ")", 0)
else
call nerdtree#exec(bufwinnr(l:activeBufOrWin) . " wincmd w")
call nerdtree#exec(bufwinnr(l:activeBufOrWin) . " wincmd w", 0)
endif
else
close
@ -98,7 +98,7 @@ endfunction
"Places the cursor in the nerd tree window
function! s:NERDTree.CursorToTreeWin()
call g:NERDTree.MustBeOpen()
call nerdtree#exec(g:NERDTree.GetWinNum() . "wincmd w")
call nerdtree#exec(g:NERDTree.GetWinNum() . "wincmd w", 1)
endfunction
" Function: s:NERDTree.ExistsForBuffer() {{{1
@ -153,7 +153,7 @@ endfunction
"FUNCTION: s:NERDTree.IsOpen() {{{1
function! s:NERDTree.IsOpen()
return s:NERDTree.GetWinNum() != -1
return s:NERDTree.GetWinNum() != -1 || bufname('%') =~# '^' . g:NERDTreeCreator.BufNamePrefix() . '\d\+$'
endfunction
"FUNCTION: s:NERDTree.isTabTree() {{{1

View File

@ -107,10 +107,10 @@ function! s:Opener._isWindowUsable(winnumber)
endif
let oldwinnr = winnr()
call nerdtree#exec(a:winnumber . "wincmd p")
call nerdtree#exec(a:winnumber . "wincmd p", 1)
let specialWindow = getbufvar("%", '&buftype') != '' || getwinvar('%', '&previewwindow')
let modified = &modified
call nerdtree#exec(oldwinnr . "wincmd p")
call nerdtree#exec(oldwinnr . "wincmd p", 1)
"if its a special window e.g. quickfix or another explorer plugin then we
"have to split
@ -172,7 +172,7 @@ function! s:Opener._newSplit()
let below=0
" Attempt to go to adjacent window
call nerdtree#exec(back)
call nerdtree#exec(back, 1)
let onlyOneWin = (winnr("$") ==# 1)
@ -201,9 +201,9 @@ function! s:Opener._newSplit()
"resize the tree window if no other window was open before
if onlyOneWin
let size = exists("b:NERDTreeOldWindowSize") ? b:NERDTreeOldWindowSize : g:NERDTreeWinSize
call nerdtree#exec(there)
call nerdtree#exec(there, 1)
exec("silent ". splitMode ." resize ". size)
call nerdtree#exec('wincmd p')
call nerdtree#exec('wincmd p', 0)
endif
" Restore splitmode settings
@ -219,8 +219,8 @@ function! s:Opener._newVSplit()
let l:winwidth = g:NERDTreeWinSize
endif
call nerdtree#exec('wincmd p')
vnew
call nerdtree#exec('wincmd p', 1)
call nerdtree#exec('vnew', 1)
let l:currentWindowNumber = winnr()
@ -228,7 +228,7 @@ function! s:Opener._newVSplit()
call g:NERDTree.CursorToTreeWin()
execute 'silent vertical resize ' . l:winwidth
call nerdtree#exec(l:currentWindowNumber . 'wincmd w')
call nerdtree#exec(l:currentWindowNumber . 'wincmd w', 0)
endfunction
" FUNCTION: Opener.open(target) {{{1
@ -290,9 +290,9 @@ function! s:Opener._previousWindow()
else
try
if !self._isWindowUsable(winnr("#"))
call nerdtree#exec(self._firstUsableWindow() . "wincmd w")
call nerdtree#exec(self._firstUsableWindow() . "wincmd w", 1)
else
call nerdtree#exec('wincmd p')
call nerdtree#exec('wincmd p', 1)
endif
catch /^Vim\%((\a\+)\)\=:E37/
call g:NERDTree.CursorToTreeWin()
@ -305,8 +305,8 @@ endfunction
" FUNCTION: Opener._restoreCursorPos() {{{1
function! s:Opener._restoreCursorPos()
call nerdtree#exec(self._tabnr . 'tabnext')
call nerdtree#exec(bufwinnr(self._bufnr) . 'wincmd w')
call nerdtree#exec(self._tabnr . 'tabnext', 1)
call nerdtree#exec(bufwinnr(self._bufnr) . 'wincmd w', 1)
endfunction
" FUNCTION: Opener._reuseWindow() {{{1
@ -321,7 +321,7 @@ function! s:Opener._reuseWindow()
"check the current tab for the window
let winnr = bufwinnr('^' . self._path.str() . '$')
if winnr != -1
call nerdtree#exec(winnr . "wincmd w")
call nerdtree#exec(winnr . "wincmd w", 0)
call self._checkToCloseTree(0)
return 1
endif
@ -334,9 +334,9 @@ function! s:Opener._reuseWindow()
let tabnr = self._path.tabnr()
if tabnr
call self._checkToCloseTree(1)
call nerdtree#exec(tabnr . 'tabnext')
call nerdtree#exec(tabnr . 'tabnext', 1)
let winnr = bufwinnr('^' . self._path.str() . '$')
call nerdtree#exec(winnr . "wincmd w")
call nerdtree#exec(winnr . "wincmd w", 0)
return 1
endif

View File

@ -380,7 +380,8 @@ endfunction
function! s:Path.getSortOrderIndex()
let i = 0
while i < len(g:NERDTreeSortOrder)
if self.getLastPathComponent(1) =~# g:NERDTreeSortOrder[i]
if g:NERDTreeSortOrder[i] !~? '\[\[-\?\(timestamp\|size\|extension\)\]\]' &&
\ self.getLastPathComponent(1) =~# g:NERDTreeSortOrder[i]
return i
endif
let i = i + 1
@ -407,15 +408,26 @@ endfunction
" FUNCTION: Path.getSortKey() {{{1
" returns a key used in compare function for sorting
function! s:Path.getSortKey()
let l:ascending = index(g:NERDTreeSortOrder,'[[timestamp]]')
let l:descending = index(g:NERDTreeSortOrder,'[[-timestamp]]')
if !exists("self._sortKey") || g:NERDTreeSortOrder !=# g:NERDTreeOldSortOrder || l:ascending >= 0 || l:descending >= 0
let self._sortKey = [self.getSortOrderIndex()]
if !exists("self._sortKey") || g:NERDTreeSortOrder !=# g:NERDTreeOldSortOrder
" Look for file metadata tags: [[timestamp]], [[extension]], [[size]]
let metadata = []
for tag in g:NERDTreeSortOrder
if tag =~? '\[\[-\?timestamp\]\]'
let metadata += [self.isDirectory ? 0 : getftime(self.str()) * (tag =~ '-' ? -1 : 1)]
elseif tag =~? '\[\[-\?size\]\]'
let metadata += [self.isDirectory ? 0 : getfsize(self.str()) * (tag =~ '-' ? -1 : 1)]
elseif tag =~? '\[\[extension\]\]'
let extension = matchstr(self.getLastPathComponent(0), '[^.]\+\.\zs[^.]\+$')
let metadata += [self.isDirectory ? '' : (extension == '' ? nr2char(str2nr('0x10ffff',16)) : extension)]
endif
endfor
if l:descending >= 0
call insert(self._sortKey, -getftime(self.str()), l:descending == 0 ? 0 : len(self._sortKey))
elseif l:ascending >= 0
call insert(self._sortKey, getftime(self.str()), l:ascending == 0 ? 0 : len(self._sortKey))
if g:NERDTreeSortOrder[0] =~ '\[\[.*\]\]'
" Apply tags' sorting first if specified first.
let self._sortKey = metadata + [self.getSortOrderIndex()]
else
" Otherwise, do regex grouping first.
let self._sortKey = [self.getSortOrderIndex()] + metadata
endif
let path = self.getLastPathComponent(1)

View File

@ -620,6 +620,11 @@ function! s:TreeDirNode.reveal(path, ...)
if self.path.equals(a:path.getParent())
let n = self.findNode(a:path)
" We may be looking for a newly-saved file that isn't in the tree yet.
if n == {}
call self.refresh()
let n = self.findNode(a:path)
endif
if has_key(opts, "open")
call n.open()
endif

View File

@ -6,7 +6,7 @@
let s:UI = {}
let g:NERDTreeUI = s:UI
" FUNCTION: s:UI.centerView() {{{2
" FUNCTION: s:UI.centerView() {{{1
" centers the nerd tree window around the cursor (provided the nerd tree
" options permit)
function! s:UI.centerView()
@ -28,7 +28,6 @@ function! s:UI._dumpHelp()
let help .= "\" ============================\n"
let help .= "\" File node mappings~\n"
let help .= "\" ". (g:NERDTreeMouseMode ==# 3 ? "single" : "double") ."-click,\n"
let help .= "\" <CR>,\n"
if self.nerdtree.isTabTree()
let help .= "\" ". g:NERDTreeMapActivateNode .": open in prev window\n"
else
@ -44,6 +43,7 @@ function! s:UI._dumpHelp()
let help .= "\" ". g:NERDTreeMapPreviewSplit .": preview split\n"
let help .= "\" ". g:NERDTreeMapOpenVSplit .": open vsplit\n"
let help .= "\" ". g:NERDTreeMapPreviewVSplit .": preview vsplit\n"
let help .= "\" ". g:NERDTreeMapCustomOpen .": custom open\n"
let help .= "\"\n\" ----------------------------\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:NERDTreeMapOpenInTab.": open in new tab\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:NERDTreeMapCloseChildren .": close all child nodes of\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:NERDTreeMapOpenInTab.": open in new tab\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 .= "\"\n\" ----------------------------\n"
@ -252,7 +254,7 @@ endfunction
" gets the line number of the root node
function! s:UI.getRootLineNum()
let rootLine = 1
while getline(rootLine) !~# '^\(/\|<\)'
while rootLine <= line('$') && getline(rootLine) !~# '^\(/\|<\)'
let rootLine = rootLine + 1
endwhile
return rootLine
@ -338,7 +340,7 @@ function! s:UI.restoreScreenState()
if !has_key(self, '_screenState')
return
endif
exec("silent vertical resize " . self._screenState['oldWindowSize'])
call nerdtree#exec("silent vertical resize " . self._screenState['oldWindowSize'], 1)
let old_scrolloff=&scrolloff
let &scrolloff=0
@ -358,7 +360,7 @@ function! s:UI.saveScreenState()
let self._screenState['oldPos'] = getpos(".")
let self._screenState['oldTopLine'] = line("w0")
let self._screenState['oldWindowSize']= winwidth("")
call nerdtree#exec(win . "wincmd w")
call nerdtree#exec(win . "wincmd w", 1)
endfunction
" FUNCTION: s:UI.setShowHidden(val) {{{1
@ -504,10 +506,10 @@ endfunction
function! s:UI.toggleZoom()
if exists("b:NERDTreeZoomed") && b:NERDTreeZoomed
let size = exists("b:NERDTreeOldWindowSize") ? b:NERDTreeOldWindowSize : g:NERDTreeWinSize
exec "silent vertical resize ". size
call nerdtree#exec("silent vertical resize ". size, 1)
let b:NERDTreeZoomed = 0
else
exec "vertical resize ". get(g:, 'NERDTreeWinSizeMax', '')
call nerdtree#exec("vertical resize ". get(g:, 'NERDTreeWinSizeMax', ''), 1)
let b:NERDTreeZoomed = 1
endif
endfunction

View File

@ -37,6 +37,7 @@ endif
if g:NERDTreePath.CopyingSupported()
call NERDTreeAddMenuItem({'text': '(c)opy the current node', 'shortcut': 'c', 'callback': 'NERDTreeCopyNode'})
endif
call NERDTreeAddMenuItem({'text': (has("clipboard")?'copy (p)ath to clipboard':'print (p)ath to screen'), 'shortcut': 'p', 'callback': 'NERDTreeCopyPath'})
if has("unix") || has("osx")
call NERDTreeAddMenuItem({'text': '(l)ist the current node', 'shortcut': 'l', 'callback': 'NERDTreeListNode'})
@ -113,14 +114,14 @@ function! s:promptToDelBuffer(bufnum, msg)
let l:listedBufferCount = 0
endif
if l:listedBufferCount > 1
exec "tabdo windo if winbufnr(0) == " . a:bufnum . " | exec ':bnext! ' | endif"
call nerdtree#exec("tabdo windo if winbufnr(0) == " . a:bufnum . " | exec ':bnext! ' | endif", 1)
else
exec "tabdo windo if winbufnr(0) == " . a:bufnum . " | exec ':enew! ' | endif"
call nerdtree#exec("tabdo windo if winbufnr(0) == " . a:bufnum . " | exec ':enew! ' | endif", 1)
endif
exec "tabnext " . s:originalTabNumber
exec s:originalWindowNumber . "wincmd w"
call nerdtree#exec("tabnext " . s:originalTabNumber, 1)
call nerdtree#exec(s:originalWindowNumber . "wincmd w", 1)
" 3. We don't need a previous buffer anymore
exec "bwipeout! " . a:bufnum
call nerdtree#exec("bwipeout! " . a:bufnum, 0)
endif
endfunction
@ -140,17 +141,17 @@ function! s:renameBuffer(bufNum, newNodeName, isDirectory)
let editStr = g:NERDTreePath.New(a:newNodeName).str({'format': 'Edit'})
endif
" 1. ensure that a new buffer is loaded
exec "badd " . quotedFileName
call nerdtree#exec("badd " . quotedFileName, 1)
" 2. ensure that all windows which display the just deleted filename
" display a buffer for a new filename.
let s:originalTabNumber = tabpagenr()
let s:originalWindowNumber = winnr()
exec "tabdo windo if winbufnr(0) == " . a:bufNum . " | exec ':e! " . editStr . "' | endif"
exec "tabnext " . s:originalTabNumber
exec s:originalWindowNumber . "wincmd w"
call nerdtree#exec("tabdo windo if winbufnr(0) == " . a:bufNum . " | exec ':e! " . editStr . "' | endif", 1)
call nerdtree#exec("tabnext " . s:originalTabNumber, 1)
call nerdtree#exec(s:originalWindowNumber . "wincmd w", 1)
" 3. We don't need a previous buffer anymore
try
exec "confirm bwipeout " . a:bufNum
call nerdtree#exec("confirm bwipeout " . a:bufNum, 0)
catch
" This happens when answering Cancel if confirmation is needed. Do nothing.
endtry
@ -364,6 +365,17 @@ function! NERDTreeCopyNode()
redraw!
endfunction
" FUNCTION: NERDTreeCopyPath() {{{1
function! NERDTreeCopyPath()
let l:nodePath = g:NERDTreeFileNode.GetSelected().path.str()
if has("clipboard")
let @* = l:nodePath
call nerdtree#echo("The path [" . l:nodePath . "] was copied to your clipboard.")
else
call nerdtree#echo("The full path is: " . l:nodePath)
endif
endfunction
" FUNCTION: NERDTreeQuickLook() {{{1
function! NERDTreeQuickLook()
let treenode = g:NERDTreeFileNode.GetSelected()

View File

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