<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array">
    <added>
      <filename>nerdtree_plugin/exec_menuitem.vim</filename>
    </added>
    <added>
      <filename>nerdtree_plugin/fs_menu.vim</filename>
    </added>
    <added>
      <filename>nerdtree_plugin/git_menu.vim</filename>
    </added>
  </added>
  <modified type="array">
    <modified>
      <diff>@@ -1,3 +1,3 @@
-_vim_fuf
+*~
+*.swp
 _vim-fuf
-.VimballRecord</diff>
      <filename>.gitignore</filename>
    </modified>
    <modified>
      <diff>@@ -38,7 +38,7 @@ CONTENTS                                               *NERDCommenterContents*
     5. Issues with the script.................|NERDComIssues|
         5.1 Delimiter detection heuristics....|NERDComHeuristics|
         5.2 Nesting issues....................|NERDComNesting|
-    6.The author..............................|NERDComAuthor|
+    6.About..     ............................|NERDComAbout|
     7.Changelog...............................|NERDComChangelog|
     8.Credits.................................|NERDComCredits|
     9.License.................................|NERDComLicense|
@@ -436,8 +436,6 @@ then the script would do a sexy comment on the last visual selection.
 |'NERDRPlace'|                        Specifies what to use as the right
                                       delimiter placeholder when nesting
                                       comments.
-|'NERDShutUp'|                        Stops &quot;Unknown filetype&quot; output from the
-                                      script
 |'NERDSpaceDelims'|                   Specifies whether to add extra spaces
                                       around delimiters when commenting, and
                                       whether to remove them when
@@ -660,15 +658,6 @@ This option is used to specify whether place-holder delimiters should be used
 when creating a nested comment.
 
 ------------------------------------------------------------------------------
-                                                                  *'NERDShutUp'*
-Values: 0 or 1.
-Default 1.
-
-This option is used to prevent the script from echoing &quot;Unknown filetype&quot;
-messages.  Stick this line in your vimrc: &gt;
-    let NERDShutUp=1
-&lt;
-------------------------------------------------------------------------------
                                                              *'NERDSpaceDelims'*
 Values: 0 or 1.
 Default 0.
@@ -785,7 +774,7 @@ will become: &gt;
 for simplicity)
 
 ==============================================================================
-6. The author                                                  *NERDComAuthor*
+6. About                                                        *NERDComAbout*
 
 The author of the NERD commenter is Martyzillatron --- the half robot, half
 dinosaur bastard son of Megatron and Godzilla. He enjoys destroying
@@ -795,9 +784,29 @@ Drop him a line at martin_grenfell at msn.com. He would love to hear from you.
 its a lonely life being the worlds premier terror machine. How would you feel
 if your face looked like a toaster and a t-rex put together? :(
 
+The latest stable versions can be found at
+    http://www.vim.org/scripts/script.php?script_id=1218
+
+The latest dev versions are on github
+    http://github.com/scrooloose/nerdcommenter
+
 ==============================================================================
 8. Changelog                                                *NERDComChangelog*
 
+2.2.2
+    - remove the NERDShutup option and the message is suppresses, this makes
+      the plugin silently rely on &amp;commentstring for unknown filetypes.
+    - add support for dhcpd, limits, ntp, resolv, rgb, sysctl, udevconf and
+      udevrules. Thanks to Thilo Six.
+    - match filetypes case insensitively
+    - add support for mp (metapost), thanks to Andrey Skvortsov.
+    - add support for htmlcheetah, thanks to Simon Hengel.
+    - add support for javacc, thanks to Matt Tolton.
+    - make &lt;%# %&gt; the default delims for eruby, thanks to tpope.
+    - add support for javascript.jquery, thanks to Ivan Devat.
+    - add support for cucumber and pdf. Fix sass and railslog delims,
+      thanks to tpope
+
 2.2.1
     - add support for newlisp and clojure, thanks to Matthew Lee Hinman.
     - fix automake comments, thanks to Elias Pipping
@@ -841,141 +850,54 @@ if your face looked like a toaster and a t-rex put together? :(
 ==============================================================================
 8. Credits                                                    *NERDComCredits*
 
-Thanks and respect to the following people:
-
-Thanks to Nick Brettell for his many ideas and criticisms. A bloody good
-bastard.
-:normal :.-2s/good//
-
-Thanks to Matthew Hawkins for his awesome refactoring!
-
-Thanks to the authors of the vimspell whose documentation
-installation function I stole :)
-
-Thanks to Greg Searle for the idea of using place-holders for nested comments.
-
-Thanks to Nguyen for the suggestions and pointing the h file highlighting bug!
-Also, thanks for the idea of doing sexy comments as well as his suggestions
-relating to it :P
-Thanks again to Nguyen for complaining about the NERD_comments menu mapping
-(&lt;Alt&gt;-c) interfering with another mapping of his... and thus the
-NERD_dont_create_menu_shortcut option was born :P
-(it was then replaced with NERD_menu_mode in version 1.67 :)
-
-Cheers to Litchi for the idea of having a mapping that appends a comment to
-the current line :)
-
-Thanks to jorge scandaliaris and Shufeng Zheng for telling me about some
-problems with commenting in visual mode. Thanks again to Jorge for his
-continued suggestions on this matter :)
-
-Thanks to Martin Stubenschrott for pointing out a bug with the &lt;C-c&gt; mapping
-:) Ive gotta stop breaking this mapping!
-
-Thanks to Markus Erlmann for pointing out a conflict that this script was
-having with the taglist plugin.
-
-Thanks to Brent Rice for alerting me about, and helping me track down, a bug
-in the script when the &quot;ignorecase&quot; option in vim was set.
-
-Thanks to Richard Willis for telling me about how line continuation was
-causing problems on cygwin. Also, thanks pointing out a bug in the help file
-and for suggesting // comments for c (its about time SOMEONE did :P). May ANSI
-have mercy on your soul :)
-
-Thanks to Igor Prischepoff for suggesting that i implement &quot;toggle comments&quot;.
-Also, thanks for his suggested improvements about toggle comments after i
-implemented them.
-
-Thanks to harry for telling me that i broke the &lt;leader&gt;cn mapping in 1.53 :),
-and thanks again for telling me about a bug that occurred when editing a file
-in a new tab.
-
-Thanks to Martin (Krischikim?) for his patch that fixed a bug with the doc
-install function and added support for ada comments with spaces as well as
-making a couple of other small changes.
-
-Thanks to David Bourgeois for pointing out a bug with when commenting c files
-:)... [a few days later] ok i completely  misunderstood what David was talking
-about and ended up fixing a completely different bug to what he was talking
-about :P
-
-Thanks to David Bourgeois for pointing out a bug when changing buffers.
-
-Cheers to Eike Von Seggern for sending me a patch to fix a bug in 1.60 that
-was causing spaces to be added to the end of lines with single-part
-delimiters. It's nice when people do my work for me :D
-
-Thanks to Torsten Blix for telling me about a couple of bugs when uncommenting
-sexy comments. Sexy comments dont look so sexy when they are only half removed
-:P
-
-Thanks to Alexander &quot;boesi&quot; Bosecke for pointing out a bug that was stopping
-the NERD_space_delim_filetype_regexp option from working with left aligned
-toggle comments. And for pointing out a bug when initialising VB comments.
-
-Thanks to Stefano Zacchiroli for suggesting the idea of &quot;Minimal comments&quot;.
-And for suggested improvements to minimal comments.
-
-Thanks to Norick Chen for emailing in a patch that fixed the asp delimiters.
-In 1.65
-
-Thanks to Joseph Barker for the sugesting that the menu be an optional
-feature.
-
-Thanks to Gary Church and Tim Carey-Smith for complaining about the
-keymappings and causing me to introduce the NERD_mapleader option :)
-
-Thanks to Markus Klinik for emailing me about a bug for sexy comments where
-spaces were being eaten.
-
-Thanks to Anders for emailing me a patch to help get rid of all the visual
-bells and screen scrolling.
-
-Thanks to Anders and Markus Klinik for emailing me about the screen scrolling
-issues and finally getting me off my ass about them :P
-
-Thanks to Seth Mason for sending me a patch to fix some pathing issues for the
-help doc installation.
-
-Cheers to James Hales for the patch that made the comment maps work better with
-counts, and made the script reset comment delims for a buffer when its
-filetype changes.
-
-Cheers to heptite on #vim for helping me track down some tab-space conversion
-bugs.
-
-Cheers to Cheng Fang for the bug reports :D
-
-Cheers to Yongwei Wu for a bug report about the passwd filetype.
-
-Thanks to David Miani for reporting a space-removal bug when using the
-NERDSpaceDelims option.
-
-Thanks to Jeremy Hinegardner for emailing me about a bug with aligned
-comments and the NERDSpaceDelims option.
-
-Thanks to marco for suggesting NERDDefaultNesting be set by default.
-
-Thanks to Ingo Karkat for the bug reports and the bugfix patch.
-
-Thanks to Zhang Shuhan for sending me a report about spaces not being removed
-properly in some circumstances. Also, thanks for emailing me a bunch of bug
-reports about sexy/toggle comments and for testing my fixes.
-
-Thanks to tpope for the english lesson.
-
-Thanks to Ben Schmidt, David Fishburn, and Erik Falor for emailing me about an
-incompatibility with vim7.2. Thanks also to JaGoTerr for posting the issue.
-
-Thanks to Elias Pipping for sending me a bug report about haskell commenting.
-
-Thanks to mntnoe for pointing out incorrect delimiters for haskell.
-
-Thanks to Mark S. for pointing out a bug in the doc.
-
-Not to forget! Thanks to the following people for sending me new filetypes to
-support :D
+Thanks to the follow people for suggestions and patches:
+
+Nick Brettell
+Matthew Hawkins
+Mathieu Clabaut
+Greg Searle
+Nguyen
+Litchi
+Jorge Scandaliaris
+Shufeng Zheng
+Martin Stubenschrott
+Markus Erlmann
+Brent Rice
+Richard Willis
+Igor Prischepoff
+Harry
+David Bourgeois
+Eike Von Seggern
+Torsten Blix
+Alexander Bosecke
+Stefano Zacchiroli
+Norick Chen
+Joseph Barker
+Gary Church
+Tim Carey-Smith
+Markus Klinik
+Anders
+Seth Mason
+James Hales
+Heptite
+Cheng Fang
+Yongwei Wu
+David Miani
+Jeremy Hinegardner
+Marco
+Ingo Karkat
+Zhang Shuhan
+tpope
+Ben Schmidt
+David Fishburn
+Erik Falor
+JaGoTerr
+Elias Pipping
+mntnoe
+Mark S.
+
+
+Thanks to the following people for sending me new filetypes to support:
 
 The hackers                         The filetypes~
 Sam R                               verilog
@@ -1055,7 +977,13 @@ David                               conkyrc
 Miguel Jaque Barbero                SVNannotate
 Stefan Walk                         sieve
 Adam Thorsen                        objj
-
+Thilo Six                           dhcpd, limits, ntp, resolv, rgb, sysctl,
+                                    udevconf, udevrules
+Andrey Skvortsov                    mp
+Simon Hengel                        htmlcheetah
+Matt Tolton                         javacc
+Ivan Devat                          javascript.jquery
+tpope                               cucumber,pdf
 ==============================================================================
 9. License                                                    *NERDComLicense*
 </diff>
      <filename>doc/NERD_commenter.txt</filename>
    </modified>
    <modified>
      <diff>@@ -27,11 +27,13 @@ CONTENTS                                                   *NERDTree-contents*
             2.2.2.Bookmark commands...........|NERDTreeBookmarkCommands|
             2.2.3.Invalid bookmarks...........|NERDTreeInvalidBookmarks|
         2.3.NERD tree mappings................|NERDTreeMappings|
-        2.4.The filesystem menu...............|NERDTreeFilesysMenu|
+        2.4.The NERDT tree menu...............|NERDTreeMenu|
     3.Options.................................|NERDTreeOptions|
         3.1.Option summary....................|NERDTreeOptionSummary|
         3.2.Option details....................|NERDTreeOptionDetails|
-    4.Hacking the NERD tree...................|NERDTreeHacking|
+    4.The NERD tree API.......................|NERDTreeAPI|
+        4.1.Key map API.......................|NERDTreeKeymapAPI|
+        4.2.Menu API..........................|NERDTreeMenuAPI|
     5.About...................................|NERDTreeAbout|
     6.Changelog...............................|NERDTreeChangelog|
     7.Credits.................................|NERDTreeCredits|
@@ -68,9 +70,6 @@ The following features and functionality are provided by the NERD tree:
         * custom file filters to prevent e.g. vim backup files being displayed
         * optional displaying of hidden files (. files)
         * files can be &quot;turned off&quot; so that only directories are displayed
-    * A textual filesystem menu is provided which allows you to
-      create/delete/move file and directory nodes as well as copy (for
-      supported OSs)
     * The position and size of the NERD tree window can be customised
     * The order in which the nodes in the tree are listed can be customised.
     * A model of your filesystem is created/maintained as you explore it. This
@@ -87,6 +86,12 @@ The following features and functionality are provided by the NERD tree:
     * By default the script overrides the default file browser (netw), so if
       you :edit a directory a (slighly modified) NERD tree will appear in the
       current window
+    * A programmable menu system is provided (simulates right clicking on a
+      node)
+        * one default menu plugin is provided to perform basic filesytem
+          operations (create/delete/move/copy files/directories)
+    * There's an API for adding your own keymappings
+
 
 ==============================================================================
 2. Functionality provided                              *NERDTreeFunctionality*
@@ -205,12 +210,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|
-!.......Execute the current file.................................|NERDTree-!|
 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 dif.....................................|NERDTree-e|
 
+&lt;CR&gt;...............same as |NERDTree-o|.
 double-click.......same as the |NERDTree-o| map.
 middle-click.......same as |NERDTree-i| for files, same as
                    |NERDTree-e| for dirs.
@@ -221,15 +226,15 @@ P.......Jump to the root node....................................|NERDTree-P|
 p.......Jump to current nodes parent.............................|NERDTree-p|
 K.......Jump up inside directories at the current tree depth.....|NERDTree-K|
 J.......Jump down inside directories at the current tree depth...|NERDTree-J|
-&lt;C-j&gt;...Jump down to the next sibling of the current directory...|NERDTree-c-j|
-&lt;C-k&gt;...Jump up to the previous sibling of the current directory.|NERDTree-c-k|
+&lt;C-J&gt;...Jump down to the next sibling of the current directory...|NERDTree-C-J|
+&lt;C-K&gt;...Jump up to the previous sibling of the current directory.|NERDTree-C-K|
 
 C.......Change the tree root to the selected dir.................|NERDTree-C|
 u.......Move the tree root up one directory......................|NERDTree-u|
 U.......Same as 'u' except the old root node is left open........|NERDTree-U|
 r.......Recursively refresh the current directory................|NERDTree-r|
 R.......Recursively refresh the current root.....................|NERDTree-R|
-m.......Display the filesystem menu..............................|NERDTree-m|
+m.......Display the NERD tree menu...............................|NERDTree-m|
 cd......Change the CWD to the dir of the selected node...........|NERDTree-cd|
 
 I.......Toggle whether hidden files displayed....................|NERDTree-I|
@@ -238,6 +243,7 @@ F.......Toggle whether files are displayed.......................|NERDTree-F|
 B.......Toggle whether the bookmark table is displayed...........|NERDTree-B|
 
 q.......Close the NERDTree window................................|NERDTree-q|
+A.......Zoom (maximize/minimize) the NERDTree window.............|NERDTree-A|
 ?.......Toggle the display of the quick help.....................|NERDTree-?|
 
 ------------------------------------------------------------------------------
@@ -331,14 +337,6 @@ The key combo for this mapping is always &quot;g&quot; + NERDTreeMapOpenVSplit (see
 |NERDTree-s|).
 
 ------------------------------------------------------------------------------
-                                                                  *NERDTree-!*
-Default key: !
-Map option: NERDTreeMapExecute
-Applies to: files.
-
-Executes the selected file, prompting for arguments first.
-
-------------------------------------------------------------------------------
                                                                   *NERDTree-O*
 Default key: O
 Map option: NERDTreeMapOpenRecursively
@@ -430,16 +428,16 @@ If the cursor is already on the last node then do the following:
     * go to the last child of that node
 
 ------------------------------------------------------------------------------
-                                                                *NERDTree-c-j*
-Default key: &lt;C-j&gt;
+                                                                *NERDTree-C-J*
+Default key: &lt;C-J&gt;
 Map option: NERDTreeMapJumpNextSibling
 Applies to: files and directories.
 
 Jump to the next sibling of the selected node.
 
 ------------------------------------------------------------------------------
-                                                                *NERDTree-c-k*
-Default key: &lt;C-k&gt;
+                                                                *NERDTree-C-K*
+Default key: &lt;C-K&gt;
 Map option: NERDTreeMapJumpPrevSibling
 Applies to: files and directories.
 
@@ -492,10 +490,18 @@ Recursively refresh the tree root.
 ------------------------------------------------------------------------------
                                                                   *NERDTree-m*
 Default key: m
-Map option: NERDTreeMapFilesystemMenu
+Map option: NERDTreeMapMenu
 Applies to: files and directories.
 
-Display the filesystem menu. See |NERDTreeFilesysMenu| for details.
+Display the NERD tree menu. See |NERDTreeMenu| for details.
+
+------------------------------------------------------------------------------
+                                                                 *NERDTree-cd*
+Default key: cd
+Map option: NERDTreeMapChdir
+Applies to: files and directories.
+
+Change vims current working directory to that of the selected node.
 
 ------------------------------------------------------------------------------
                                                                   *NERDTree-I*
@@ -538,6 +544,14 @@ Applies to: no restrictions.
 Closes the NERDtree window.
 
 ------------------------------------------------------------------------------
+                                                                  *NERDTree-A*
+Default key: A
+Map option: NERDTreeMapToggleZoom
+Applies to: no restrictions.
+
+Maximize (zoom) and minimize the NERDtree window.
+
+------------------------------------------------------------------------------
                                                                   *NERDTree-?*
 Default key: ?
 Map option: NERDTreeMapHelp
@@ -546,44 +560,18 @@ Applies to: no restrictions.
 Toggles whether the quickhelp is displayed.
 
 ------------------------------------------------------------------------------
-2.3. The filesystem menu                                 *NERDTreeFilesysMenu*
+2.3. The NERD tree menu                                         *NERDTreeMenu*
 
-The purpose of the filesystem menu is to allow you to perform basic filesystem
-operations quickly from the NERD tree rather than the console.
+The NERD tree has a menu that can be programmed via the an API (see
+|NERDTreeMenuAPI|). The idea is to simulate the &quot;right click&quot; menus that most
+file explorers have.
 
-The filesystem menu can be accessed with 'm' mapping and has four supported
-operations: &gt;
-    1. Adding nodes.
-    2. Move nodes.
-    3. Deleting nodes.
-    3. Copying nodes.
-&lt;
-1. Adding nodes:
-To add a node move the cursor onto (or anywhere inside) the directory you wish
-to create the new node inside. Select the 'add node' option from the
-filesystem menu and type a filename. If the filename you type ends with a '/'
-character then a directory will be created. Once the operation is completed,
-the cursor is placed on the new node.
-
-2. Move nodes:
-To move/rename a node, put the cursor on it and select the 'move' option from
-the filesystem menu.  Enter the new location for the node and it will be
-moved.  If the old file is open in a buffer, you will be asked if you wish to
-delete that buffer. Once the operation is complete the cursor will be placed
-on the renamed node.
-
-3. Deleting nodes:
-To delete a node put the cursor on it and select the 'delete' option from the
-filesystem menu. After confirmation the node will be deleted. If a file is
-deleted but still exists as a buffer you will be given the option to delete
-that buffer.
-
-4. Copying nodes:
-To copy a node put the cursor on it and select the 'copy' option from the
-filesystem menu. Enter the new location and you're done. Note: copying is
-currently only supported for *nix operating systems. If someone knows a
-one line copying command for windows that doesnt require user confirmation
-then id be grateful if you'd email me.
+The script comes with two default menu plugins: exec_menuitem.vim and
+fs_menu.vim. fs_menu.vim adds some basic filesystem operations to the menu for
+creating/deleting/moving/copying files and dirs. exec_menuitem.vim provides a
+menu item to execute executable files.
+
+Related tags: |NERDTree-m| |NERDTreeApi|
 
 ==============================================================================
 3. Customisation                                             *NERDTreeOptions*
@@ -679,7 +667,7 @@ If set to 1, the NERD tree window will center around the cursor if it moves to
 within |'NERDTreeAutoCenterThreshold'| lines of the top/bottom of the window.
 
 This is ONLY done in response to tree navigation mappings,
-i.e. |NERDTree-J| |NERDTree-K| |NERDTree-C-J| |NERDTree-c-K| |NERDTree-p|
+i.e. |NERDTree-J| |NERDTree-K| |NERDTree-C-J| |NERDTree-C-K| |NERDTree-p|
 |NERDTree-P|
 
 The centering is done with a |zz| operation.
@@ -742,7 +730,7 @@ Values: 0 or 1.
 Default: 1.
 
 If set to 1, the current cursor line in the NERD tree buffer will be
-highlighted. This is done using the |cursorline| option.
+highlighted. This is done using the |'cursorline'| option.
 
 ------------------------------------------------------------------------------
                                                        *'NERDTreeHijackNetrw'*
@@ -929,43 +917,142 @@ Default: 31.
 This option is used to change the size of the NERD tree when it is loaded.
 
 ==============================================================================
-4. Hacking the NERD tree                                     *NERDTreeHacking*
-
-Public functions ~
-
-The script provides 2 public functions for your hacking pleasure. Their
-signatures are: &gt;
-    function! NERDTreeGetCurrentNode()
-    function! NERDTreeGetCurrentPath()
+4. The NERD tree API                                             *NERDTreeAPI*
+
+The NERD tree script allows you to add custom key mappings and menu items via
+a set of API calls. Any scripts that use this API should be placed in
+~/.vim/nerdtree_plugin/ (*nix) or ~/vimfiles/nerdtree_plugin (windows).
+
+The script exposes some prototype objects that can be used to manipulate the
+tree and/or get information from it: &gt;
+    g:NERDTreePath
+    g:NERDTreeDirNode
+    g:NERDTreeFileNode
+    g:NERDTreeBookmark
 &lt;
-The first returns the node object that the cursor is currently on, while the
-second returns the corresponding path object.
-
-This is probably a good time to mention that the script implements prototype
-style OO. To see the functions that each class provides you can read look at
-the code.
+See the code/comments in NERD_tree.vim to find how to use these objects. The
+following code conventions are used:
+    * class members start with a capital letter
+    * instance members start with a lower case letter
+    * private members start with an underscore
 
-Use the node objects to manipulate the structure of the tree. Use the path
-objects to access the files/directories the tree nodes represent.
+See this blog post for more details:
+ http://got-ravings.blogspot.com/2008/09/vim-pr0n-prototype-based-objects.html
 
-The NERD tree filetype ~
-
-NERD tree buffers have a filetype of &quot;nerdtree&quot;. You can use this to hack the
-NERD tree via autocommands (on |FileType|) or via an ftplugin.
-
-For example, putting this code in ~/.vim/ftplugin/nerdtree.vim would override
-the o mapping, making it open the selected node in a new gvim instance. &gt;
+------------------------------------------------------------------------------
+4.1. Key map API                                           *NERDTreeKeymapAPI*
+
+NERDTreeAddKeyMap({options})                             *NERDTreeAddKeyMap()*
+    Adds a new keymapping for all NERD tree buffers.
+    {options} must be a dictionary, and must contain the following keys:
+    &quot;key&quot; - the trigger key for the new mapping
+    &quot;callback&quot; - the function the new mapping will be bound to
+    &quot;quickhelpText&quot; - the text that will appear in the quickhelp (see
+    |NERDTree-?|)
+
+    Example: &gt;
+        call NERDTreeAddKeyMap({
+               \ 'key': 'b',
+               \ 'callback': 'NERDTreeEchoCurrentNode',
+               \ 'quickhelpText': 'echo full path of current node' })
+
+        function! NERDTreeEchoCurrentNode()
+            let n = g:NERDTreeFileNode.GetSelected()
+            if n != {}
+                echomsg 'Current node: ' . n.path.str()
+            endif
+        endfunction
+&lt;
+    This code should sit in a file like ~/.vim/nerdtree_plugin/mymapping.vim.
+    It adds a (rather useless) mapping on 'b' which echos the full path to the
+    current node.
 
-    nnoremap &lt;silent&gt; &lt;buffer&gt; o :call &lt;sid&gt;openInNewVimInstance()&lt;cr&gt;
-    function! s:openInNewVimInstance()
-        let p = NERDTreeGetCurrentPath()
-        if p != {}
-            silent exec &quot;!gvim &quot; . p.strForOS(1) . &quot;&amp;&quot;
-        endif
-    endfunction
+------------------------------------------------------------------------------
+4.2. Menu API                                                *NERDTreeMenuAPI*
+
+NERDTreeAddSubmenu({options})                           *NERDTreeAddSubmenu()*
+    Creates and returns a new submenu.
+
+    {options} must be a dictionary and must contain the following keys:
+    &quot;text&quot; - the text of the submenu that the user will see
+    &quot;shortcut&quot; - a shortcut key for the submenu (need not be unique)
+
+    The following keys are optional:
+    &quot;isActiveCallback&quot; - a function that will be called to determine whether
+    this submenu item will be displayed or not. The callback function must return
+    0 or 1.
+    &quot;parent&quot; - the parent submenu of the new submenu (returned from a previous
+    invocation of NERDTreeAddSubmenu()). If this key is left out then the new
+    submenu will sit under the top level menu.
+
+    See below for an example.
+
+NERDTreeAddMenuItem({options})                         *NERDTreeAddMenuItem()*
+    Adds a new menu item to the NERD tree menu (see |NERDTreeMenu|).
+
+    {options} must be a dictionary and must contain the
+    following keys:
+    &quot;text&quot; - the text of the menu item which the user will see
+    &quot;shortcut&quot; - a shortcut key for the menu item (need not be unique)
+    &quot;callback&quot; - the function that will be called when the user activates the
+    menu item.
+
+    The following keys are optional:
+    &quot;isActiveCallback&quot; - a function that will be called to determine whether
+    this menu item will be displayed or not. The callback function must return
+    0 or 1.
+    &quot;parent&quot; - if the menu item belongs under a submenu then this key must be
+    specified. This value for this key will be the object that
+    was returned when the submenu was created with |NERDTreeAddSubmenu()|.
+
+    See below for an example.
+
+NERDTreeAddMenuSeparator([{options}])             *NERDTreeAddMenuSeparator()*
+    Adds a menu separator (a row of dashes).
+
+    {options} is an optional dictionary that may contain the following keys:
+    &quot;isActiveCallback&quot; - see description in |NERDTreeAddMenuItem()|.
+
+Below is an example of the menu API in action. &gt;
+    call NERDTreeAddMenuSeparator()
+
+    call NERDTreeAddMenuItem({
+                \ 'text': 'a (t)op level menu item',
+                \ 'shortcut': 't',
+                \ 'callback': 'SomeFunction' })
+
+    let submenu = NERDTreeAddSubmenu({
+                \ 'text': 'a (s)ub menu',
+                \ 'shortcut': 's' })
+
+    call NERDTreeAddMenuItem({
+                \ 'text': '(n)ested item 1',
+                \ 'shortcut': 'n',
+                \ 'callback': 'SomeFunction',
+                \ 'parent': submenu })
+
+    call NERDTreeAddMenuItem({
+                \ 'text': '(n)ested item 2',
+                \ 'shortcut': 'n',
+                \ 'callback': 'SomeFunction',
+                \ 'parent': submenu })
 &lt;
-This way you can add new mappings or :commands or override any existing
-mapping.
+This will create the following menu: &gt;
+  --------------------
+  a (t)op level menu item
+  a (s)ub menu
+&lt;
+Where selecting &quot;a (s)ub menu&quot; will lead to a second menu: &gt;
+  (n)ested item 1
+  (n)ested item 2
+&lt;
+When any of the 3 concrete menu items are selected the function &quot;SomeFunction&quot;
+will be called.
+
+------------------------------------------------------------------------------
+NERDTreeRender()                                            *NERDTreeRender()*
+    Re-renders the NERD tree buffer. Useful if you change the state of the
+    tree and you want to it to be reflected in the UI.
 
 ==============================================================================
 5. About                                                       *NERDTreeAbout*
@@ -988,6 +1075,30 @@ The latest dev versions are on github
 ==============================================================================
 6. Changelog                                               *NERDTreeChangelog*
 
+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.
+
+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 &lt;CR&gt; 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
@@ -1069,6 +1180,8 @@ just downloaded pr0n instead.
     Frederic Chanal (nach)
     Alf Mikula
     Lucas S. Buchala
+    Curtis Harvey
+    Guillaume Duranceau
 
 ==============================================================================
 8. License                                                   *NERDTreeLicense*</diff>
      <filename>doc/NERD_tree.txt</filename>
    </modified>
    <modified>
      <diff>@@ -2,8 +2,8 @@
 &quot; File:        NERD_commenter.vim
 &quot; Description: vim global plugin that provides easy code commenting
 &quot; Maintainer:  Martin Grenfell &lt;martin_grenfell at msn dot com&gt;
-&quot; Version:     2.2.1
-&quot; Last Change: 13th November, 2008
+&quot; Version:     2.2.2
+&quot; Last Change: 30th March, 2008
 &quot; License:     This program is free software. It comes without any warranty,
 &quot;              to the extent permitted by applicable law. You can redistribute
 &quot;              it and/or modify it under the terms of the Do What The Fuck You
@@ -22,13 +22,6 @@ if v:version &lt; 700
 endif
 let loaded_nerd_comments = 1
 
-&quot; Section: spaces init {{{2
-&quot; Occasionally we need to grab a string of spaces so just make one here
-let s:spaces = &quot;&quot;
-while strlen(s:spaces) &lt; 100
-    let s:spaces = s:spaces . &quot;    &quot;
-endwhile
-
 &quot; Function: s:InitVariable() function {{{2
 &quot; This function is used to initialise a given variable to a given value. The
 &quot; variable is only initialised if it does not exist prior
@@ -67,7 +60,6 @@ call s:InitVariable(&quot;g:NERDUsePlaceHolders&quot;, 1)
 call s:InitVariable(&quot;g:NERDRemoveAltComs&quot;, 1)
 call s:InitVariable(&quot;g:NERDRemoveExtraSpaces&quot;, 1)
 call s:InitVariable(&quot;g:NERDRPlace&quot;, &quot;&lt;]&quot;)
-call s:InitVariable(&quot;g:NERDShutUp&quot;, '0')
 call s:InitVariable(&quot;g:NERDSpaceDelims&quot;, 0)
 call s:InitVariable(&quot;g:NERDDelimiterRequests&quot;, 1)
 
@@ -107,841 +99,632 @@ augroup END
 function s:SetUpForNewFiletype(filetype, forceReset)
     &quot;if we have already set the delimiters for this buffer then dont go thru
     &quot;it again
-    if !a:forceReset &amp;&amp; exists(&quot;b:left&quot;) &amp;&amp; b:left != ''
+    if !a:forceReset &amp;&amp; exists(&quot;b:NERDLeft&quot;) &amp;&amp; b:NERDLeft != ''
         return
     endif
 
-    let b:sexyComMarker = ''
+    let b:NERDSexyComMarker = ''
 
     &quot;check the filetype against all known filetypes to see if we have
     &quot;hardcoded the comment delimiters to use
-    if a:filetype == &quot;&quot;
+    if a:filetype ==? &quot;&quot;
         call s:MapDelimiters('', '')
-    elseif a:filetype == &quot;aap&quot;
+    elseif a:filetype ==? &quot;aap&quot;
         call s:MapDelimiters('#', '')
-    elseif a:filetype == &quot;abaqus&quot;
-        call s:MapDelimiters('**', '')
-    elseif a:filetype == &quot;abc&quot;
+    elseif a:filetype ==? &quot;abc&quot;
         call s:MapDelimiters('%', '')
-    elseif a:filetype == &quot;acedb&quot;
+    elseif a:filetype ==? &quot;acedb&quot;
         call s:MapDelimitersWithAlternative('//','', '/*','*/')
-    elseif a:filetype == &quot;actionscript&quot;
+    elseif a:filetype ==? &quot;actionscript&quot;
         call s:MapDelimitersWithAlternative('//','', '/*','*/')
-    elseif a:filetype == &quot;ada&quot;
+    elseif a:filetype ==? &quot;ada&quot;
         call s:MapDelimitersWithAlternative('--','', '--  ', '')
-    elseif a:filetype == &quot;ahdl&quot;
+    elseif a:filetype ==? &quot;ahdl&quot;
         call s:MapDelimiters('--', '')
-    elseif a:filetype == &quot;ahk&quot;
+    elseif a:filetype ==? &quot;ahk&quot;
         call s:MapDelimitersWithAlternative(';', '', '/*', '*/')
-    elseif a:filetype == &quot;amiga&quot;
+    elseif a:filetype ==? &quot;amiga&quot;
         call s:MapDelimiters(';', '')
-    elseif a:filetype == &quot;aml&quot;
+    elseif a:filetype ==? &quot;aml&quot;
         call s:MapDelimiters('/*', '')
-    elseif a:filetype == &quot;ampl&quot;
+    elseif a:filetype ==? &quot;ampl&quot;
         call s:MapDelimiters('#', '')
-    elseif a:filetype == &quot;ant&quot;
-        call s:MapDelimiters('&lt;!--','--&gt;')
-    elseif a:filetype == &quot;apache&quot;
+    elseif a:filetype ==? &quot;apache&quot;
         call s:MapDelimiters('#', '')
-    elseif a:filetype == &quot;apachestyle&quot;
+    elseif a:filetype ==? &quot;apachestyle&quot;
         call s:MapDelimiters('#', '')
-    elseif a:filetype == &quot;asciidoc&quot;
+    elseif a:filetype ==? &quot;asciidoc&quot;
         call s:MapDelimiters('//', '')
-    elseif a:filetype == &quot;applescript&quot;
+    elseif a:filetype ==? &quot;applescript&quot;
         call s:MapDelimitersWithAlternative('--', '', '(*', '*)')
-    elseif a:filetype == &quot;asm68k&quot;
+    elseif a:filetype ==? &quot;asm68k&quot;
         call s:MapDelimiters(';', '')
-    elseif a:filetype == &quot;asm&quot;
+    elseif a:filetype ==? &quot;asm&quot;
         call s:MapDelimitersWithAlternative(';', '', '#', '')
-    elseif a:filetype == &quot;asn&quot;
+    elseif a:filetype ==? &quot;asn&quot;
         call s:MapDelimiters('--', '')
-    elseif a:filetype == &quot;aspvbs&quot;
+    elseif a:filetype ==? &quot;aspvbs&quot;
         call s:MapDelimiters('''', '')
-    elseif a:filetype == &quot;asterisk&quot;
+    elseif a:filetype ==? &quot;asterisk&quot;
         call s:MapDelimiters(';', '')
-    elseif a:filetype == &quot;asy&quot;
+    elseif a:filetype ==? &quot;asy&quot;
         call s:MapDelimiters('//', '')
-    elseif a:filetype == &quot;atlas&quot;
+    elseif a:filetype ==? &quot;atlas&quot;
         call s:MapDelimiters('C','$')
-    elseif a:filetype == &quot;autohotkey&quot;
+    elseif a:filetype ==? &quot;autohotkey&quot;
         call s:MapDelimiters(';','')
-    elseif a:filetype == &quot;autoit&quot;
+    elseif a:filetype ==? &quot;autoit&quot;
         call s:MapDelimiters(';','')
-    elseif a:filetype == &quot;automake&quot;
-        call s:MapDelimiters('##','')
-    elseif a:filetype == &quot;ave&quot;
+    elseif a:filetype ==? &quot;ave&quot;
         call s:MapDelimiters(&quot;'&quot;,'')
-    elseif a:filetype == &quot;awk&quot;
+    elseif a:filetype ==? &quot;awk&quot;
         call s:MapDelimiters('#','')
-    elseif a:filetype == &quot;basic&quot;
+    elseif a:filetype ==? &quot;basic&quot;
         call s:MapDelimitersWithAlternative(&quot;'&quot;,'', 'REM ', '')
-    elseif a:filetype == &quot;b&quot;
-        call s:MapDelimiters('/*','*/')
-    elseif a:filetype == &quot;bbx&quot;
+    elseif a:filetype ==? &quot;bbx&quot;
         call s:MapDelimiters('%', '')
-    elseif a:filetype == &quot;bc&quot;
+    elseif a:filetype ==? &quot;bc&quot;
         call s:MapDelimiters('#', '')
-    elseif a:filetype == &quot;bdf&quot;
-        call s:MapDelimiters('COMMENT ', '')
-    elseif a:filetype == &quot;bib&quot;
+    elseif a:filetype ==? &quot;bib&quot;
         call s:MapDelimiters('%','')
-    elseif a:filetype == &quot;bindzone&quot;
+    elseif a:filetype ==? &quot;bindzone&quot;
         call s:MapDelimiters(';', '')
-    elseif a:filetype == &quot;bst&quot;
+    elseif a:filetype ==? &quot;bst&quot;
         call s:MapDelimiters('%', '')
-    elseif a:filetype == &quot;btm&quot;
+    elseif a:filetype ==? &quot;btm&quot;
         call s:MapDelimiters('::', '')
-    elseif a:filetype == &quot;bzr&quot;
-        call s:MapDelimiters('', '')
-    elseif a:filetype == &quot;caos&quot;
+    elseif a:filetype ==? &quot;caos&quot;
         call s:MapDelimiters('*', '')
-    elseif a:filetype == &quot;calibre&quot;
+    elseif a:filetype ==? &quot;calibre&quot;
         call s:MapDelimiters('//','')
-    elseif a:filetype == &quot;catalog&quot;
+    elseif a:filetype ==? &quot;catalog&quot;
         call s:MapDelimiters('--','--')
-    elseif a:filetype == &quot;c&quot;
+    elseif a:filetype ==? &quot;c&quot;
         call s:MapDelimitersWithAlternative('/*','*/', '//', '')
-    elseif a:filetype == &quot;cfg&quot;
+    elseif a:filetype ==? &quot;cfg&quot;
         call s:MapDelimiters('#', '')
-    elseif a:filetype == &quot;cg&quot;
+    elseif a:filetype ==? &quot;cg&quot;
         call s:MapDelimitersWithAlternative('//','', '/*','*/')
-    elseif a:filetype == &quot;ch&quot;
+    elseif a:filetype ==? &quot;ch&quot;
         call s:MapDelimitersWithAlternative('//','', '/*','*/')
-    elseif a:filetype == &quot;changelog&quot;
-        call s:MapDelimiters('','')
-    elseif a:filetype == &quot;cl&quot;
+    elseif a:filetype ==? &quot;cl&quot;
         call s:MapDelimiters('#', '')
-    elseif a:filetype == &quot;clean&quot;
+    elseif a:filetype ==? &quot;clean&quot;
         call s:MapDelimitersWithAlternative('//','', '/*','*/')
-    elseif a:filetype == &quot;clipper&quot;
+    elseif a:filetype ==? &quot;clipper&quot;
         call s:MapDelimitersWithAlternative('//','', '/*','*/')
-    elseif a:filetype == &quot;clojure&quot;
+    elseif a:filetype ==? &quot;clojure&quot;
         call s:MapDelimiters(';', '')
-    elseif a:filetype == &quot;cmake&quot;
+    elseif a:filetype ==? &quot;cmake&quot;
         call s:MapDelimiters('#','')
-    elseif a:filetype == &quot;cobol&quot;
-        call s:MapDelimiters('', '')
-    elseif a:filetype == &quot;conf&quot;
+    elseif a:filetype ==? &quot;conkyrc&quot;
         call s:MapDelimiters('#', '')
-    elseif a:filetype == &quot;config&quot;
-        call s:MapDelimiters('dnl ', '')
-    elseif a:filetype == &quot;conkyrc&quot;
-        call s:MapDelimiters('#', '')
-    elseif a:filetype == &quot;context&quot;
-        call s:MapDelimiters('%','')
-    elseif a:filetype == &quot;cpp&quot;
+    elseif a:filetype ==? &quot;cpp&quot;
         call s:MapDelimitersWithAlternative('//','', '/*','*/')
-    elseif a:filetype == &quot;crontab&quot;
+    elseif a:filetype ==? &quot;crontab&quot;
         call s:MapDelimiters('#', '')
-    elseif a:filetype == &quot;cs&quot;
+    elseif a:filetype ==? &quot;cs&quot;
         call s:MapDelimitersWithAlternative('//','', '/*','*/')
-    elseif a:filetype == &quot;csc&quot;
-        call s:MapDelimiters('/*','*/')
-    elseif a:filetype == &quot;csp&quot;
+    elseif a:filetype ==? &quot;csp&quot;
         call s:MapDelimiters('--', '')
-    elseif a:filetype == &quot;css&quot;
-        call s:MapDelimiters('/*','*/')
-    elseif a:filetype == &quot;cterm&quot;
+    elseif a:filetype ==? &quot;cterm&quot;
         call s:MapDelimiters('*', '')
-    elseif a:filetype == &quot;cupl&quot;
-        call s:MapDelimiters('/*','*/')
-    elseif a:filetype == &quot;csv&quot;
-        call s:MapDelimiters('','')
-    elseif a:filetype == &quot;cvs&quot;
+    elseif a:filetype ==? &quot;cucumber&quot;
+        call s:MapDelimiters('#','')
+    elseif a:filetype ==? &quot;cvs&quot;
         call s:MapDelimiters('CVS:','')
-    elseif a:filetype == &quot;CVSAnnotate&quot;
-        call s:MapDelimiters('','')
-    elseif a:filetype == &quot;CVScommit&quot;
-        call s:MapDelimiters('','')
-    elseif a:filetype == &quot;d&quot;
+    elseif a:filetype ==? &quot;d&quot;
         call s:MapDelimitersWithAlternative('//','', '/*','*/')
-    elseif a:filetype == &quot;dcl&quot;
+    elseif a:filetype ==? &quot;dcl&quot;
         call s:MapDelimiters('$!', '')
-    elseif a:filetype == &quot;dakota&quot;
+    elseif a:filetype ==? &quot;dakota&quot;
         call s:MapDelimiters('#', '')
-    elseif a:filetype == &quot;debchangelog&quot;
-        call s:MapDelimiters('', '')
-    elseif a:filetype == &quot;debcontrol&quot;
+    elseif a:filetype ==? &quot;debcontrol&quot;
         call s:MapDelimiters('#', '')
-    elseif a:filetype == &quot;debsources&quot;
+    elseif a:filetype ==? &quot;debsources&quot;
         call s:MapDelimiters('#', '')
-    elseif a:filetype == &quot;def&quot;
+    elseif a:filetype ==? &quot;def&quot;
         call s:MapDelimiters(';', '')
-    elseif a:filetype == &quot;desktop&quot;
+    elseif a:filetype ==? &quot;desktop&quot;
+        call s:MapDelimiters('#', '')
+    elseif a:filetype ==? &quot;dhcpd&quot;
         call s:MapDelimiters('#', '')
-    elseif a:filetype == &quot;diff&quot;
+    elseif a:filetype ==? &quot;diff&quot;
         call s:MapDelimiters('#', '')
-    elseif a:filetype == &quot;django&quot;
+    elseif a:filetype ==? &quot;django&quot;
         call s:MapDelimitersWithAlternative('&lt;!--','--&gt;', '{#', '#}')
-    elseif a:filetype == &quot;docbk&quot;
+    elseif a:filetype ==? &quot;docbk&quot;
         call s:MapDelimiters('&lt;!--', '--&gt;')
-    elseif a:filetype == &quot;dns&quot;
+    elseif a:filetype ==? &quot;dns&quot;
         call s:MapDelimiters(';', '')
-    elseif a:filetype == &quot;dosbatch&quot;
+    elseif a:filetype ==? &quot;dosbatch&quot;
         call s:MapDelimitersWithAlternative('REM ','', '::', '')
-    elseif a:filetype == &quot;dosini&quot;
+    elseif a:filetype ==? &quot;dosini&quot;
         call s:MapDelimiters(';', '')
-    elseif a:filetype == &quot;dot&quot;
+    elseif a:filetype ==? &quot;dot&quot;
         call s:MapDelimitersWithAlternative('//','', '/*','*/')
-    elseif a:filetype == &quot;dracula&quot;
+    elseif a:filetype ==? &quot;dracula&quot;
         call s:MapDelimiters(';', '')
-    elseif a:filetype == &quot;dsl&quot;
+    elseif a:filetype ==? &quot;dsl&quot;
         call s:MapDelimiters(';', '')
-    elseif a:filetype == &quot;dtd&quot;
-        call s:MapDelimiters('&lt;!--','--&gt;')
-    elseif a:filetype == &quot;dtml&quot;
+    elseif a:filetype ==? &quot;dtml&quot;
         call s:MapDelimiters('&lt;dtml-comment&gt;','&lt;/dtml-comment&gt;')
-    elseif a:filetype == &quot;dtrace&quot;
-        call s:MapDelimiters('/*','*/')
-    elseif a:filetype == &quot;dylan&quot;
+    elseif a:filetype ==? &quot;dylan&quot;
         call s:MapDelimitersWithAlternative('//','', '/*','*/')
-    elseif a:filetype == 'ebuild'
+    elseif a:filetype ==? 'ebuild'
         call s:MapDelimiters('#', '')
-    elseif a:filetype == &quot;ecd&quot;
+    elseif a:filetype ==? &quot;ecd&quot;
         call s:MapDelimiters('#', '')
-    elseif a:filetype == 'eclass'
+    elseif a:filetype ==? 'eclass'
         call s:MapDelimiters('#', '')
-    elseif a:filetype == &quot;eiffel&quot;
+    elseif a:filetype ==? &quot;eiffel&quot;
         call s:MapDelimiters('--', '')
-    elseif a:filetype == &quot;elf&quot;
+    elseif a:filetype ==? &quot;elf&quot;
         call s:MapDelimiters(&quot;'&quot;, '')
-    elseif a:filetype == &quot;elmfilt&quot;
+    elseif a:filetype ==? &quot;elmfilt&quot;
         call s:MapDelimiters('#', '')
-    elseif a:filetype == &quot;erlang&quot;
+    elseif a:filetype ==? &quot;erlang&quot;
         call s:MapDelimiters('%', '')
-    elseif a:filetype == &quot;eruby&quot;
-        call s:MapDelimitersWithAlternative('&lt;!--', '--&gt;', '&lt;%#', '%&gt;')
-    elseif a:filetype == &quot;eterm&quot;
-        call s:MapDelimiters('#', '')
-    elseif a:filetype == &quot;expect&quot;
+    elseif a:filetype ==? &quot;eruby&quot;
+        call s:MapDelimitersWithAlternative('&lt;%#', '%&gt;', '&lt;!--', '--&gt;')
+    elseif a:filetype ==? &quot;expect&quot;
         call s:MapDelimiters('#', '')
-    elseif a:filetype == &quot;exports&quot;
+    elseif a:filetype ==? &quot;exports&quot;
         call s:MapDelimiters('#', '')
-    elseif a:filetype == &quot;factor&quot;
+    elseif a:filetype ==? &quot;factor&quot;
         call s:MapDelimitersWithAlternative('! ', '', '!# ', '')
-    elseif a:filetype == &quot;fetchmail&quot;
-        call s:MapDelimiters('#', '')
-    elseif a:filetype == &quot;fgl&quot;
+    elseif a:filetype ==? &quot;fgl&quot;
         call s:MapDelimiters('#', '')
-    elseif a:filetype == &quot;focexec&quot;
+    elseif a:filetype ==? &quot;focexec&quot;
         call s:MapDelimiters('-*', '')
-    elseif a:filetype == &quot;form&quot;
+    elseif a:filetype ==? &quot;form&quot;
         call s:MapDelimiters('*', '')
-    elseif a:filetype == &quot;fortran&quot;
-        call s:MapDelimiters('!', '')
-    elseif a:filetype == &quot;foxpro&quot;
+    elseif a:filetype ==? &quot;foxpro&quot;
         call s:MapDelimiters('*', '')
-    elseif a:filetype == &quot;fstab&quot;
+    elseif a:filetype ==? &quot;fstab&quot;
         call s:MapDelimiters('#', '')
-    elseif a:filetype == &quot;fvwm&quot;
+    elseif a:filetype ==? &quot;fvwm&quot;
         call s:MapDelimiters('#', '')
-    elseif a:filetype == &quot;fx&quot;
+    elseif a:filetype ==? &quot;fx&quot;
         call s:MapDelimitersWithAlternative('//','', '/*','*/')
-    elseif a:filetype == &quot;gams&quot;
+    elseif a:filetype ==? &quot;gams&quot;
         call s:MapDelimiters('*', '')
-    elseif a:filetype == &quot;gdb&quot;
+    elseif a:filetype ==? &quot;gdb&quot;
         call s:MapDelimiters('#', '')
-    elseif a:filetype == &quot;gdmo&quot;
+    elseif a:filetype ==? &quot;gdmo&quot;
         call s:MapDelimiters('--', '')
-    elseif a:filetype == &quot;geek&quot;
+    elseif a:filetype ==? &quot;geek&quot;
         call s:MapDelimiters('GEEK_COMMENT:', '')
-    elseif a:filetype == &quot;genshi&quot;
+    elseif a:filetype ==? &quot;genshi&quot;
         call s:MapDelimitersWithAlternative('&lt;!--','--&gt;', '{#', '#}')
-    elseif a:filetype == &quot;gentoo-conf-d&quot;
+    elseif a:filetype ==? &quot;gentoo-conf-d&quot;
         call s:MapDelimiters('#', '')
-    elseif a:filetype == &quot;gentoo-env-d&quot;
+    elseif a:filetype ==? &quot;gentoo-env-d&quot;
         call s:MapDelimiters('#', '')
-    elseif a:filetype == &quot;gentoo-init-d&quot;
+    elseif a:filetype ==? &quot;gentoo-init-d&quot;
         call s:MapDelimiters('#', '')
-    elseif a:filetype == &quot;gentoo-make-conf&quot;
+    elseif a:filetype ==? &quot;gentoo-make-conf&quot;
         call s:MapDelimiters('#', '')
-    elseif a:filetype == 'gentoo-package-keywords'
+    elseif a:filetype ==? 'gentoo-package-keywords'
         call s:MapDelimiters('#', '')
-    elseif a:filetype == 'gentoo-package-mask'
+    elseif a:filetype ==? 'gentoo-package-mask'
         call s:MapDelimiters('#', '')
-    elseif a:filetype == 'gentoo-package-use'
+    elseif a:filetype ==? 'gentoo-package-use'
         call s:MapDelimiters('#', '')
-    elseif a:filetype == 'git'
-        call s:MapDelimiters('', '')
-    elseif a:filetype == 'gitAnnotate'
-        call s:MapDelimiters('', '')
-    elseif a:filetype == 'gitcommit'
+    elseif a:filetype ==? 'gitcommit'
         call s:MapDelimiters('#', '')
-    elseif a:filetype == 'gitconfig'
+    elseif a:filetype ==? 'gitconfig'
         call s:MapDelimiters(';', '')
-    elseif a:filetype == 'gitdiff'
-        call s:MapDelimiters('', '')
-    elseif a:filetype == 'gitrebase'
+    elseif a:filetype ==? 'gitrebase'
         call s:MapDelimiters('#', '')
-    elseif a:filetype == &quot;gnuplot&quot;
+    elseif a:filetype ==? &quot;gnuplot&quot;
         call s:MapDelimiters('#','')
-    elseif a:filetype == &quot;groovy&quot;
+    elseif a:filetype ==? &quot;groovy&quot;
         call s:MapDelimitersWithAlternative('//','', '/*','*/')
-    elseif a:filetype == &quot;group&quot;
-        call s:MapDelimiters('','')
-    elseif a:filetype == &quot;grub&quot;
+    elseif a:filetype ==? &quot;gtkrc&quot;
         call s:MapDelimiters('#', '')
-    elseif a:filetype == &quot;gtkrc&quot;
-        call s:MapDelimiters('#', '')
-    elseif a:filetype == &quot;haskell&quot;
+    elseif a:filetype ==? &quot;haskell&quot;
         call s:MapDelimitersWithAlternative('{-','-}', '--', '')
-    elseif a:filetype == &quot;hb&quot;
+    elseif a:filetype ==? &quot;hb&quot;
         call s:MapDelimiters('#', '')
-    elseif a:filetype == &quot;h&quot;
+    elseif a:filetype ==? &quot;h&quot;
         call s:MapDelimitersWithAlternative('//','', '/*','*/')
-    elseif a:filetype == &quot;haml&quot;
+    elseif a:filetype ==? &quot;haml&quot;
         call s:MapDelimitersWithAlternative('-#', '', '/', '')
-    elseif a:filetype == &quot;help&quot;
-        call s:MapDelimiters('&quot;','')
-    elseif a:filetype == &quot;hercules&quot;
+    elseif a:filetype ==? &quot;hercules&quot;
         call s:MapDelimitersWithAlternative('//','', '/*','*/')
-    elseif a:filetype == &quot;hog&quot;
+    elseif a:filetype ==? &quot;hog&quot;
         call s:MapDelimiters('#', '')
-    elseif a:filetype == &quot;hostsaccess&quot;
+    elseif a:filetype ==? &quot;hostsaccess&quot;
         call s:MapDelimiters('#', '')
-    elseif a:filetype == &quot;html&quot;
-        call s:MapDelimitersWithAlternative('&lt;!--','--&gt;', '//', '')
-    elseif a:filetype == &quot;htmldjango&quot;
+    elseif a:filetype ==? &quot;htmlcheetah&quot;
+        call s:MapDelimiters('##','')
+    elseif a:filetype ==? &quot;htmldjango&quot;
         call s:MapDelimitersWithAlternative('&lt;!--','--&gt;', '{#', '#}')
-    elseif a:filetype == &quot;htmlos&quot;
+    elseif a:filetype ==? &quot;htmlos&quot;
         call s:MapDelimiters('#','/#')
-    elseif a:filetype == &quot;ia64&quot;
+    elseif a:filetype ==? &quot;ia64&quot;
         call s:MapDelimiters('#', '')
-    elseif a:filetype == &quot;icon&quot;
+    elseif a:filetype ==? &quot;icon&quot;
         call s:MapDelimiters('#', '')
-    elseif a:filetype == &quot;idlang&quot;
+    elseif a:filetype ==? &quot;idlang&quot;
         call s:MapDelimiters(';', '')
-    elseif a:filetype == &quot;idl&quot;
+    elseif a:filetype ==? &quot;idl&quot;
         call s:MapDelimitersWithAlternative('//','', '/*','*/')
-    elseif a:filetype == &quot;indent&quot;
-        call s:MapDelimiters('/*','*/')
-    elseif a:filetype == &quot;inform&quot;
+    elseif a:filetype ==? &quot;inform&quot;
         call s:MapDelimiters('!', '')
-    elseif a:filetype == &quot;inittab&quot;
+    elseif a:filetype ==? &quot;inittab&quot;
         call s:MapDelimiters('#', '')
-    elseif a:filetype == &quot;ishd&quot;
+    elseif a:filetype ==? &quot;ishd&quot;
         call s:MapDelimitersWithAlternative('//','', '/*','*/')
-    elseif a:filetype == &quot;iss&quot;
+    elseif a:filetype ==? &quot;iss&quot;
         call s:MapDelimiters(';', '')
-    elseif a:filetype == &quot;ist&quot;
+    elseif a:filetype ==? &quot;ist&quot;
         call s:MapDelimiters('%', '')
-    elseif a:filetype == &quot;jam&quot;
-        call s:MapDelimiters('/*','*/')
-    elseif a:filetype == &quot;java&quot;
+    elseif a:filetype ==? &quot;java&quot;
+        call s:MapDelimitersWithAlternative('//','', '/*','*/')
+    elseif a:filetype ==? &quot;javacc&quot;
+        call s:MapDelimitersWithAlternative('//','', '/*','*/')
+    elseif a:filetype ==? &quot;javascript&quot;
         call s:MapDelimitersWithAlternative('//','', '/*','*/')
-    elseif a:filetype == &quot;javascript&quot;
+    elseif a:filetype == &quot;javascript.jquery&quot;
         call s:MapDelimitersWithAlternative('//','', '/*','*/')
-    elseif a:filetype == &quot;jess&quot;
+    elseif a:filetype ==? &quot;jess&quot;
         call s:MapDelimiters(';', '')
-    elseif a:filetype == &quot;jgraph&quot;
+    elseif a:filetype ==? &quot;jgraph&quot;
         call s:MapDelimiters('(*','*)')
-    elseif a:filetype == &quot;jproperties&quot;
+    elseif a:filetype ==? &quot;jproperties&quot;
         call s:MapDelimiters('#','')
-    elseif a:filetype == &quot;jsp&quot;
+    elseif a:filetype ==? &quot;jsp&quot;
         call s:MapDelimiters('&lt;%--', '--%&gt;')
-    elseif a:filetype == &quot;kconfig&quot;
-        call s:MapDelimiters('#', '')
-    elseif a:filetype == &quot;kix&quot;
+    elseif a:filetype ==? &quot;kix&quot;
         call s:MapDelimiters(';', '')
-    elseif a:filetype == &quot;kscript&quot;
+    elseif a:filetype ==? &quot;kscript&quot;
         call s:MapDelimitersWithAlternative('//','', '/*','*/')
-    elseif a:filetype == &quot;lace&quot;
+    elseif a:filetype ==? &quot;lace&quot;
         call s:MapDelimiters('--', '')
-    elseif a:filetype == &quot;ldif&quot;
-        call s:MapDelimiters('#', '')
-    elseif a:filetype == &quot;lex&quot;
-        call s:MapDelimiters('/*','*/')
-    elseif a:filetype == &quot;lftp&quot;
+    elseif a:filetype ==? &quot;ldif&quot;
         call s:MapDelimiters('#', '')
-    elseif a:filetype == &quot;lhaskell&quot;
-        call s:MapDelimiters('','')
-    elseif a:filetype == &quot;lifelines&quot;
-        call s:MapDelimiters('/*','*/')
-    elseif a:filetype == &quot;lilo&quot;
+    elseif a:filetype ==? &quot;lilo&quot;
         call s:MapDelimiters('#', '')
-    elseif a:filetype == &quot;lilypond&quot;
+    elseif a:filetype ==? &quot;lilypond&quot;
         call s:MapDelimiters('%', '')
-    elseif a:filetype == &quot;liquid&quot;
+    elseif a:filetype ==? &quot;liquid&quot;
         call s:MapDelimiters('{%', '%}')
-    elseif a:filetype == &quot;lisp&quot;
+    elseif a:filetype ==? &quot;lisp&quot;
         call s:MapDelimitersWithAlternative(';','', '#|', '|#')
-    elseif a:filetype == &quot;lite&quot;
-        call s:MapDelimiters('/*','*/')
-    elseif a:filetype == &quot;llvm&quot;
+    elseif a:filetype ==? &quot;llvm&quot;
         call s:MapDelimiters(';','')
-    elseif a:filetype == &quot;lookupfile&quot;
-        call s:MapDelimiters('', '')
-    elseif a:filetype == &quot;lotos&quot;
+    elseif a:filetype ==? &quot;lotos&quot;
         call s:MapDelimiters('(*','*)')
-    elseif a:filetype == &quot;lout&quot;
+    elseif a:filetype ==? &quot;lout&quot;
         call s:MapDelimiters('#', '')
-    elseif a:filetype == &quot;lprolog&quot;
+    elseif a:filetype ==? &quot;lprolog&quot;
         call s:MapDelimiters('%', '')
-    elseif a:filetype == &quot;lscript&quot;
+    elseif a:filetype ==? &quot;lscript&quot;
         call s:MapDelimiters(&quot;'&quot;, '')
-    elseif a:filetype == &quot;lss&quot;
+    elseif a:filetype ==? &quot;lss&quot;
         call s:MapDelimiters('#', '')
-    elseif a:filetype == &quot;lua&quot;
+    elseif a:filetype ==? &quot;lua&quot;
         call s:MapDelimitersWithAlternative('--','', '--[[', ']]')
-    elseif a:filetype == &quot;lynx&quot;
+    elseif a:filetype ==? &quot;lynx&quot;
         call s:MapDelimiters('#', '')
-    elseif a:filetype == &quot;lytex&quot;
+    elseif a:filetype ==? &quot;lytex&quot;
         call s:MapDelimiters('%', '')
-    elseif a:filetype == &quot;m4&quot;
-        call s:MapDelimiters('dnl ', '')
-    elseif a:filetype == &quot;mail&quot;
+    elseif a:filetype ==? &quot;mail&quot;
         call s:MapDelimiters('&gt; ','')
-    elseif a:filetype == &quot;mailcap&quot;
-        call s:MapDelimiters('#','')
-    elseif a:filetype == &quot;make&quot;
-        call s:MapDelimiters('#','')
-    elseif a:filetype == &quot;mako&quot;
+    elseif a:filetype ==? &quot;mako&quot;
         call s:MapDelimiters('##', '')
-    elseif a:filetype == &quot;man&quot;
+    elseif a:filetype ==? &quot;man&quot;
         call s:MapDelimiters('.&quot;', '')
-    elseif a:filetype == &quot;map&quot;
+    elseif a:filetype ==? &quot;map&quot;
         call s:MapDelimiters('%', '')
-    elseif a:filetype == &quot;maple&quot;
+    elseif a:filetype ==? &quot;maple&quot;
         call s:MapDelimiters('#', '')
-    elseif a:filetype == &quot;markdown&quot;
+    elseif a:filetype ==? &quot;markdown&quot;
         call s:MapDelimiters('&lt;!--', '--&gt;')
-    elseif a:filetype == &quot;masm&quot;
+    elseif a:filetype ==? &quot;masm&quot;
         call s:MapDelimiters(';', '')
-    elseif a:filetype == &quot;mason&quot;
+    elseif a:filetype ==? &quot;mason&quot;
         call s:MapDelimiters('&lt;% #', '%&gt;')
-    elseif a:filetype == &quot;master&quot;
+    elseif a:filetype ==? &quot;master&quot;
         call s:MapDelimiters('$', '')
-    elseif a:filetype == &quot;matlab&quot;
+    elseif a:filetype ==? &quot;matlab&quot;
         call s:MapDelimiters('%', '')
-    elseif a:filetype == &quot;mel&quot;
+    elseif a:filetype ==? &quot;mel&quot;
         call s:MapDelimitersWithAlternative('//','', '/*','*/')
-    elseif a:filetype == &quot;mf&quot;
-        call s:MapDelimiters('%', '')
-    elseif a:filetype == &quot;mib&quot;
+    elseif a:filetype ==? &quot;mib&quot;
         call s:MapDelimiters('--', '')
-    elseif a:filetype == &quot;mkd&quot;
+    elseif a:filetype ==? &quot;mkd&quot;
         call s:MapDelimiters('&gt;', '')
-    elseif a:filetype == &quot;mma&quot;
+    elseif a:filetype ==? &quot;mma&quot;
         call s:MapDelimiters('(*','*)')
-    elseif a:filetype == &quot;modconf&quot;
-        call s:MapDelimiters('#', '')
-    elseif a:filetype == &quot;model&quot;
+    elseif a:filetype ==? &quot;model&quot;
         call s:MapDelimiters('$','$')
     elseif a:filetype =~ &quot;moduala.&quot;
         call s:MapDelimiters('(*','*)')
-    elseif a:filetype == &quot;modula2&quot;
+    elseif a:filetype ==? &quot;modula2&quot;
         call s:MapDelimiters('(*','*)')
-    elseif a:filetype == &quot;modula3&quot;
+    elseif a:filetype ==? &quot;modula3&quot;
         call s:MapDelimiters('(*','*)')
-    elseif a:filetype == &quot;monk&quot;
+    elseif a:filetype ==? &quot;monk&quot;
         call s:MapDelimiters(';', '')
-    elseif a:filetype == &quot;mplayerconf&quot;
+    elseif a:filetype ==? &quot;mush&quot;
         call s:MapDelimiters('#', '')
-    elseif a:filetype == &quot;mrxvtrc&quot;
-        call s:MapDelimiters('#', '')
-    elseif a:filetype == &quot;mush&quot;
-        call s:MapDelimiters('#', '')
-    elseif a:filetype == &quot;muttrc&quot;
-        call s:MapDelimiters('#', '')
-    elseif a:filetype == &quot;named&quot;
+    elseif a:filetype ==? &quot;named&quot;
         call s:MapDelimitersWithAlternative('//','', '/*','*/')
-    elseif a:filetype == &quot;nasm&quot;
+    elseif a:filetype ==? &quot;nasm&quot;
         call s:MapDelimiters(';', '')
-    elseif a:filetype == &quot;nastran&quot;
+    elseif a:filetype ==? &quot;nastran&quot;
         call s:MapDelimiters('$', '')
-    elseif a:filetype == &quot;natural&quot;
+    elseif a:filetype ==? &quot;natural&quot;
         call s:MapDelimiters('/*', '')
-    elseif a:filetype == &quot;ncf&quot;
+    elseif a:filetype ==? &quot;ncf&quot;
         call s:MapDelimiters(';', '')
-    elseif a:filetype == &quot;nerdtree&quot;
-        call s:MapDelimiters('', '')
-    elseif a:filetype == &quot;netdict&quot;
-        call s:MapDelimiters('', '')
-    elseif a:filetype == &quot;netrw&quot;
-        call s:MapDelimiters('', '')
-    elseif a:filetype == &quot;newlisp&quot;
+    elseif a:filetype ==? &quot;newlisp&quot;
         call s:MapDelimiters(';','')
-    elseif a:filetype == &quot;nqc&quot;
-        call s:MapDelimiters('/*','*/')
-    elseif a:filetype == &quot;nroff&quot;
+    elseif a:filetype ==? &quot;nroff&quot;
         call s:MapDelimiters('\&quot;', '')
-    elseif a:filetype == &quot;nsis&quot;
+    elseif a:filetype ==? &quot;nsis&quot;
+        call s:MapDelimiters('#', '')
+    elseif a:filetype ==? &quot;ntp&quot;
         call s:MapDelimiters('#', '')
-    elseif a:filetype == &quot;objc&quot;
+    elseif a:filetype ==? &quot;objc&quot;
         call s:MapDelimitersWithAlternative('//','', '/*','*/')
-    elseif a:filetype == &quot;objcpp&quot;
+    elseif a:filetype ==? &quot;objcpp&quot;
         call s:MapDelimitersWithAlternative('//','', '/*','*/')
-    elseif a:filetype == &quot;objj&quot;
+    elseif a:filetype ==? &quot;objj&quot;
         call s:MapDelimitersWithAlternative('//','', '/*','*/')
-    elseif a:filetype == &quot;ocaml&quot;
+    elseif a:filetype ==? &quot;ocaml&quot;
         call s:MapDelimiters('(*','*)')
-    elseif a:filetype == &quot;occam&quot;
+    elseif a:filetype ==? &quot;occam&quot;
         call s:MapDelimiters('--','')
-    elseif a:filetype == &quot;omlet&quot;
+    elseif a:filetype ==? &quot;omlet&quot;
         call s:MapDelimiters('(*','*)')
-    elseif a:filetype == &quot;omnimark&quot;
+    elseif a:filetype ==? &quot;omnimark&quot;
         call s:MapDelimiters(';', '')
-    elseif a:filetype == &quot;openroad&quot;
+    elseif a:filetype ==? &quot;openroad&quot;
         call s:MapDelimiters('//', '')
-    elseif a:filetype == &quot;opl&quot;
+    elseif a:filetype ==? &quot;opl&quot;
         call s:MapDelimiters(&quot;REM&quot;, &quot;&quot;)
-    elseif a:filetype == &quot;ora&quot;
+    elseif a:filetype ==? &quot;ora&quot;
         call s:MapDelimiters('#', '')
-    elseif a:filetype == &quot;otl&quot;
-        call s:MapDelimiters('', '')
-    elseif a:filetype == &quot;ox&quot;
+    elseif a:filetype ==? &quot;ox&quot;
         call s:MapDelimiters('//', '')
-    elseif a:filetype == &quot;pamconf&quot;
-        call s:MapDelimiters('#', '')
-    elseif a:filetype == &quot;pascal&quot;
+    elseif a:filetype ==? &quot;pascal&quot;
         call s:MapDelimitersWithAlternative('{','}', '(*', '*)')
-    elseif a:filetype == &quot;passwd&quot;
-        call s:MapDelimiters('','')
-    elseif a:filetype == &quot;patran&quot;
+    elseif a:filetype ==? &quot;patran&quot;
         call s:MapDelimitersWithAlternative('$','','/*', '*/')
-    elseif a:filetype == &quot;pcap&quot;
+    elseif a:filetype ==? &quot;pcap&quot;
         call s:MapDelimiters('#', '')
-    elseif a:filetype == &quot;pccts&quot;
+    elseif a:filetype ==? &quot;pccts&quot;
         call s:MapDelimitersWithAlternative('//','', '/*','*/')
-    elseif a:filetype == &quot;perl&quot;
-        call s:MapDelimiters('#', '')
-    elseif a:filetype == &quot;pfmain&quot;
+    elseif a:filetype ==? &quot;pdf&quot;
+        call s:MapDelimiters('%', '')
+    elseif a:filetype ==? &quot;pfmain&quot;
         call s:MapDelimiters('//', '')
-    elseif a:filetype == &quot;php&quot;
+    elseif a:filetype ==? &quot;php&quot;
         call s:MapDelimitersWithAlternative('//','','/*', '*/')
-    elseif a:filetype == &quot;phtml&quot;
-        call s:MapDelimiters('/*','*/')
-    elseif a:filetype == &quot;pic&quot;
+    elseif a:filetype ==? &quot;pic&quot;
         call s:MapDelimiters(';', '')
-    elseif a:filetype == &quot;pike&quot;
+    elseif a:filetype ==? &quot;pike&quot;
         call s:MapDelimitersWithAlternative('//','', '/*','*/')
-    elseif a:filetype == &quot;pilrc&quot;
+    elseif a:filetype ==? &quot;pilrc&quot;
         call s:MapDelimitersWithAlternative('//','', '/*','*/')
-    elseif a:filetype == &quot;pine&quot;
+    elseif a:filetype ==? &quot;pine&quot;
         call s:MapDelimiters('#', '')
-    elseif a:filetype == &quot;plaintex&quot;
-        call s:MapDelimiters('%','')
-    elseif a:filetype == &quot;plm&quot;
+    elseif a:filetype ==? &quot;plm&quot;
         call s:MapDelimitersWithAlternative('//','', '/*','*/')
-    elseif a:filetype == &quot;plsql&quot;
+    elseif a:filetype ==? &quot;plsql&quot;
         call s:MapDelimitersWithAlternative('--', '', '/*', '*/')
-    elseif a:filetype == &quot;po&quot;
+    elseif a:filetype ==? &quot;po&quot;
         call s:MapDelimiters('#', '')
-    elseif a:filetype == &quot;postscr&quot;
+    elseif a:filetype ==? &quot;postscr&quot;
         call s:MapDelimiters('%', '')
-    elseif a:filetype == &quot;potwiki&quot;
-        call s:MapDelimiters('', '')
-    elseif a:filetype == &quot;pov&quot;
+    elseif a:filetype ==? &quot;pov&quot;
         call s:MapDelimitersWithAlternative('//','', '/*','*/')
-    elseif a:filetype == &quot;povini&quot;
+    elseif a:filetype ==? &quot;povini&quot;
         call s:MapDelimiters(';', '')
-    elseif a:filetype == &quot;ppd&quot;
+    elseif a:filetype ==? &quot;ppd&quot;
         call s:MapDelimiters('%', '')
-    elseif a:filetype == &quot;ppwiz&quot;
+    elseif a:filetype ==? &quot;ppwiz&quot;
         call s:MapDelimiters(';;', '')
-    elseif a:filetype == &quot;processing&quot;
+    elseif a:filetype ==? &quot;processing&quot;
         call s:MapDelimitersWithAlternative('//','', '/*','*/')
-    elseif a:filetype == &quot;procmail&quot;
-        call s:MapDelimiters('#', '')
-    elseif a:filetype == &quot;progress&quot;
-        call s:MapDelimiters('/*','*/')
-    elseif a:filetype == &quot;prolog&quot;
+    elseif a:filetype ==? &quot;prolog&quot;
         call s:MapDelimitersWithAlternative('%','','/*','*/')
-    elseif a:filetype == &quot;ps1&quot;
+    elseif a:filetype ==? &quot;ps1&quot;
         call s:MapDelimiters('#', '')
-    elseif a:filetype == &quot;psf&quot;
+    elseif a:filetype ==? &quot;psf&quot;
         call s:MapDelimiters('#', '')
-    elseif a:filetype == &quot;ptcap&quot;
+    elseif a:filetype ==? &quot;ptcap&quot;
         call s:MapDelimiters('#', '')
-    elseif a:filetype == &quot;pyrex&quot;
-        call s:MapDelimiters('#','')
-    elseif a:filetype == &quot;python&quot;
-        call s:MapDelimiters('#','')
-    elseif a:filetype == &quot;qf&quot;
-        call s:MapDelimiters('','')
-    elseif a:filetype == &quot;radiance&quot;
+    elseif a:filetype ==? &quot;radiance&quot;
         call s:MapDelimiters('#', '')
-    elseif a:filetype == &quot;Rails-log&quot;
-        call s:MapDelimiters('', '')
-    elseif a:filetype == &quot;ratpoison&quot;
+    elseif a:filetype ==? &quot;ratpoison&quot;
         call s:MapDelimiters('#', '')
-    elseif a:filetype == &quot;r&quot;
+    elseif a:filetype ==? &quot;r&quot;
         call s:MapDelimiters('#', '')
-    elseif a:filetype == &quot;rc&quot;
+    elseif a:filetype ==? &quot;rc&quot;
         call s:MapDelimitersWithAlternative('//','', '/*','*/')
-    elseif a:filetype == &quot;readline&quot;
-        call s:MapDelimiters('#', '')
-    elseif a:filetype == &quot;rebol&quot;
+    elseif a:filetype ==? &quot;rebol&quot;
         call s:MapDelimiters(';', '')
-    elseif a:filetype == &quot;registry&quot;
+    elseif a:filetype ==? &quot;registry&quot;
         call s:MapDelimiters(';', '')
-    elseif a:filetype == &quot;remind&quot;
+    elseif a:filetype ==? &quot;remind&quot;
         call s:MapDelimiters('#', '')
-    elseif a:filetype == &quot;rexx&quot;
-        call s:MapDelimiters('/*','*/')
-    elseif a:filetype == &quot;rib&quot;
-        call s:MapDelimiters('#','')
-    elseif a:filetype == &quot;robots&quot;
+    elseif a:filetype ==? &quot;resolv&quot;
         call s:MapDelimiters('#', '')
-    elseif a:filetype == &quot;rpl&quot;
-        call s:MapDelimiters('/*','*/')
-    elseif a:filetype == &quot;rst&quot;
-        call s:MapDelimiters('..', '')
-    elseif a:filetype == &quot;rtf&quot;
-        call s:MapDelimiters('', '')
-    elseif a:filetype == &quot;ruby&quot;
+    elseif a:filetype ==? &quot;rgb&quot;
+        call s:MapDelimiters('!', '')
+    elseif a:filetype ==? &quot;rib&quot;
         call s:MapDelimiters('#','')
-    elseif a:filetype == &quot;sa&quot;
+    elseif a:filetype ==? &quot;robots&quot;
+        call s:MapDelimiters('#', '')
+    elseif a:filetype ==? &quot;sa&quot;
         call s:MapDelimiters('--','')
-    elseif a:filetype == &quot;samba&quot;
+    elseif a:filetype ==? &quot;samba&quot;
         call s:MapDelimitersWithAlternative(';','', '#', '')
-    elseif a:filetype == &quot;sas&quot;
-        call s:MapDelimiters('/*','*/')
-    elseif a:filetype == &quot;sass&quot;
+    elseif a:filetype ==? &quot;sass&quot;
         call s:MapDelimitersWithAlternative('//','', '/*', '')
-    elseif a:filetype == &quot;sather&quot;
+    elseif a:filetype ==? &quot;sather&quot;
         call s:MapDelimiters('--', '')
-    elseif a:filetype == &quot;scala&quot;
+    elseif a:filetype ==? &quot;scala&quot;
         call s:MapDelimitersWithAlternative('//','', '/*','*/')
-    elseif a:filetype == &quot;scheme&quot;
-        call s:MapDelimiters(';', '')
-    elseif a:filetype == &quot;scilab&quot;
+    elseif a:filetype ==? &quot;scilab&quot;
         call s:MapDelimiters('//', '')
-    elseif a:filetype == &quot;screen&quot;
-        call s:MapDelimiters('#', '')
-    elseif a:filetype == &quot;scsh&quot;
+    elseif a:filetype ==? &quot;scsh&quot;
         call s:MapDelimiters(';', '')
-    elseif a:filetype == &quot;sdl&quot;
-        call s:MapDelimiters('/*','*/')
-    elseif a:filetype == &quot;sed&quot;
+    elseif a:filetype ==? &quot;sed&quot;
         call s:MapDelimiters('#', '')
-    elseif a:filetype == &quot;selectbuf&quot;
-        call s:MapDelimiters('', '')
-    elseif a:filetype == &quot;services&quot;
-        call s:MapDelimiters('#', '')
-    elseif a:filetype == &quot;sgml&quot;
-        call s:MapDelimiters('&lt;!','&gt;')
-    elseif a:filetype == &quot;sgmldecl&quot;
+    elseif a:filetype ==? &quot;sgmldecl&quot;
         call s:MapDelimiters('--','--')
-    elseif a:filetype == &quot;sgmllnx&quot;
+    elseif a:filetype ==? &quot;sgmllnx&quot;
         call s:MapDelimiters('&lt;!--','--&gt;')
-    elseif a:filetype == &quot;sicad&quot;
+    elseif a:filetype ==? &quot;sicad&quot;
         call s:MapDelimiters('*', '')
-    elseif a:filetype == &quot;sieve&quot;
-        call s:MapDelimiters('#', '')
-    elseif a:filetype == &quot;simula&quot;
+    elseif a:filetype ==? &quot;simula&quot;
         call s:MapDelimitersWithAlternative('%', '', '--', '')
-    elseif a:filetype == &quot;sinda&quot;
+    elseif a:filetype ==? &quot;sinda&quot;
         call s:MapDelimiters('$', '')
-    elseif a:filetype == &quot;skill&quot;
+    elseif a:filetype ==? &quot;skill&quot;
         call s:MapDelimiters(';', '')
-    elseif a:filetype == &quot;slang&quot;
+    elseif a:filetype ==? &quot;slang&quot;
         call s:MapDelimiters('%', '')
-    elseif a:filetype == &quot;sl&quot;
-        call s:MapDelimiters('/*','*/')
-    elseif a:filetype == &quot;slice&quot;
+    elseif a:filetype ==? &quot;slice&quot;
         call s:MapDelimitersWithAlternative('//','', '/*','*/')
-    elseif a:filetype == &quot;slrnrc&quot;
+    elseif a:filetype ==? &quot;slrnrc&quot;
         call s:MapDelimiters('%', '')
-    elseif a:filetype == &quot;sm&quot;
+    elseif a:filetype ==? &quot;sm&quot;
         call s:MapDelimiters('#', '')
-    elseif a:filetype == &quot;smarty&quot;
+    elseif a:filetype ==? &quot;smarty&quot;
         call s:MapDelimiters('{*', '*}')
-    elseif a:filetype == &quot;smil&quot;
+    elseif a:filetype ==? &quot;smil&quot;
         call s:MapDelimiters('&lt;!','&gt;')
-    elseif a:filetype == &quot;smith&quot;
+    elseif a:filetype ==? &quot;smith&quot;
         call s:MapDelimiters(';', '')
-    elseif a:filetype == &quot;sml&quot;
+    elseif a:filetype ==? &quot;sml&quot;
         call s:MapDelimiters('(*','*)')
-    elseif a:filetype == &quot;snnsnet&quot;
+    elseif a:filetype ==? &quot;snnsnet&quot;
         call s:MapDelimiters('#', '')
-    elseif a:filetype == &quot;snnspat&quot;
+    elseif a:filetype ==? &quot;snnspat&quot;
         call s:MapDelimiters('#', '')
-    elseif a:filetype == &quot;snnsres&quot;
+    elseif a:filetype ==? &quot;snnsres&quot;
         call s:MapDelimiters('#', '')
-    elseif a:filetype == &quot;snobol4&quot;
+    elseif a:filetype ==? &quot;snobol4&quot;
         call s:MapDelimiters('*', '')
-    elseif a:filetype == &quot;spec&quot;
+    elseif a:filetype ==? &quot;spec&quot;
         call s:MapDelimiters('#', '')
-    elseif a:filetype == &quot;specman&quot;
+    elseif a:filetype ==? &quot;specman&quot;
         call s:MapDelimiters('//', '')
-    elseif a:filetype == &quot;spectre&quot;
+    elseif a:filetype ==? &quot;spectre&quot;
         call s:MapDelimitersWithAlternative('//', '', '*', '')
-    elseif a:filetype == &quot;spice&quot;
+    elseif a:filetype ==? &quot;spice&quot;
         call s:MapDelimiters('$', '')
-    elseif a:filetype == &quot;sql&quot;
+    elseif a:filetype ==? &quot;sql&quot;
         call s:MapDelimiters('--', '')
-    elseif a:filetype == &quot;sqlforms&quot;
+    elseif a:filetype ==? &quot;sqlforms&quot;
         call s:MapDelimiters('--', '')
-    elseif a:filetype == &quot;sqlj&quot;
+    elseif a:filetype ==? &quot;sqlj&quot;
         call s:MapDelimiters('--', '')
-    elseif a:filetype == &quot;sqr&quot;
+    elseif a:filetype ==? &quot;sqr&quot;
         call s:MapDelimiters('!', '')
-    elseif a:filetype == &quot;squid&quot;
+    elseif a:filetype ==? &quot;squid&quot;
         call s:MapDelimiters('#', '')
-    elseif a:filetype == &quot;st&quot;
+    elseif a:filetype ==? &quot;st&quot;
         call s:MapDelimiters('&quot;','')
-    elseif a:filetype == &quot;stata&quot;
-        call s:MapDelimiters('/*','*/')
-    elseif a:filetype == &quot;stp&quot;
+    elseif a:filetype ==? &quot;stp&quot;
         call s:MapDelimiters('--', '')
-    elseif a:filetype == &quot;strace&quot;
-        call s:MapDelimiters('/*','*/')
-    elseif a:filetype == &quot;sudoers&quot;
-        call s:MapDelimiters('#', '')
-    elseif a:filetype == &quot;SVKAnnotate&quot;
-        call s:MapDelimiters('','')
-    elseif a:filetype == &quot;svn&quot;
-        call s:MapDelimiters('','')
-    elseif a:filetype == &quot;SVNannotate&quot;
-        call s:MapDelimiters('','')
-    elseif a:filetype == &quot;SVNAnnotate&quot;
-        call s:MapDelimiters('','')
-    elseif a:filetype == &quot;SVNcommit&quot;
-        call s:MapDelimiters('','')
-    elseif a:filetype == &quot;SVNcommitlog&quot;
-        call s:MapDelimiters('','')
-    elseif a:filetype == &quot;SVNdiff&quot;
-        call s:MapDelimiters('','')
-    elseif a:filetype == &quot;SVNinfo&quot;
-        call s:MapDelimiters('','')
-    elseif a:filetype == &quot;systemverilog&quot;
+    elseif a:filetype ==? &quot;systemverilog&quot;
         call s:MapDelimitersWithAlternative('//','', '/*','*/')
-    elseif a:filetype == &quot;tads&quot;
+    elseif a:filetype ==? &quot;tads&quot;
         call s:MapDelimitersWithAlternative('//','', '/*','*/')
-    elseif a:filetype == &quot;taglist&quot;
-        call s:MapDelimiters('', '')
-    elseif a:filetype == &quot;tags&quot;
+    elseif a:filetype ==? &quot;tags&quot;
         call s:MapDelimiters(';', '')
-    elseif a:filetype == &quot;tak&quot;
+    elseif a:filetype ==? &quot;tak&quot;
         call s:MapDelimiters('$', '')
-    elseif a:filetype == &quot;tar&quot;
-        call s:MapDelimiters('', '')
-    elseif a:filetype == &quot;tasm&quot;
+    elseif a:filetype ==? &quot;tasm&quot;
         call s:MapDelimiters(';', '')
-    elseif a:filetype == &quot;tcl&quot;
+    elseif a:filetype ==? &quot;tcl&quot;
         call s:MapDelimiters('#','')
-    elseif a:filetype == &quot;terminfo&quot;
-        call s:MapDelimiters('#', '')
-    elseif a:filetype == &quot;tex&quot;
-        call s:MapDelimiters('%','')
-    elseif a:filetype == &quot;text&quot;
-        call s:MapDelimiters('','')
-    elseif a:filetype == &quot;texinfo&quot;
+    elseif a:filetype ==? &quot;texinfo&quot;
         call s:MapDelimiters(&quot;@c &quot;, &quot;&quot;)
-    elseif a:filetype == &quot;texmf&quot;
+    elseif a:filetype ==? &quot;texmf&quot;
         call s:MapDelimiters('%', '')
-    elseif a:filetype == &quot;tf&quot;
+    elseif a:filetype ==? &quot;tf&quot;
         call s:MapDelimiters(';', '')
-    elseif a:filetype == &quot;tidy&quot;
+    elseif a:filetype ==? &quot;tidy&quot;
         call s:MapDelimiters('#', '')
-    elseif a:filetype == &quot;tli&quot;
+    elseif a:filetype ==? &quot;tli&quot;
         call s:MapDelimiters('#', '')
-    elseif a:filetype == &quot;trasys&quot;
+    elseif a:filetype ==? &quot;trasys&quot;
         call s:MapDelimiters(&quot;$&quot;, &quot;&quot;)
-    elseif a:filetype == &quot;tsalt&quot;
+    elseif a:filetype ==? &quot;tsalt&quot;
         call s:MapDelimitersWithAlternative('//','', '/*','*/')
-    elseif a:filetype == &quot;tsscl&quot;
+    elseif a:filetype ==? &quot;tsscl&quot;
         call s:MapDelimiters('#', '')
-    elseif a:filetype == &quot;tssgm&quot;
+    elseif a:filetype ==? &quot;tssgm&quot;
         call s:MapDelimiters(&quot;comment = '&quot;,&quot;'&quot;)
-    elseif a:filetype == &quot;txt2tags&quot;
+    elseif a:filetype ==? &quot;txt2tags&quot;
         call s:MapDelimiters('%','')
-    elseif a:filetype == &quot;uc&quot;
+    elseif a:filetype ==? &quot;uc&quot;
         call s:MapDelimitersWithAlternative('//','', '/*','*/')
-    elseif a:filetype == &quot;uil&quot;
+    elseif a:filetype ==? &quot;uil&quot;
         call s:MapDelimiters('!', '')
-    elseif a:filetype == &quot;vb&quot;
+    elseif a:filetype ==? &quot;vb&quot;
         call s:MapDelimiters(&quot;'&quot;,&quot;&quot;)
-    elseif a:filetype == &quot;vcscommit&quot;
-        call s:MapDelimiters('','')
-    elseif a:filetype == &quot;velocity&quot;
+    elseif a:filetype ==? &quot;velocity&quot;
         call s:MapDelimitersWithAlternative(&quot;##&quot;,&quot;&quot;, '#*', '*#')
-    elseif a:filetype == &quot;vera&quot;
+    elseif a:filetype ==? &quot;vera&quot;
         call s:MapDelimitersWithAlternative('/*','*/','//','')
-    elseif a:filetype == &quot;verilog&quot;
+    elseif a:filetype ==? &quot;verilog&quot;
         call s:MapDelimitersWithAlternative('//','', '/*','*/')
-    elseif a:filetype == &quot;verilog_systemverilog&quot;
+    elseif a:filetype ==? &quot;verilog_systemverilog&quot;
         call s:MapDelimitersWithAlternative('//','', '/*','*/')
-    elseif a:filetype == &quot;vgrindefs&quot;
+    elseif a:filetype ==? &quot;vgrindefs&quot;
         call s:MapDelimiters('#', '')
-    elseif a:filetype == &quot;vhdl&quot;
+    elseif a:filetype ==? &quot;vhdl&quot;
         call s:MapDelimiters('--', '')
-    elseif a:filetype == &quot;vim&quot;
-        call s:MapDelimiters('&quot;','')
-    elseif a:filetype == &quot;viminfo&quot;
-        call s:MapDelimiters('','')
-    elseif a:filetype == &quot;vimperator&quot;
+    elseif a:filetype ==? &quot;vimperator&quot;
         call s:MapDelimiters('&quot;','')
-    elseif a:filetype == &quot;virata&quot;
+    elseif a:filetype ==? &quot;virata&quot;
         call s:MapDelimiters('%', '')
-    elseif a:filetype == &quot;vo_base&quot;
-        call s:MapDelimiters('', '')
-    elseif a:filetype == &quot;vrml&quot;
+    elseif a:filetype ==? &quot;vrml&quot;
         call s:MapDelimiters('#', '')
-    elseif a:filetype == &quot;vsejcl&quot;
+    elseif a:filetype ==? &quot;vsejcl&quot;
         call s:MapDelimiters('/*', '')
-    elseif a:filetype == &quot;webmacro&quot;
+    elseif a:filetype ==? &quot;webmacro&quot;
         call s:MapDelimiters('##', '')
-    elseif a:filetype == &quot;wget&quot;
+    elseif a:filetype ==? &quot;wget&quot;
         call s:MapDelimiters('#', '')
     elseif a:filetype ==? &quot;Wikipedia&quot;
         call s:MapDelimiters('&lt;!--','--&gt;')
-    elseif a:filetype == &quot;winbatch&quot;
+    elseif a:filetype ==? &quot;winbatch&quot;
         call s:MapDelimiters(';', '')
-    elseif a:filetype == &quot;wml&quot;
-        call s:MapDelimiters('#', '')
-    elseif a:filetype =~ &quot;[^w]*sh&quot;
+    elseif a:filetype ==? &quot;wml&quot;
         call s:MapDelimiters('#', '')
-    elseif a:filetype == &quot;wvdial&quot;
+    elseif a:filetype ==? &quot;wvdial&quot;
         call s:MapDelimiters(';', '')
-    elseif a:filetype == &quot;xdefaults&quot;
+    elseif a:filetype ==? &quot;xdefaults&quot;
         call s:MapDelimiters('!', '')
-    elseif a:filetype == &quot;xf86conf&quot;
-        call s:MapDelimiters('#', '')
-    elseif a:filetype == &quot;xhtml&quot;
-        call s:MapDelimiters('&lt;!--', '--&gt;')
-    elseif a:filetype == &quot;xkb&quot;
+    elseif a:filetype ==? &quot;xkb&quot;
         call s:MapDelimiters('//', '')
-    elseif a:filetype == &quot;xmath&quot;
+    elseif a:filetype ==? &quot;xmath&quot;
         call s:MapDelimiters('#', '')
-    elseif a:filetype == &quot;xml&quot;
-        call s:MapDelimiters('&lt;!--','--&gt;')
-    elseif a:filetype == &quot;xmodmap&quot;
-        call s:MapDelimiters('!', '')
-    elseif a:filetype == &quot;xpm2&quot;
+    elseif a:filetype ==? &quot;xpm2&quot;
         call s:MapDelimiters('!', '')
-    elseif a:filetype == &quot;xpm&quot;
-        call s:MapDelimiters('/*','*/')
-    elseif a:filetype == &quot;xsd&quot;
-        call s:MapDelimiters('&lt;!--','--&gt;')
-    elseif a:filetype == &quot;xslt&quot;
-        call s:MapDelimiters('&lt;!--','--&gt;')
-    elseif a:filetype == &quot;yacc&quot;
-        call s:MapDelimiters('/*','*/')
-    elseif a:filetype == &quot;yaml&quot;
-        call s:MapDelimiters('#','')
-    elseif a:filetype == &quot;xquery&quot;
+    elseif a:filetype ==? &quot;xquery&quot;
         call s:MapDelimiters('(:',':)')
-    elseif a:filetype == &quot;z8a&quot;
+    elseif a:filetype ==? &quot;z8a&quot;
         call s:MapDelimiters(';', '')
 
-    elseif a:filetype == &quot;&quot;
-        call s:MapDelimitersWithAlternative(&quot;&quot;,&quot;&quot;, &quot;&quot;, &quot;&quot;)
-
-        &quot;we have not hardcoded the comment delimiters to use for this filetype so
-        &quot;get them from &amp;commentstring.
     else
-        &quot;print a disclaimer to the user :)
-        if !g:NERDShutUp
-            call s:NerdEcho(&quot;Unknown filetype '&quot;.a:filetype.&quot;', setting delimiters by &amp;commentstring.\nPleeeeease email the author of the NERD commenter with this filetype\nand its delimiters!&quot;, 0)
-        endif
 
         &quot;extract the delims from &amp;commentstring
-        let left= substitute(&amp;commentstring, '\(.*\)%s.*', '\1', '')
-        let right= substitute(&amp;commentstring, '.*%s\(.*\)', '\1', 'g')
-
+        let left= substitute(&amp;commentstring, '\([^ \t]*\)\s*%s.*', '\1', '')
+        let right= substitute(&amp;commentstring, '.*%s\s*\(.*\)', '\1', 'g')
         call s:MapDelimiters(left,right)
+
     endif
 endfunction
 
@@ -966,15 +749,15 @@ endfunction
 &quot;   -rightAlt: the string for the alternative comment style defining the comment end delimiter
 function s:MapDelimitersWithAlternative(left, right, leftAlt, rightAlt)
     if !exists('g:NERD_' . &amp;filetype . '_alt_style')
-        let b:left = a:left
-        let b:right = a:right
-        let b:leftAlt = a:leftAlt
-        let b:rightAlt = a:rightAlt
+        let b:NERDLeft = a:left
+        let b:NERDRight = a:right
+        let b:NERDLeftAlt = a:leftAlt
+        let b:NERDRightAlt = a:rightAlt
     else
-        let b:left = a:leftAlt
-        let b:right = a:rightAlt
-        let b:leftAlt = a:left
-        let b:rightAlt = a:right
+        let b:NERDLeft = a:leftAlt
+        let b:NERDRight = a:rightAlt
+        let b:NERDLeftAlt = a:left
+        let b:NERDRightAlt = a:right
     endif
 endfunction
 
@@ -990,7 +773,7 @@ endfunction
 function s:SwitchToAlternativeDelimiters(printMsgs)
     &quot;if both of the alternative delimiters are empty then there is no
     &quot;alternative comment style so bail out
-    if b:leftAlt == &quot;&quot; &amp;&amp; b:rightAlt == &quot;&quot;
+    if b:NERDLeftAlt == &quot;&quot; &amp;&amp; b:NERDRightAlt == &quot;&quot;
         if a:printMsgs
             call s:NerdEcho(&quot;Cannot use alternative delimiters, none are specified&quot;, 0)
         endif
@@ -998,21 +781,21 @@ function s:SwitchToAlternativeDelimiters(printMsgs)
     endif
 
     &quot;save the current delimiters
-    let tempLeft = b:left
-    let tempRight = b:right
+    let tempLeft = b:NERDLeft
+    let tempRight = b:NERDRight
 
     &quot;swap current delimiters for alternative
-    let b:left = b:leftAlt
-    let b:right = b:rightAlt
+    let b:NERDLeft = b:NERDLeftAlt
+    let b:NERDRight = b:NERDRightAlt
 
     &quot;set the previously current delimiters to be the new alternative ones
-    let b:leftAlt = tempLeft
-    let b:rightAlt = tempRight
+    let b:NERDLeftAlt = tempLeft
+    let b:NERDRightAlt = tempRight
 
     &quot;tell the user what comment delimiters they are now using
     if a:printMsgs
-        let leftNoEsc = b:left
-        let rightNoEsc = b:right
+        let leftNoEsc = b:NERDLeft
+        let rightNoEsc = b:NERDRight
         call s:NerdEcho(&quot;Now using &quot; . leftNoEsc . &quot; &quot; . rightNoEsc . &quot; to delimit comments&quot;, 1)
     endif
 
@@ -1142,19 +925,19 @@ function s:CommentBlock(top, bottom, lSide, rSide, forceNested )
                         &quot;stick the right delimiter down
                         let theLine = strpart(theLine, 0, rSide+strlen(leftSpaced)) . rightSpaced . strpart(theLine, rSide+strlen(leftSpaced))
 
-                        let firstLeftDelim = s:FindDelimiterIndex(b:left, theLine)
-                        let lastRightDelim = s:LastIndexOfDelim(b:right, theLine)
+                        let firstLeftDelim = s:FindDelimiterIndex(b:NERDLeft, theLine)
+                        let lastRightDelim = s:LastIndexOfDelim(b:NERDRight, theLine)
 
                         if firstLeftDelim != -1 &amp;&amp; lastRightDelim != -1
                             let searchStr = strpart(theLine, 0, lastRightDelim)
-                            let searchStr = strpart(searchStr, firstLeftDelim+strlen(b:left))
+                            let searchStr = strpart(searchStr, firstLeftDelim+strlen(b:NERDLeft))
 
                             &quot;replace the outter most delims in searchStr with
                             &quot;place-holders
-                            let theLineWithPlaceHolders = s:ReplaceDelims(b:left, b:right, g:NERDLPlace, g:NERDRPlace, searchStr)
+                            let theLineWithPlaceHolders = s:ReplaceDelims(b:NERDLeft, b:NERDRight, g:NERDLPlace, g:NERDRPlace, searchStr)
 
                             &quot;add the right delimiter onto the line
-                            let theLine = strpart(theLine, 0, firstLeftDelim+strlen(b:left)) . theLineWithPlaceHolders . strpart(theLine, lastRightDelim)
+                            let theLine = strpart(theLine, 0, firstLeftDelim+strlen(b:NERDLeft)) . theLineWithPlaceHolders . strpart(theLine, lastRightDelim)
                         endif
                     endif
                 endif
@@ -1213,7 +996,7 @@ function s:CommentLines(forceNested, align, firstLine, lastLine)
 
             &quot; find out if the line is commented using normal delims and/or
             &quot; alternate ones
-            let isCommented = s:IsCommented(b:left, b:right, theLine) || s:IsCommented(b:leftAlt, b:rightAlt, theLine)
+            let isCommented = s:IsCommented(b:NERDLeft, b:NERDRight, theLine) || s:IsCommented(b:NERDLeftAlt, b:NERDRightAlt, theLine)
 
             &quot; check if we can comment this line
             if !isCommented || g:NERDUsePlaceHolders || s:Multipart()
@@ -1362,13 +1145,13 @@ function s:CommentLinesSexy(topline, bottomline)
         &quot; add the left delimiter one line above the lines that are to be commented
         call cursor(a:topline, 1)
         execute 'normal! O'
-        call setline(a:topline, strpart(s:spaces, 0, leftAlignIndx) . left )
+        call setline(a:topline, repeat(' ', leftAlignIndx) . left )
 
         &quot; add the right delimiter after bottom line (we have to add 1 cos we moved
         &quot; the lines down when we added the left delim
         call cursor(a:bottomline+1, 1)
         execute 'normal! o'
-        call setline(a:bottomline+2, strpart(s:spaces, 0, leftAlignIndx) . strpart(s:spaces, 0, strlen(left)-strlen(sexyComMarker)) . right )
+        call setline(a:bottomline+2, repeat(' ', leftAlignIndx) . repeat(' ', strlen(left)-strlen(sexyComMarker)) . right )
 
     endif
 
@@ -1386,7 +1169,7 @@ function s:CommentLinesSexy(topline, bottomline)
         let theLine = s:SwapOutterMultiPartDelimsForPlaceHolders(theLine)
 
         &quot; add the sexyComMarker
-        let theLine = strpart(s:spaces, 0, leftAlignIndx) . strpart(s:spaces, 0, strlen(left)-strlen(sexyComMarker)) . sexyComMarkerSpaced . strpart(theLine, leftAlignIndx)
+        let theLine = repeat(' ', leftAlignIndx) . repeat(' ', strlen(left)-strlen(sexyComMarker)) . sexyComMarkerSpaced . strpart(theLine, leftAlignIndx)
 
         if lineHasTabs
             let theLine = s:ConvertLeadingSpacesToTabs(theLine)
@@ -1482,7 +1265,7 @@ function s:CommentRegion(topLine, topCol, bottomLine, bottomCol, forceNested)
     endif
 
     &quot;stick the cursor back on the char it was on before the comment
-    call cursor(a:topLine, a:topCol + strlen(b:left) + g:NERDSpaceDelims)
+    call cursor(a:topLine, a:topCol + strlen(b:NERDLeft) + g:NERDSpaceDelims)
 
     &quot;if we switched delims then we gotta go back to what they were before
     if switchedDelims == 1
@@ -1507,7 +1290,7 @@ function s:InvertComment(firstLine, lastLine)
         let sexyComBounds = s:FindBoundingLinesOfSexyCom(currentLine)
 
         &quot; if the line is commented normally, uncomment it
-        if s:IsCommentedFromStartOfLine(b:left, theLine) || s:IsCommentedFromStartOfLine(b:leftAlt, theLine)
+        if s:IsCommentedFromStartOfLine(b:NERDLeft, theLine) || s:IsCommentedFromStartOfLine(b:NERDLeftAlt, theLine)
             call s:UncommentLines(currentLine, currentLine)
             let currentLine = currentLine + 1
 
@@ -1590,7 +1373,7 @@ function! NERDComment(isVisual, type) range
     elseif a:type == 'toggle'
         let theLine = getline(firstLine)
 
-        if s:IsInSexyComment(firstLine) || s:IsCommentedFromStartOfLine(b:left, theLine) || s:IsCommentedFromStartOfLine(b:leftAlt, theLine)
+        if s:IsInSexyComment(firstLine) || s:IsCommentedFromStartOfLine(b:NERDLeft, theLine) || s:IsCommentedFromStartOfLine(b:NERDLeftAlt, theLine)
             call s:UncommentLines(firstLine, lastLine)
         else
             call s:CommentLinesToggle(forceNested, firstLine, lastLine)
@@ -1907,54 +1690,54 @@ function s:UncommentLineNormal(line)
     let line = a:line
 
     &quot;get the comment status on the line so we know how it is commented
-    let lineCommentStatus =  s:IsCommentedOuttermost(b:left, b:right, b:leftAlt, b:rightAlt, line)
+    let lineCommentStatus =  s:IsCommentedOuttermost(b:NERDLeft, b:NERDRight, b:NERDLeftAlt, b:NERDRightAlt, line)
 
-    &quot;it is commented with b:left and b:right so remove these delims
+    &quot;it is commented with b:NERDLeft and b:NERDRight so remove these delims
     if lineCommentStatus == 1
-        let line = s:RemoveDelimiters(b:left, b:right, line)
+        let line = s:RemoveDelimiters(b:NERDLeft, b:NERDRight, line)
 
-    &quot;it is commented with b:leftAlt and b:rightAlt so remove these delims
+    &quot;it is commented with b:NERDLeftAlt and b:NERDRightAlt so remove these delims
     elseif lineCommentStatus == 2 &amp;&amp; g:NERDRemoveAltComs
-        let line = s:RemoveDelimiters(b:leftAlt, b:rightAlt, line)
+        let line = s:RemoveDelimiters(b:NERDLeftAlt, b:NERDRightAlt, line)
 
     &quot;it is not properly commented with any delims so we check if it has
     &quot;any random left or right delims on it and remove the outtermost ones
     else
         &quot;get the positions of all delim types on the line
-        let indxLeft = s:FindDelimiterIndex(b:left, line)
-        let indxLeftAlt = s:FindDelimiterIndex(b:leftAlt, line)
-        let indxRight = s:FindDelimiterIndex(b:right, line)
-        let indxRightAlt = s:FindDelimiterIndex(b:rightAlt, line)
+        let indxLeft = s:FindDelimiterIndex(b:NERDLeft, line)
+        let indxLeftAlt = s:FindDelimiterIndex(b:NERDLeftAlt, line)
+        let indxRight = s:FindDelimiterIndex(b:NERDRight, line)
+        let indxRightAlt = s:FindDelimiterIndex(b:NERDRightAlt, line)
 
         &quot;remove the outter most left comment delim
         if indxLeft != -1 &amp;&amp; (indxLeft &lt; indxLeftAlt || indxLeftAlt == -1)
-            let line = s:RemoveDelimiters(b:left, '', line)
+            let line = s:RemoveDelimiters(b:NERDLeft, '', line)
         elseif indxLeftAlt != -1
-            let line = s:RemoveDelimiters(b:leftAlt, '', line)
+            let line = s:RemoveDelimiters(b:NERDLeftAlt, '', line)
         endif
 
         &quot;remove the outter most right comment delim
         if indxRight != -1 &amp;&amp; (indxRight &lt; indxRightAlt || indxRightAlt == -1)
-            let line = s:RemoveDelimiters('', b:right, line)
+            let line = s:RemoveDelimiters('', b:NERDRight, line)
         elseif indxRightAlt != -1
-            let line = s:RemoveDelimiters('', b:rightAlt, line)
+            let line = s:RemoveDelimiters('', b:NERDRightAlt, line)
         endif
     endif
 
 
-    let indxLeft = s:FindDelimiterIndex(b:left, line)
-    let indxLeftAlt = s:FindDelimiterIndex(b:leftAlt, line)
+    let indxLeft = s:FindDelimiterIndex(b:NERDLeft, line)
+    let indxLeftAlt = s:FindDelimiterIndex(b:NERDLeftAlt, line)
     let indxLeftPlace = s:FindDelimiterIndex(g:NERDLPlace, line)
 
     let indxRightPlace = s:FindDelimiterIndex(g:NERDRPlace, line)
-    let indxRightAlt = s:FindDelimiterIndex(b:rightAlt, line)
+    let indxRightAlt = s:FindDelimiterIndex(b:NERDRightAlt, line)
     let indxRightPlace = s:FindDelimiterIndex(g:NERDRPlace, line)
 
-    let right = b:right
-    let left = b:left
+    let right = b:NERDRight
+    let left = b:NERDLeft
     if !s:Multipart()
-        let right = b:rightAlt
-        let left = b:leftAlt
+        let right = b:NERDRightAlt
+        let left = b:NERDLeftAlt
     endif
 
 
@@ -2008,7 +1791,7 @@ function s:AddLeftDelimAligned(delim, theLine, alignIndx)
     &quot;so we can align the delim properly
     let theLine = a:theLine
     if strlen(theLine) &lt; a:alignIndx
-        let theLine = strpart(s:spaces, 0, a:alignIndx - strlen(theLine))
+        let theLine = repeat(' ', a:alignIndx - strlen(theLine))
     endif
 
     return strpart(theLine, 0, a:alignIndx) . a:delim . strpart(theLine, a:alignIndx)
@@ -2035,7 +1818,7 @@ function s:AddRightDelimAligned(delim, theLine, alignIndx)
         &quot; so we get a string containing the needed spaces (it
         &quot; could be empty)
         let extraSpaces = ''
-        let extraSpaces = strpart(s:spaces, 0, a:alignIndx-strlen(a:theLine))
+        let extraSpaces = repeat(' ', a:alignIndx-strlen(a:theLine))
 
         &quot; add the right delim
         return substitute(a:theLine, '$', extraSpaces . a:delim, '')
@@ -2045,7 +1828,7 @@ endfunction
 &quot; Function: s:AltMultipart() {{{2
 &quot; returns 1 if the alternative delims are multipart
 function s:AltMultipart()
-    return b:rightAlt != ''
+    return b:NERDRightAlt != ''
 endfunction
 
 &quot; Function: s:CanCommentLine(forceNested, line) {{{2
@@ -2116,7 +1899,7 @@ endfunction
 &quot;   -lineNum: the line num of the line to check for commentability
 function s:CanToggleCommentLine(forceNested, lineNum)
     let theLine = getline(a:lineNum)
-    if (s:IsCommentedFromStartOfLine(b:left, theLine) || s:IsCommentedFromStartOfLine(b:leftAlt, theLine)) &amp;&amp; !a:forceNested
+    if (s:IsCommentedFromStartOfLine(b:NERDLeft, theLine) || s:IsCommentedFromStartOfLine(b:NERDLeftAlt, theLine)) &amp;&amp; !a:forceNested
         return 0
     endif
 
@@ -2236,9 +2019,9 @@ endfunction
 function s:DoesBlockHaveMultipartDelim(top, bottom)
     if s:HasMultipartDelims()
         if s:Multipart()
-            return s:DoesBlockHaveDelim(b:left, a:top, a:bottom) || s:DoesBlockHaveDelim(b:right, a:top, a:bottom)
+            return s:DoesBlockHaveDelim(b:NERDLeft, a:top, a:bottom) || s:DoesBlockHaveDelim(b:NERDRight, a:top, a:bottom)
         else
-            return s:DoesBlockHaveDelim(b:leftAlt, a:top, a:bottom) || s:DoesBlockHaveDelim(b:rightAlt, a:top, a:bottom)
+            return s:DoesBlockHaveDelim(b:NERDLeftAlt, a:top, a:bottom) || s:DoesBlockHaveDelim(b:NERDRightAlt, a:top, a:bottom)
         endif
     endif
     return 0
@@ -2388,13 +2171,13 @@ endfunction
 &quot;    (the space string will only be added if NERDSpaceDelims is set)
 &quot;   -esc: specifies whether the tricky chars in the delim should be ESCed
 function s:GetLeft(alt, space, esc)
-    let delim = b:left
+    let delim = b:NERDLeft
 
     if a:alt
-        if b:leftAlt == ''
+        if b:NERDLeftAlt == ''
             return ''
         else
-            let delim = b:leftAlt
+            let delim = b:NERDLeftAlt
         endif
     endif
     if delim == ''
@@ -2420,13 +2203,13 @@ endfunction
 &quot;   (the space string will only be added if NERDSpaceDelims is set)
 &quot;   -esc: specifies whether the tricky chars in the delim should be ESCed
 function s:GetRight(alt, space, esc)
-    let delim = b:right
+    let delim = b:NERDRight
 
     if a:alt
         if !s:AltMultipart()
             return ''
         else
-            let delim = b:rightAlt
+            let delim = b:NERDRightAlt
         endif
     endif
     if delim == ''
@@ -2457,7 +2240,7 @@ endfunction
 &quot;    (the space string will only be added if NERDSpaceDelims is set)
 &quot;   -esc: specifies whether the tricky chars in the marker are to be ESCed
 function s:GetSexyComMarker(space, esc)
-    let sexyComMarker = b:sexyComMarker
+    let sexyComMarker = b:NERDSexyComMarker
 
     &quot;if there is no hardcoded marker then we find one
     if sexyComMarker == ''
@@ -2469,14 +2252,14 @@ function s:GetSexyComMarker(space, esc)
         else
             &quot;find a comment marker by getting the longest available left delim
             &quot;(that has a corresponding right delim) and taking the last char
-            let lenLeft = strlen(b:left)
-            let lenLeftAlt = strlen(b:leftAlt)
+            let lenLeft = strlen(b:NERDLeft)
+            let lenLeftAlt = strlen(b:NERDLeftAlt)
             let left = ''
             let right = ''
             if s:Multipart() &amp;&amp; lenLeft &gt;= lenLeftAlt
-                let left = b:left
+                let left = b:NERDLeft
             elseif s:AltMultipart()
-                let left = b:leftAlt
+                let left = b:NERDLeftAlt
             else
                 return -1
             endif
@@ -2505,8 +2288,8 @@ endfunction
 &quot;   (the space string will only be added if NERDSpaceDelims is set)
 &quot;   -esc: specifies whether the tricky chars in the string are ESCed
 function s:GetSexyComLeft(space, esc)
-    let lenLeft = strlen(b:left)
-    let lenLeftAlt = strlen(b:leftAlt)
+    let lenLeft = strlen(b:NERDLeft)
+    let lenLeftAlt = strlen(b:NERDLeftAlt)
     let left = ''
 
     &quot;assume c style sexy comments if possible
@@ -2515,9 +2298,9 @@ function s:GetSexyComLeft(space, esc)
     else
         &quot;grab the longest left delim that has a right
         if s:Multipart() &amp;&amp; lenLeft &gt;= lenLeftAlt
-            let left = b:left
+            let left = b:NERDLeft
         elseif s:AltMultipart()
-            let left = b:leftAlt
+            let left = b:NERDLeftAlt
         else
             return -1
         endif
@@ -2543,8 +2326,8 @@ endfunction
 &quot;   is specified for the current filetype)
 &quot;   -esc: specifies whether the tricky chars in the string are ESCed
 function s:GetSexyComRight(space, esc)
-    let lenLeft = strlen(b:left)
-    let lenLeftAlt = strlen(b:leftAlt)
+    let lenLeft = strlen(b:NERDLeft)
+    let lenLeftAlt = strlen(b:NERDLeftAlt)
     let right = ''
 
     &quot;assume c style sexy comments if possible
@@ -2553,9 +2336,9 @@ function s:GetSexyComRight(space, esc)
     else
         &quot;grab the right delim that pairs with the longest left delim
         if s:Multipart() &amp;&amp; lenLeft &gt;= lenLeftAlt
-            let right = b:right
+            let right = b:NERDRight
         elseif s:AltMultipart()
-            let right = b:rightAlt
+            let right = b:NERDRightAlt
         else
             return -1
         endif
@@ -2591,7 +2374,7 @@ endfunction
 &quot; Function: s:HasCStyleComments() {{{2
 &quot; Returns 1 iff the current filetype has c style comment delimiters
 function s:HasCStyleComments()
-    return (b:left == '/*' &amp;&amp; b:right == '*/') || (b:leftAlt == '/*' &amp;&amp; b:rightAlt == '*/')
+    return (b:NERDLeft == '/*' &amp;&amp; b:NERDRight == '*/') || (b:NERDLeftAlt == '/*' &amp;&amp; b:NERDRightAlt == '*/')
 endfunction
 
 &quot; Function: s:IsCommentedNormOrSexy(lineNum) {{{2
@@ -2604,7 +2387,7 @@ function s:IsCommentedNormOrSexy(lineNum)
     let theLine = getline(a:lineNum)
 
     &quot;if the line is commented normally return 1
-    if s:IsCommented(b:left, b:right, theLine) || s:IsCommented(b:leftAlt, b:rightAlt, theLine)
+    if s:IsCommented(b:NERDLeft, b:NERDRight, theLine) || s:IsCommented(b:NERDLeftAlt, b:NERDRightAlt, theLine)
         return 1
     endif
 
@@ -2820,11 +2603,11 @@ function s:IsSexyComment(topline, bottomline)
     let left = ''
     let right = ''
     if s:Multipart()
-        let left = b:left
-        let right = b:right
+        let left = b:NERDLeft
+        let right = b:NERDRight
     elseif s:AltMultipart()
-        let left = b:leftAlt
-        let right = b:rightAlt
+        let left = b:NERDLeftAlt
+        let right = b:NERDRightAlt
     else
         return 0
     endif
@@ -2949,7 +2732,7 @@ function s:LeftMostIndx(countCommentedLines, countEmptyLines, topline, bottomlin
         &quot; commented, check it
         let theLine = getline(currentLine)
         if a:countEmptyLines || theLine !~ '^[ \t]*$'
-            if a:countCommentedLines || (!s:IsCommented(b:left, b:right, theLine) &amp;&amp; !s:IsCommented(b:leftAlt, b:rightAlt, theLine))
+            if a:countCommentedLines || (!s:IsCommented(b:NERDLeft, b:NERDRight, theLine) &amp;&amp; !s:IsCommented(b:NERDLeftAlt, b:NERDRightAlt, theLine))
                 &quot; convert spaces to tabs and get the number of leading spaces for
                 &quot; this line and update leftMostIndx if need be
                 let theLine = s:ConvertLeadingTabsToSpaces(theLine)
@@ -2974,7 +2757,7 @@ endfunction
 &quot; Function: s:Multipart() {{{2
 &quot; returns 1 if the current delims are multipart
 function s:Multipart()
-    return b:right != ''
+    return b:NERDRight != ''
 endfunction
 
 &quot; Function: s:NerdEcho(msg, typeOfMsg) {{{2
@@ -3105,7 +2888,7 @@ function s:RightMostIndx(countCommentedLines, countEmptyLines, topline, bottomli
         let theLine = getline(currentLine)
         if a:countEmptyLines || theLine !~ '^[ \t]*$'
 
-            if a:countCommentedLines || (!s:IsCommented(b:left, b:right, theLine) &amp;&amp; !s:IsCommented(b:leftAlt, b:rightAlt, theLine))
+            if a:countCommentedLines || (!s:IsCommented(b:NERDLeft, b:NERDRight, theLine) &amp;&amp; !s:IsCommented(b:NERDLeftAlt, b:NERDRightAlt, theLine))
 
                 &quot; update rightMostIndx if need be
                 let theLine = s:ConvertLeadingTabsToSpaces(theLine)
@@ -3140,20 +2923,20 @@ endfunction
 function s:SwapOutterMultiPartDelimsForPlaceHolders(line)
     &quot; find out if the line is commented using normal delims and/or
     &quot; alternate ones
-    let isCommented = s:IsCommented(b:left, b:right, a:line)
-    let isCommentedAlt = s:IsCommented(b:leftAlt, b:rightAlt, a:line)
+    let isCommented = s:IsCommented(b:NERDLeft, b:NERDRight, a:line)
+    let isCommentedAlt = s:IsCommented(b:NERDLeftAlt, b:NERDRightAlt, a:line)
 
     let line2 = a:line
 
     &quot;if the line is commented and there is a right delimiter, replace
     &quot;the delims with place-holders
     if isCommented &amp;&amp; s:Multipart()
-        let line2 = s:ReplaceDelims(b:left, b:right, g:NERDLPlace, g:NERDRPlace, a:line)
+        let line2 = s:ReplaceDelims(b:NERDLeft, b:NERDRight, g:NERDLPlace, g:NERDRPlace, a:line)
 
     &quot;similarly if the line is commented with the alternative
     &quot;delimiters
     elseif isCommentedAlt &amp;&amp; s:AltMultipart()
-        let line2 = s:ReplaceDelims(b:leftAlt, b:rightAlt, g:NERDLPlace, g:NERDRPlace, a:line)
+        let line2 = s:ReplaceDelims(b:NERDLeftAlt, b:NERDRightAlt, g:NERDLPlace, g:NERDRPlace, a:line)
     endif
 
     return line2
@@ -3169,11 +2952,11 @@ function s:SwapOutterPlaceHoldersForMultiPartDelims(line)
     let left = ''
     let right = ''
     if s:Multipart()
-        let left = b:left
-        let right = b:right
+        let left = b:NERDLeft
+        let right = b:NERDRight
     elseif s:AltMultipart()
-        let left = b:leftAlt
-        let right = b:rightAlt
+        let left = b:NERDLeftAlt
+        let right = b:NERDRightAlt
     endif
 
     let line = s:ReplaceDelims(g:NERDLPlace, g:NERDRPlace, left, right, a:line)</diff>
      <filename>plugin/NERD_commenter.vim</filename>
    </modified>
    <modified>
      <diff>@@ -2,7 +2,7 @@
 &quot; File:        NERD_tree.vim
 &quot; Description: vim global plugin that provides a nice tree explorer
 &quot; Maintainer:  Martin Grenfell &lt;martin_grenfell at msn dot com&gt;
-&quot; Last Change: 27 Jan, 2009
+&quot; Last Change: 7 Jun, 2009
 &quot; License:     This program is free software. It comes without any warranty,
 &quot;              to the extent permitted by applicable law. You can redistribute
 &quot;              it and/or modify it under the terms of the Do What The Fuck You
@@ -10,7 +10,7 @@
 &quot;              See http://sam.zoy.org/wtfpl/COPYING for more details.
 &quot;
 &quot; ============================================================================
-let s:NERD_tree_version = '3.1.0'
+let s:NERD_tree_version = '3.1.1'
 
 &quot; SECTION: Script init stuff {{{1
 &quot;============================================================
@@ -79,7 +79,9 @@ endif
 &quot;once here
 let s:NERDTreeSortStarIndex = index(g:NERDTreeSortOrder, '*')
 
-call s:initVariable(&quot;g:NERDTreeStatusline&quot;, &quot;%{b:NERDTreeRoot.path.strForOS(0)}&quot;)
+if !exists('g:NERDTreeStatusline')
+    let g:NERDTreeStatusline = &quot;%{b:NERDTreeRoot.path.str()}&quot;
+endif
 call s:initVariable(&quot;g:NERDTreeWinPos&quot;, &quot;left&quot;)
 call s:initVariable(&quot;g:NERDTreeWinSize&quot;, 31)
 
@@ -103,8 +105,7 @@ call s:initVariable(&quot;g:NERDTreeMapChdir&quot;, &quot;cd&quot;)
 call s:initVariable(&quot;g:NERDTreeMapCloseChildren&quot;, &quot;X&quot;)
 call s:initVariable(&quot;g:NERDTreeMapCloseDir&quot;, &quot;x&quot;)
 call s:initVariable(&quot;g:NERDTreeMapDeleteBookmark&quot;, &quot;D&quot;)
-call s:initVariable(&quot;g:NERDTreeMapExecute&quot;, &quot;!&quot;)
-call s:initVariable(&quot;g:NERDTreeMapFilesystemMenu&quot;, &quot;m&quot;)
+call s:initVariable(&quot;g:NERDTreeMapMenu&quot;, &quot;m&quot;)
 call s:initVariable(&quot;g:NERDTreeMapHelp&quot;, &quot;?&quot;)
 call s:initVariable(&quot;g:NERDTreeMapJumpFirstChild&quot;, &quot;K&quot;)
 call s:initVariable(&quot;g:NERDTreeMapJumpLastChild&quot;, &quot;J&quot;)
@@ -128,6 +129,7 @@ call s:initVariable(&quot;g:NERDTreeMapToggleBookmarks&quot;, &quot;B&quot;)
 call s:initVariable(&quot;g:NERDTreeMapToggleFiles&quot;, &quot;F&quot;)
 call s:initVariable(&quot;g:NERDTreeMapToggleFilters&quot;, &quot;f&quot;)
 call s:initVariable(&quot;g:NERDTreeMapToggleHidden&quot;, &quot;I&quot;)
+call s:initVariable(&quot;g:NERDTreeMapToggleZoom&quot;, &quot;A&quot;)
 call s:initVariable(&quot;g:NERDTreeMapUpdir&quot;, &quot;u&quot;)
 call s:initVariable(&quot;g:NERDTreeMapUpdirKeepOpen&quot;, &quot;U&quot;)
 
@@ -139,11 +141,6 @@ let s:tree_wid = 2
 let s:tree_markup_reg = '^[ `|]*[\-+~]'
 let s:tree_up_dir_line = '.. (up a dir)'
 
-let s:os_slash = '/'
-if s:running_windows
-    let s:os_slash = '\'
-endif
-
 &quot;the number to add to the nerd tree buffer name to make the buf name unique
 let s:next_buffer_number = 1
 
@@ -154,7 +151,7 @@ command! -n=? -complete=dir -bar NERDTree :call s:initNerdTree('&lt;args&gt;')
 command! -n=? -complete=dir -bar NERDTreeToggle :call s:toggle('&lt;args&gt;')
 command! -n=0 -bar NERDTreeClose :call s:closeTreeIfOpen()
 command! -n=1 -complete=customlist,s:completeBookmarks -bar NERDTreeFromBookmark call s:initNerdTree('&lt;args&gt;')
-command! -n=0 -complete=customlist,s:completeNERDTreeMirrors -bar NERDTreeMirror call s:initNerdTreeMirror()
+command! -n=0 -bar NERDTreeMirror call s:initNerdTreeMirror()
 &quot; SECTION: Auto commands {{{1
 &quot;============================================================
 augroup NERDTree
@@ -162,6 +159,9 @@ augroup NERDTree
     exec &quot;autocmd BufWinLeave *&quot;. s:NERDTreeBufName .&quot; call &lt;SID&gt;saveScreenState()&quot;
     &quot;cache bookmarks when vim loads
     autocmd VimEnter * call s:Bookmark.CacheBookmarks(0)
+
+    &quot;load all nerdtree plugins after vim starts
+    autocmd VimEnter * runtime! nerdtree_plugin/**/*.vim
 augroup END
 
 if g:NERDTreeHijackNetrw
@@ -176,6 +176,17 @@ endif
 &quot;CLASS: Bookmark {{{2
 &quot;============================================================
 let s:Bookmark = {}
+&quot; FUNCTION: Bookmark.activate() {{{3
+function! s:Bookmark.activate()
+    if self.path.isDirectory
+        call self.toRoot()
+    else
+        if self.validate()
+            let n = s:TreeFileNode.New(self.path)
+            call n.open()
+        endif
+    endif
+endfunction
 &quot; FUNCTION: Bookmark.AddBookmark(name, path) {{{3
 &quot; Class method to add a new bookmark to the list, if a previous bookmark exists
 &quot; with the same name, just update the path for that bookmark
@@ -330,7 +341,7 @@ function! s:Bookmark.mustExist()
     if !self.path.exists()
         call s:Bookmark.CacheBookmarks(1)
         throw &quot;NERDTree.BookmarkPointsToInvalidLocationError: the bookmark \&quot;&quot;.
-            \ self.name .&quot;\&quot; points to a non existing location: \&quot;&quot;. self.path.strForOS(0)
+            \ self.name .&quot;\&quot; points to a non existing location: \&quot;&quot;. self.path.str()
     endif
 endfunction
 &quot; FUNCTION: Bookmark.New(name, path) {{{3
@@ -364,7 +375,7 @@ function! s:Bookmark.str()
         let pathStrMaxLen = pathStrMaxLen - &amp;numberwidth
     endif
 
-    let pathStr = self.path.strForOS(0)
+    let pathStr = self.path.str({'format': 'UI'})
     if len(pathStr) &gt; pathStrMaxLen
         let pathStr = '&lt;' . strpart(pathStr, len(pathStr) - pathStrMaxLen)
     endif
@@ -409,7 +420,7 @@ endfunction
 function! s:Bookmark.Write()
     let bookmarkStrings = []
     for i in s:Bookmark.Bookmarks()
-        call add(bookmarkStrings, i.name . ' ' . i.path.strForOS(0))
+        call add(bookmarkStrings, i.name . ' ' . i.path.str())
     endfor
 
     &quot;add a blank line before the invalid ones
@@ -420,12 +431,341 @@ function! s:Bookmark.Write()
     endfor
     call writefile(bookmarkStrings, g:NERDTreeBookmarksFile)
 endfunction
+&quot;CLASS: KeyMap {{{2
+&quot;============================================================
+let s:KeyMap = {}
+&quot;FUNCTION: KeyMap.All() {{{3
+function! s:KeyMap.All()
+    if !exists(&quot;s:keyMaps&quot;)
+        let s:keyMaps = []
+    endif
+    return s:keyMaps
+endfunction
+
+&quot;FUNCTION: KeyMap.BindAll() {{{3
+function! s:KeyMap.BindAll()
+    for i in s:KeyMap.All()
+        call i.bind()
+    endfor
+endfunction
+
+&quot;FUNCTION: KeyMap.bind() {{{3
+function! s:KeyMap.bind()
+    exec &quot;nnoremap &lt;silent&gt; &lt;buffer&gt; &quot;. self.key .&quot; :call &quot;. self.callback .&quot;()&lt;cr&gt;&quot;
+endfunction
+
+&quot;FUNCTION: KeyMap.Create(options) {{{3
+function! s:KeyMap.Create(options)
+    let newKeyMap = {}
+    let newKeyMap = copy(self)
+    let newKeyMap.key = a:options['key']
+    let newKeyMap.quickhelpText = a:options['quickhelpText']
+    let newKeyMap.callback = a:options['callback']
+    call add(s:KeyMap.All(), newKeyMap)
+endfunction
+&quot;CLASS: MenuController {{{2
+&quot;============================================================
+let s:MenuController = {}
+&quot;FUNCTION: MenuController.New(menuItems) {{{3
+&quot;create a new menu controller that operates on the given menu items
+function! s:MenuController.New(menuItems)
+    let newMenuController =  copy(self)
+    if a:menuItems[0].isSeparator()
+        let newMenuController.menuItems = a:menuItems[1:-1]
+    else
+        let newMenuController.menuItems = a:menuItems
+    endif
+    return newMenuController
+endfunction
+
+&quot;FUNCTION: MenuController.showMenu() {{{3
+&quot;start the main loop of the menu and get the user to choose/execute a menu
+&quot;item
+function! s:MenuController.showMenu()
+    call self._saveOptions()
+
+    try
+        let self.selection = 0
+
+        let done = 0
+        while !done
+            redraw!
+            call self._echoPrompt()
+            let key = nr2char(getchar())
+            let done = self._handleKeypress(key)
+        endwhile
+    finally
+        call self._restoreOptions()
+    endtry
+
+    if self.selection != -1
+        let m = self._current()
+        call m.execute()
+    endif
+endfunction
+
+&quot;FUNCTION: MenuController._echoPrompt() {{{3
+function! s:MenuController._echoPrompt()
+    echo &quot;NERDTree Menu. Use j/k/enter and the shortcuts indicated&quot;
+    echo &quot;==========================================================&quot;
+
+    for i in range(0, len(self.menuItems)-1)
+        if self.selection == i
+            echohl todo
+            echo &quot;&gt; &quot; . self.menuItems[i].text
+            echohl normal
+        else
+            echo &quot;  &quot; . self.menuItems[i].text
+        endif
+    endfor
+endfunction
+
+&quot;FUNCTION: MenuController._current(key) {{{3
+&quot;get the MenuItem that is curently selected
+function! s:MenuController._current()
+    return self.menuItems[self.selection]
+endfunction
+
+&quot;FUNCTION: MenuController._handleKeypress(key) {{{3
+&quot;change the selection (if appropriate) and return 1 if the user has made
+&quot;their choice, 0 otherwise
+function! s:MenuController._handleKeypress(key)
+    if a:key == 'j'
+        call self._cursorDown()
+    elseif a:key == 'k'
+        call self._cursorUp()
+    elseif a:key == nr2char(27) &quot;escape
+        let self.selection = -1
+        return 1
+    elseif a:key == &quot;\r&quot; || a:key == &quot;\n&quot; &quot;enter and ctrl-j
+        return 1
+    else
+        let index = self._nextIndexFor(a:key)
+        if index != -1
+            let self.selection = index
+            if len(self._allIndexesFor(a:key)) == 1
+                return 1
+            endif
+        endif
+    endif
+
+    return 0
+endfunction
+
+&quot;FUNCTION: MenuController._allIndexesFor(shortcut) {{{3
+&quot;get indexes to all menu items with the given shortcut
+function! s:MenuController._allIndexesFor(shortcut)
+    let toReturn = []
+
+    for i in range(0, len(self.menuItems)-1)
+        if self.menuItems[i].shortcut == a:shortcut
+            call add(toReturn, i)
+        endif
+    endfor
+
+    return toReturn
+endfunction
+
+&quot;FUNCTION: MenuController._nextIndexFor(shortcut) {{{3
+&quot;get the index to the next menu item with the given shortcut, starts from the
+&quot;current cursor location and wraps around to the top again if need be
+function! s:MenuController._nextIndexFor(shortcut)
+    for i in range(self.selection+1, len(self.menuItems)-1)
+        if self.menuItems[i].shortcut == a:shortcut
+            return i
+        endif
+    endfor
+
+    for i in range(0, self.selection)
+        if self.menuItems[i].shortcut == a:shortcut
+            return i
+        endif
+    endfor
+
+    return -1
+endfunction
+
+&quot;FUNCTION: MenuController._setCmdheight() {{{3
+&quot;sets &amp;cmdheight to whatever is needed to display the menu
+function! s:MenuController._setCmdheight()
+    let &amp;cmdheight = len(self.menuItems) + 3
+endfunction
+
+&quot;FUNCTION: MenuController._saveOptions() {{{3
+&quot;set any vim options that are required to make the menu work (saving their old
+&quot;values)
+function! s:MenuController._saveOptions()
+    let self._oldLazyredraw = &amp;lazyredraw
+    let self._oldCmdheight = &amp;cmdheight
+    set nolazyredraw
+    call self._setCmdheight()
+endfunction
+
+&quot;FUNCTION: MenuController._restoreOptions() {{{3
+&quot;restore the options we saved in _saveOptions()
+function! s:MenuController._restoreOptions()
+    let &amp;cmdheight = self._oldCmdheight
+    let &amp;lazyredraw = self._oldLazyredraw
+endfunction
+
+&quot;FUNCTION: MenuController._cursorDown() {{{3
+&quot;move the cursor to the next menu item, skipping separators
+function! s:MenuController._cursorDown()
+    let done = 0
+    while !done
+        if self.selection &lt; len(self.menuItems)-1
+            let self.selection += 1
+        else
+            let self.selection = 0
+        endif
+
+        if !self._current().isSeparator()
+            let done = 1
+        endif
+    endwhile
+endfunction
+
+&quot;FUNCTION: MenuController._cursorUp() {{{3
+&quot;move the cursor to the previous menu item, skipping separators
+function! s:MenuController._cursorUp()
+    let done = 0
+    while !done
+        if self.selection &gt; 0
+            let self.selection -= 1
+        else
+            let self.selection = len(self.menuItems)-1
+        endif
+
+        if !self._current().isSeparator()
+            let done = 1
+        endif
+    endwhile
+endfunction
+
+&quot;CLASS: MenuItem {{{2
+&quot;============================================================
+let s:MenuItem = {}
+&quot;FUNCTION: MenuItem.All() {{{3
+&quot;get all top level menu items
+function! s:MenuItem.All()
+    if !exists(&quot;s:menuItems&quot;)
+        let s:menuItems = []
+    endif
+    return s:menuItems
+endfunction
+
+&quot;FUNCTION: MenuItem.AllEnabled() {{{3
+&quot;get all top level menu items that are currently enabled
+function! s:MenuItem.AllEnabled()
+    let toReturn = []
+    for i in s:MenuItem.All()
+        if i.enabled()
+            call add(toReturn, i)
+        endif
+    endfor
+    return toReturn
+endfunction
+
+&quot;FUNCTION: MenuItem.Create(options) {{{3
+&quot;make a new menu item and add it to the global list
+function! s:MenuItem.Create(options)
+    let newMenuItem = copy(self)
+
+    let newMenuItem.text = a:options['text']
+    let newMenuItem.shortcut = a:options['shortcut']
+    let newMenuItem.children = []
+
+    let newMenuItem.isActiveCallback = -1
+    if has_key(a:options, 'isActiveCallback')
+        let newMenuItem.isActiveCallback = a:options['isActiveCallback']
+    endif
+
+    let newMenuItem.callback = -1
+    if has_key(a:options, 'callback')
+        let newMenuItem.callback = a:options['callback']
+    endif
+
+    if has_key(a:options, 'parent')
+        call add(a:options['parent'].children, newMenuItem)
+    else
+        call add(s:MenuItem.All(), newMenuItem)
+    endif
+
+    return newMenuItem
+endfunction
+
+&quot;FUNCTION: MenuItem.CreateSeparator(options) {{{3
+&quot;make a new separator menu item and add it to the global list
+function! s:MenuItem.CreateSeparator(options)
+    let standard_options = { 'text': '--------------------',
+                \ 'shortcut': -1,
+                \ 'callback': -1 }
+    let options = extend(a:options, standard_options, &quot;force&quot;)
+
+    return s:MenuItem.Create(options)
+endfunction
+
+&quot;FUNCTION: MenuItem.CreateSubmenu(options) {{{3
+&quot;make a new submenu and add it to global list
+function! s:MenuItem.CreateSubmenu(options)
+    let standard_options = { 'callback': -1 }
+    let options = extend(a:options, standard_options, &quot;force&quot;)
+
+    return s:MenuItem.Create(options)
+endfunction
+
+&quot;FUNCTION: MenuItem.enabled() {{{3
+&quot;return 1 if this menu item should be displayed
+&quot;
+&quot;delegates off to the isActiveCallback, and defaults to 1 if no callback was
+&quot;specified
+function! s:MenuItem.enabled()
+    if self.isActiveCallback != -1
+        return {self.isActiveCallback}()
+    endif
+    return 1
+endfunction
+
+&quot;FUNCTION: MenuItem.execute() {{{3
+&quot;perform the action behind this menu item, if this menuitem has children then
+&quot;display a new menu for them, otherwise deletegate off to the menuitem's
+&quot;callback
+function! s:MenuItem.execute()
+    if len(self.children)
+        let mc = s:MenuController.New(self.children)
+        call mc.showMenu()
+    else
+        if self.callback != -1
+            call {self.callback}()
+        endif
+    endif
+endfunction
+
+&quot;FUNCTION: MenuItem.isSeparator() {{{3
+&quot;return 1 if this menuitem is a separator
+function! s:MenuItem.isSeparator()
+    return self.callback == -1 &amp;&amp; self.children == []
+endfunction
+
+&quot;FUNCTION: MenuItem.isSubmenu() {{{3
+&quot;return 1 if this menuitem is a submenu
+function! s:MenuItem.isSubmenu()
+    return self.callback == -1 &amp;&amp; !empty(self.children)
+endfunction
+
 &quot;CLASS: TreeFileNode {{{2
 &quot;This class is the parent of the TreeDirNode class and constitures the
 &quot;'Component' part of the composite design pattern between the treenode
 &quot;classes.
 &quot;============================================================
 let s:TreeFileNode = {}
+&quot;FUNCTION: TreeFileNode.activate(forceKeepWinOpen) {{{3
+function! s:TreeFileNode.activate(forceKeepWinOpen)
+    call self.open()
+    if !a:forceKeepWinOpen
+        call s:closeTreeIfQuitOnOpen()
+    end
+endfunction
 &quot;FUNCTION: TreeFileNode.bookmark(name) {{{3
 &quot;bookmark this node with a:name
 function! s:TreeFileNode.bookmark(name)
@@ -489,83 +829,17 @@ function! s:TreeFileNode.delete()
     call self.parent.removeChild(self)
 endfunction
 
-&quot;FUNCTION: TreeFileNode.renderToString {{{3
-&quot;returns a string representation for this tree to be rendered in the view
-function! s:TreeFileNode.renderToString()
-    return self._renderToString(0, 0, [], self.getChildCount() ==# 1)
+&quot;FUNCTION: TreeFileNode.displayString() {{{3
+&quot;
+&quot;Returns a string that specifies how the node should be represented as a
+&quot;string
+&quot;
+&quot;Return:
+&quot;a string that can be used in the view to represent this node
+function! s:TreeFileNode.displayString()
+    return self.path.displayString()
 endfunction
 
-
-&quot;Args:
-&quot;depth: the current depth in the tree for this call
-&quot;drawText: 1 if we should actually draw the line for this node (if 0 then the
-&quot;child nodes are rendered only)
-&quot;vertMap: a binary array that indicates whether a vertical bar should be draw
-&quot;for each depth in the tree
-&quot;isLastChild:true if this curNode is the last child of its parent
-function! s:TreeFileNode._renderToString(depth, drawText, vertMap, isLastChild)
-    let output = &quot;&quot;
-    if a:drawText ==# 1
-
-        let treeParts = ''
-
-        &quot;get all the leading spaces and vertical tree parts for this line
-        if a:depth &gt; 1
-            for j in a:vertMap[0:-2]
-                if j ==# 1
-                    let treeParts = treeParts . '| '
-                else
-                    let treeParts = treeParts . '  '
-                endif
-            endfor
-        endif
-
-        &quot;get the last vertical tree part for this line which will be different
-        &quot;if this node is the last child of its parent
-        if a:isLastChild
-            let treeParts = treeParts . '`'
-        else
-            let treeParts = treeParts . '|'
-        endif
-
-
-        &quot;smack the appropriate dir/file symbol on the line before the file/dir
-        &quot;name itself
-        if self.path.isDirectory
-            if self.isOpen
-                let treeParts = treeParts . '~'
-            else
-                let treeParts = treeParts . '+'
-            endif
-        else
-            let treeParts = treeParts . '-'
-        endif
-        let line = treeParts . self.strDisplay()
-
-        let output = output . line . &quot;\n&quot;
-    endif
-
-    &quot;if the node is an open dir, draw its children
-    if self.path.isDirectory ==# 1 &amp;&amp; self.isOpen ==# 1
-
-        let childNodesToDraw = self.getVisibleChildren()
-        if len(childNodesToDraw) &gt; 0
-
-            &quot;draw all the nodes children except the last
-            let lastIndx = len(childNodesToDraw)-1
-            if lastIndx &gt; 0
-                for i in childNodesToDraw[0:lastIndx-1]
-                    let output = output . i._renderToString(a:depth + 1, 1, add(copy(a:vertMap), 1), 0)
-                endfor
-            endif
-
-            &quot;draw the last child, indicating that it IS the last
-            let output = output . childNodesToDraw[lastIndx]._renderToString(a:depth + 1, 1, add(copy(a:vertMap), 0), 1)
-        endif
-    endif
-
-    return output
-endfunction
 &quot;FUNCTION: TreeFileNode.equals(treenode) {{{3
 &quot;
 &quot;Compares this treenode to the input treenode and returns 1 if they are the
@@ -577,7 +851,7 @@ endfunction
 &quot;Args:
 &quot;treenode: the other treenode to compare to
 function! s:TreeFileNode.equals(treenode)
-    return self.path.str(1) ==# a:treenode.path.str(1)
+    return self.path.str() ==# a:treenode.path.str()
 endfunction
 
 &quot;FUNCTION: TreeFileNode.findNode(path) {{{3
@@ -667,11 +941,11 @@ function! s:TreeFileNode.getLineNum()
     let totalLines = line(&quot;$&quot;)
 
     &quot;the path components we have matched so far
-    let pathcomponents = [substitute(b:NERDTreeRoot.path.str(0), '/ *$', '', '')]
+    let pathcomponents = [substitute(b:NERDTreeRoot.path.str({'format': 'UI'}), '/ *$', '', '')]
     &quot;the index of the component we are searching for
     let curPathComponent = 1
 
-    let fullpath = self.path.str(0)
+    let fullpath = self.path.str({'format': 'UI'})
 
 
     let lnum = s:TreeFileNode.GetRootLineNum()
@@ -758,7 +1032,7 @@ function! s:TreeFileNode.makeRoot()
 
     &quot;change dir to the dir of the new root if instructed to
     if g:NERDTreeChDirMode ==# 2
-        exec &quot;cd &quot; . b:NERDTreeRoot.path.strForEditCmd()
+        exec &quot;cd &quot; . b:NERDTreeRoot.path.str({'format': 'Edit'})
     endif
 endfunction
 &quot;FUNCTION: TreeFileNode.New(path) {{{3
@@ -786,29 +1060,29 @@ endfunction
 &quot;treenode: file node to open
 function! s:TreeFileNode.open()
     if b:NERDTreeType ==# &quot;secondary&quot;
-        exec 'edit ' . self.path.strForEditCmd()
+        exec 'edit ' . self.path.str({'format': 'Edit'})
         return
     endif
 
     &quot;if the file is already open in this tab then just stick the cursor in it
-    let winnr = bufwinnr('^' . self.path.strForOS(0) . '$')
+    let winnr = bufwinnr('^' . self.path.str() . '$')
     if winnr != -1
         call s:exec(winnr . &quot;wincmd w&quot;)
 
     else
-        if !s:isWindowUsable(winnr(&quot;#&quot;)) &amp;&amp; s:firstNormalWindow() ==# -1
+        if !s:isWindowUsable(winnr(&quot;#&quot;)) &amp;&amp; s:firstUsableWindow() ==# -1
             call self.openSplit()
         else
             try
                 if !s:isWindowUsable(winnr(&quot;#&quot;))
-                    call s:exec(s:firstNormalWindow() . &quot;wincmd w&quot;)
+                    call s:exec(s:firstUsableWindow() . &quot;wincmd w&quot;)
                 else
                     call s:exec('wincmd p')
                 endif
-                exec (&quot;edit &quot; . self.path.strForEditCmd())
+                exec (&quot;edit &quot; . self.path.str({'format': 'Edit'}))
             catch /^Vim\%((\a\+)\)\=:E37/
                 call s:putCursorInTreeWin()
-                throw &quot;NERDTree.FileAlreadyOpenAndModifiedError: &quot;. self.path.str(0) .&quot; is already open and modified.&quot;
+                throw &quot;NERDTree.FileAlreadyOpenAndModifiedError: &quot;. self.path.str() .&quot; is already open and modified.&quot;
             catch /^Vim\%((\a\+)\)\=:/
                 echo v:exception
             endtry
@@ -820,7 +1094,7 @@ endfunction
 function! s:TreeFileNode.openSplit()
 
     if b:NERDTreeType ==# &quot;secondary&quot;
-        exec &quot;split &quot; . self.path.strForEditCmd()
+        exec &quot;split &quot; . self.path.str({'format': 'Edit'})
         return
     endif
 
@@ -861,10 +1135,10 @@ function! s:TreeFileNode.openSplit()
 
     &quot; Open the new window
     try
-        exec(splitMode.&quot; sp &quot; . self.path.strForEditCmd())
+        exec(splitMode.&quot; sp &quot; . self.path.str({'format': 'Edit'}))
     catch /^Vim\%((\a\+)\)\=:E37/
         call s:putCursorInTreeWin()
-        throw &quot;NERDTree.FileAlreadyOpenAndModifiedError: &quot;. self.path.str(0) .&quot; is already open and modified.&quot;
+        throw &quot;NERDTree.FileAlreadyOpenAndModifiedError: &quot;. self.path.str() .&quot; is already open and modified.&quot;
     catch /^Vim\%((\a\+)\)\=:/
         &quot;do nothing
     endtry
@@ -885,7 +1159,7 @@ endfunction
 &quot;Open this node in a new vertical window
 function! s:TreeFileNode.openVSplit()
     if b:NERDTreeType ==# &quot;secondary&quot;
-        exec &quot;vnew &quot; . self.path.strForEditCmd()
+        exec &quot;vnew &quot; . self.path.str({'format': 'Edit'})
         return
     endif
 
@@ -895,7 +1169,7 @@ function! s:TreeFileNode.openVSplit()
     endif
 
     call s:exec(&quot;wincmd p&quot;)
-    exec &quot;vnew &quot; . self.path.strForEditCmd()
+    exec &quot;vnew &quot; . self.path.str({'format': 'Edit'})
 
     &quot;resize the nerd tree back to the original size
     call s:putCursorInTreeWin()
@@ -940,7 +1214,7 @@ function! s:TreeFileNode.rename(newName)
     call self.path.rename(newName)
     call self.parent.removeChild(self)
 
-    let parentPath = self.path.getPathTrunk()
+    let parentPath = self.path.getParent()
     let newParent = b:NERDTreeRoot.findNode(parentPath)
 
     if newParent != {}
@@ -948,17 +1222,83 @@ function! s:TreeFileNode.rename(newName)
         call newParent.refresh()
     endif
 endfunction
-&quot;FUNCTION: TreeFileNode.strDisplay() {{{3
-&quot;
-&quot;Returns a string that specifies how the node should be represented as a
-&quot;string
-&quot;
-&quot;Return:
-&quot;a string that can be used in the view to represent this node
-function! s:TreeFileNode.strDisplay()
-    return self.path.strDisplay()
+&quot;FUNCTION: TreeFileNode.renderToString {{{3
+&quot;returns a string representation for this tree to be rendered in the view
+function! s:TreeFileNode.renderToString()
+    return self._renderToString(0, 0, [], self.getChildCount() ==# 1)
 endfunction
 
+
+&quot;Args:
+&quot;depth: the current depth in the tree for this call
+&quot;drawText: 1 if we should actually draw the line for this node (if 0 then the
+&quot;child nodes are rendered only)
+&quot;vertMap: a binary array that indicates whether a vertical bar should be draw
+&quot;for each depth in the tree
+&quot;isLastChild:true if this curNode is the last child of its parent
+function! s:TreeFileNode._renderToString(depth, drawText, vertMap, isLastChild)
+    let output = &quot;&quot;
+    if a:drawText ==# 1
+
+        let treeParts = ''
+
+        &quot;get all the leading spaces and vertical tree parts for this line
+        if a:depth &gt; 1
+            for j in a:vertMap[0:-2]
+                if j ==# 1
+                    let treeParts = treeParts . '| '
+                else
+                    let treeParts = treeParts . '  '
+                endif
+            endfor
+        endif
+
+        &quot;get the last vertical tree part for this line which will be different
+        &quot;if this node is the last child of its parent
+        if a:isLastChild
+            let treeParts = treeParts . '`'
+        else
+            let treeParts = treeParts . '|'
+        endif
+
+
+        &quot;smack the appropriate dir/file symbol on the line before the file/dir
+        &quot;name itself
+        if self.path.isDirectory
+            if self.isOpen
+                let treeParts = treeParts . '~'
+            else
+                let treeParts = treeParts . '+'
+            endif
+        else
+            let treeParts = treeParts . '-'
+        endif
+        let line = treeParts . self.displayString()
+
+        let output = output . line . &quot;\n&quot;
+    endif
+
+    &quot;if the node is an open dir, draw its children
+    if self.path.isDirectory ==# 1 &amp;&amp; self.isOpen ==# 1
+
+        let childNodesToDraw = self.getVisibleChildren()
+        if len(childNodesToDraw) &gt; 0
+
+            &quot;draw all the nodes children except the last
+            let lastIndx = len(childNodesToDraw)-1
+            if lastIndx &gt; 0
+                for i in childNodesToDraw[0:lastIndx-1]
+                    let output = output . i._renderToString(a:depth + 1, 1, add(copy(a:vertMap), 1), 0)
+                endfor
+            endif
+
+            &quot;draw the last child, indicating that it IS the last
+            let output = output . childNodesToDraw[lastIndx]._renderToString(a:depth + 1, 1, add(copy(a:vertMap), 0), 1)
+        endif
+    endif
+
+    return output
+endfunction
 &quot;CLASS: TreeDirNode {{{2
 &quot;This class is a child of the TreeFileNode class and constitutes the
 &quot;'Composite' part of the composite design pattern between the treenode
@@ -974,6 +1314,13 @@ function! s:TreeDirNode.AbsoluteTreeRoot()
     endwhile
     return currentNode
 endfunction
+&quot;FUNCTION: TreeDirNode.activate(forceKeepWinOpen) {{{3
+unlet s:TreeDirNode.activate
+function! s:TreeDirNode.activate(forceKeepWinOpen)
+    call self.toggleOpen()
+    call s:renderView()
+    call self.putCursorHere(0, 0)
+endfunction
 &quot;FUNCTION: TreeDirNode.addChild(treenode, inOrder) {{{3
 &quot;Adds the given treenode to the list of children for this node
 &quot;
@@ -1032,7 +1379,7 @@ function! s:TreeDirNode.findNode(path)
     if a:path.equals(self.path)
         return self
     endif
-    if stridx(a:path.str(1), self.path.str(1), 0) ==# -1
+    if stridx(a:path.str(), self.path.str(), 0) ==# -1
         return {}
     endif
 
@@ -1061,7 +1408,7 @@ endfunction
 &quot;Args:
 &quot;path: a path object
 function! s:TreeDirNode.getChild(path)
-    if stridx(a:path.str(1), self.path.str(1), 0) ==# -1
+    if stridx(a:path.str(), self.path.str(), 0) ==# -1
         return {}
     endif
 
@@ -1097,7 +1444,7 @@ endfunction
 &quot;Args:
 &quot;path: a path object
 function! s:TreeDirNode.getChildIndex(path)
-    if stridx(a:path.str(1), self.path.str(1), 0) ==# -1
+    if stridx(a:path.str(), self.path.str(), 0) ==# -1
         return -1
     endif
 
@@ -1173,7 +1520,8 @@ function! s:TreeDirNode._initChildren(silent)
 
     &quot;get an array of all the files in the nodes dir
     let dir = self.path
-    let filesStr = globpath(dir.strForGlob(), '*') . &quot;\n&quot; . globpath(dir.strForGlob(), '.*')
+    let globDir = dir.str({'format': 'Glob'})
+    let filesStr = globpath(globDir, '*') . &quot;\n&quot; . globpath(globDir, '.*')
     let files = split(filesStr, &quot;\n&quot;)
 
     if !a:silent &amp;&amp; len(files) &gt; g:NERDTreeNotificationThreshold
@@ -1186,7 +1534,7 @@ function! s:TreeDirNode._initChildren(silent)
         &quot;filter out the .. and . directories
         &quot;Note: we must match .. AND ../ cos sometimes the globpath returns
         &quot;../ for path with strange chars (eg $)
-        if i !~ '\.\.\/\?$' &amp;&amp; i !~ '\.\/\?$'
+        if i !~ '\/\.\.\/\?$' &amp;&amp; i !~ '\/\.\/\?$'
 
             &quot;put the next file in a new node and attach it
             try
@@ -1254,7 +1602,7 @@ function! s:TreeDirNode.openExplorer()
         call s:exec('wincmd p')
         call self.openSplit()
     else
-        exec (&quot;silent edit &quot; . self.path.strForEditCmd())
+        exec (&quot;silent edit &quot; . self.path.str({'format': 'Edit'}))
     endif
 endfunction
 &quot;FUNCTION: TreeDirNode.openRecursively() {{{3
@@ -1300,10 +1648,14 @@ function! s:TreeDirNode.refresh()
         let newChildNodes = []
         let invalidFilesFound = 0
         let dir = self.path
-        let filesStr = globpath(dir.strForGlob(), '*') . &quot;\n&quot; . globpath(dir.strForGlob(), '.*')
+        let globDir = dir.str({'format': 'Glob'})
+        let filesStr = globpath(globDir, '*') . &quot;\n&quot; . globpath(globDir, '.*')
         let files = split(filesStr, &quot;\n&quot;)
         for i in files
-            if i !~ '\.\.$' &amp;&amp; i !~ '\.$'
+            &quot;filter out the .. and . directories
+            &quot;Note: we must match .. AND ../ cos sometimes the globpath returns
+            &quot;../ for path with strange chars (eg $)
+            if i !~ '\/\.\.\/\?$' &amp;&amp; i !~ '\/\.\/\?$'
 
                 try
                     &quot;create a new path and see if it exists in this nodes children
@@ -1407,7 +1759,7 @@ function! s:Path.AbsolutePathFor(str)
 
     let toReturn = a:str
     if prependCWD
-        let toReturn = getcwd() . s:os_slash . a:str
+        let toReturn = getcwd() . s:Path.Slash() . a:str
     endif
 
     return toReturn
@@ -1449,7 +1801,7 @@ endfunction
 function! s:Path.changeToDir()
     let dir = self.strForCd()
     if self.isDirectory ==# 0
-        let dir = self.getPathTrunk().strForCd()
+        let dir = self.getParent().strForCd()
     endif
 
     try
@@ -1549,10 +1901,10 @@ function! s:Path.copy(dest)
 
     let dest = s:Path.WinToUnixPath(a:dest)
 
-    let cmd = g:NERDTreeCopyCmd . &quot; &quot; . self.strForOS(0) . &quot; &quot; . dest
+    let cmd = g:NERDTreeCopyCmd . &quot; &quot; . self.str() . &quot; &quot; . dest
     let success = system(cmd)
     if success != 0
-        throw &quot;NERDTree.CopyError: Could not copy ''&quot;. self.strForOS(0) .&quot;'' to: '&quot; . a:dest . &quot;'&quot;
+        throw &quot;NERDTree.CopyError: Could not copy ''&quot;. self.str() .&quot;'' to: '&quot; . a:dest . &quot;'&quot;
     endif
 endfunction
 
@@ -1593,22 +1945,16 @@ endfunction
 function! s:Path.delete()
     if self.isDirectory
 
-        let cmd = &quot;&quot;
-        if s:running_windows
-            &quot;if we are runnnig windows then put quotes around the pathstring
-            let cmd = g:NERDTreeRemoveDirCmd . self.strForOS(1)
-        else
-            let cmd = g:NERDTreeRemoveDirCmd . self.strForOS(1)
-        endif
+        let cmd = g:NERDTreeRemoveDirCmd . self.str('escape': 1})
         let success = system(cmd)
 
         if v:shell_error != 0
-            throw &quot;NERDTree.PathDeletionError: Could not delete directory: '&quot; . self.strForOS(0) . &quot;'&quot;
+            throw &quot;NERDTree.PathDeletionError: Could not delete directory: '&quot; . self.str() . &quot;'&quot;
         endif
     else
-        let success = delete(self.strForOS(0))
+        let success = delete(self.str())
         if success != 0
-            throw &quot;NERDTree.PathDeletionError: Could not delete file: '&quot; . self.str(0) . &quot;'&quot;
+            throw &quot;NERDTree.PathDeletionError: Could not delete file: '&quot; . self.str() . &quot;'&quot;
         endif
     endif
 
@@ -1619,6 +1965,17 @@ function! s:Path.delete()
     endfor
 endfunction
 
+&quot;FUNCTION: Path.displayString() {{{3
+&quot;
+&quot;Returns a string that specifies how the path should be represented as a
+&quot;string
+function! s:Path.displayString()
+    if self.cachedDisplayString ==# &quot;&quot;
+        call self.cacheDisplayString()
+    endif
+
+    return self.cachedDisplayString
+endfunction
 &quot;FUNCTION: Path.extractDriveLetter(fullpath) {{{3
 &quot;
 &quot;If running windows, cache the drive letter for this path
@@ -1633,7 +1990,8 @@ endfunction
 &quot;FUNCTION: Path.exists() {{{3
 &quot;return 1 if this path points to a location that is readable or is a directory
 function! s:Path.exists()
-    return filereadable(self.strForOS(0)) || isdirectory(self.strForOS(0))
+    let p = self.str()
+    return filereadable(p) || isdirectory(p)
 endfunction
 &quot;FUNCTION: Path.getDir() {{{3
 &quot;
@@ -1676,12 +2034,6 @@ function! s:Path.getLastPathComponent(dirSlash)
     return toReturn
 endfunction
 
-&quot;FUNCTION: Path.getPathTrunk() {{{3
-&quot;Gets the path without the last segment on the end.
-function! s:Path.getPathTrunk()
-    return s:Path.New(self.strTrunk())
-endfunction
-
 &quot;FUNCTION: Path.getSortOrderIndex() {{{3
 &quot;returns the index of the pattern in g:NERDTreeSortOrder that this path matches
 function! s:Path.getSortOrderIndex()
@@ -1738,7 +2090,7 @@ endfunction
 &quot;Args:
 &quot;path: the other path obj to compare this with
 function! s:Path.equals(path)
-    return self.str(0) ==# a:path.str(0)
+    return self.str() ==# a:path.str()
 endfunction
 
 &quot;FUNCTION: Path.New() {{{3
@@ -1753,6 +2105,12 @@ function! s:Path.New(path)
     return newPath
 endfunction
 
+&quot;FUNCTION: Path.Slash() {{{3
+&quot;return the slash to use for the current OS
+function! s:Path.Slash()
+    return s:running_windows ? '\' : '/'
+endfunction
+
 &quot;FUNCTION: Path.readInfoFromDisk(fullpath) {{{3
 &quot;
 &quot;
@@ -1809,7 +2167,7 @@ endfunction
 
 &quot;FUNCTION: Path.refresh() {{{3
 function! s:Path.refresh()
-    call self.readInfoFromDisk(self.strForOS(0))
+    call self.readInfoFromDisk(self.str())
     call self.cacheDisplayString()
 endfunction
 
@@ -1821,9 +2179,9 @@ function! s:Path.rename(newPath)
         throw &quot;NERDTree.InvalidArgumentsError: Invalid newPath for renaming = &quot;. a:newPath
     endif
 
-    let success =  rename(self.strForOS(0), a:newPath)
+    let success =  rename(self.str(), a:newPath)
     if success != 0
-        throw &quot;NERDTree.PathRenameError: Could not rename: '&quot; . self.strForOS(0) . &quot;'&quot; . 'to:' . a:newPath
+        throw &quot;NERDTree.PathRenameError: Could not rename: '&quot; . self.str() . &quot;'&quot; . 'to:' . a:newPath
     endif
     call self.readInfoFromDisk(a:newPath)
 
@@ -1834,76 +2192,81 @@ function! s:Path.rename(newPath)
     call s:Bookmark.Write()
 endfunction
 
-&quot;FUNCTION: Path.str(esc) {{{3
+&quot;FUNCTION: Path.str() {{{3
 &quot;
-&quot;Gets the actual string path that this obj represents.
+&quot;Returns a string representation of this Path
 &quot;
-&quot;Args:
-&quot;esc: if 1 then all the tricky chars in the returned string will be escaped
-function! s:Path.str(esc)
-    let toReturn = '/' . join(self.pathSegments, '/')
-    if self.isDirectory &amp;&amp; toReturn != '/'
-        let toReturn  = toReturn . '/'
+&quot;Takes an optional dictionary param to specify how the output should be
+&quot;formatted.
+&quot;
+&quot;The dict may have the following keys:
+&quot;  'format'
+&quot;  'escape'
+&quot;
+&quot;The 'format' key may have a value of:
+&quot;  'Cd' - a string to be used with the :cd command
+&quot;  'Edit' - a string to be used with :e :sp :new :tabedit etc
+&quot;  'UI' - a string used in the NERD tree UI
+&quot;
+&quot;If not specified, a generic unix style path string will be returned
+&quot;
+&quot;The 'escape' key, if specified will cause the output to be escaped with
+&quot;shellescape()
+function! s:Path.str(...)
+    let options = a:0 ? a:1 : {}
+    let toReturn = &quot;&quot;
+
+    if has_key(options, 'format')
+        let format = options['format']
+        if has_key(self, '_strFor' . format)
+            exec 'let toReturn = self._strFor' . format . '()'
+        else
+            raise 'NERDTree.UnknownFormatError: unknown format &quot;'. format .'&quot;'
+        endif
+    else
+        let toReturn = self._str()
     endif
 
-    if a:esc
-        let toReturn = escape(toReturn, s:escape_chars)
+    if has_key(options, 'escape') &amp;&amp; options['escape']
+        let toReturn = shellescape(toReturn)
     endif
+
     return toReturn
 endfunction
 
-&quot;FUNCTION: Path.strAbs() {{{3
-&quot;
-&quot;Returns a string representing this path with all the symlinks resolved
-&quot;
-&quot;Return:
-&quot;string
-function! s:Path.strAbs()
-    return resolve(self.str(1))
+&quot;FUNCTION: Path._strForUI() {{{3
+function! s:Path._strForUI()
+    let toReturn = '/' . join(self.pathSegments, '/')
+    if self.isDirectory &amp;&amp; toReturn != '/'
+        let toReturn  = toReturn . '/'
+    endif
+    return toReturn
 endfunction
 
-&quot;FUNCTION: Path.strForCd() {{{3
+&quot;FUNCTION: Path._strForCd() {{{3
 &quot;
 &quot; returns a string that can be used with :cd
-&quot;
-&quot;Return:
-&quot;a string that can be used in the view to represent this path
-function! s:Path.strForCd()
+function! s:Path._strForCd()
     if s:running_windows
-        return self.strForOS(0)
+        return self.str()
     else
-        return self.strForOS(1)
+        return self.str({'escape': 1})
     endif
 endfunction
-&quot;FUNCTION: Path.strDisplay() {{{3
-&quot;
-&quot;Returns a string that specifies how the path should be represented as a
-&quot;string
-&quot;
-&quot;Return:
-&quot;a string that can be used in the view to represent this path
-function! s:Path.strDisplay()
-    if self.cachedDisplayString ==# &quot;&quot;
-        call self.cacheDisplayString()
-    endif
-
-    return self.cachedDisplayString
-endfunction
-
-&quot;FUNCTION: Path.strForEditCmd() {{{3
+&quot;FUNCTION: Path._strForEdit() {{{3
 &quot;
 &quot;Return: the string for this path that is suitable to be used with the :edit
 &quot;command
-function! s:Path.strForEditCmd()
-    let p = self.str(1)
+function! s:Path._strForEdit()
+    let p = self.str({'format': 'UI'})
     let cwd = getcwd()
 
     if s:running_windows
-        let p = tolower(self.strForOS(0))
+        let p = tolower(self.str())
         let cwd = tolower(getcwd())
     endif
 
-    let cwd = cwd . s:os_slash
+    let cwd = cwd . s:Path.Slash()
 
     &quot;return a relative path if we can
     if stridx(p, cwd) ==# 0
@@ -1917,49 +2280,36 @@ function! s:Path.strForEditCmd()
     return p
 
 endfunction
-&quot;FUNCTION: Path.strForGlob() {{{3
-function! s:Path.strForGlob()
-    let lead = s:os_slash
+&quot;FUNCTION: Path._strForGlob() {{{3
+function! s:Path._strForGlob()
+    let lead = s:Path.Slash()
 
     &quot;if we are running windows then slap a drive letter on the front
     if s:running_windows
         let lead = self.drive . '\'
     endif
 
-    let toReturn = lead . join(self.pathSegments, s:os_slash)
+    let toReturn = lead . join(self.pathSegments, s:Path.Slash())
 
     if !s:running_windows
         let toReturn = escape(toReturn, s:escape_chars)
     endif
     return toReturn
 endfunction
-&quot;FUNCTION: Path.strForOS(esc) {{{3
+&quot;FUNCTION: Path._str() {{{3
 &quot;
 &quot;Gets the string path for this path object that is appropriate for the OS.
 &quot;EG, in windows c:\foo\bar
 &quot;    in *nix  /foo/bar
-&quot;
-&quot;Args:
-&quot;esc: if 1 then all the tricky chars in the returned string will be
-&quot; escaped. If we are running windows then the str is double quoted instead.
-function! s:Path.strForOS(esc)
-    let lead = s:os_slash
+function! s:Path._str()
+    let lead = s:Path.Slash()
 
     &quot;if we are running windows then slap a drive letter on the front
     if s:running_windows
         let lead = self.drive . '\'
     endif
 
-    let toReturn = lead . join(self.pathSegments, s:os_slash)
-
-    if a:esc
-        if s:running_windows
-            let toReturn = '&quot;' .  toReturn . '&quot;'
-        else
-            let toReturn = escape(toReturn, s:escape_chars)
-        endif
-    endif
-    return toReturn
+    return lead . join(self.pathSegments, s:Path.Slash())
 endfunction
 
 &quot;FUNCTION: Path.strTrunk() {{{3
@@ -2057,7 +2407,7 @@ function! s:initNerdTree(name)
 
         &quot;hack to get an absolute path if a relative path is given
         if dir =~ '^\.'
-            let dir = getcwd() . s:os_slash . dir
+            let dir = getcwd() . s:Path.Slash() . dir
         endif
         let dir = resolve(dir)
 
@@ -2158,7 +2508,7 @@ function! s:initNerdTreeInPlace(dir)
     call s:bindMappings()
     setfiletype nerdtree
     &quot; syntax highlighting
-    if has(&quot;syntax&quot;) &amp;&amp; exists(&quot;g:syntax_on&quot;) &amp;&amp; !has(&quot;syntax_items&quot;)
+    if has(&quot;syntax&quot;) &amp;&amp; exists(&quot;g:syntax_on&quot;)
         call s:setupSyntaxHighlighting()
     endif
 
@@ -2184,7 +2534,7 @@ function! s:initNerdTreeMirror()
     while i &lt; len(treeBufNames)
         let bufName = treeBufNames[i]
         let treeRoot = getbufvar(bufName, &quot;NERDTreeRoot&quot;)
-        let options[i+1 . '. ' . treeRoot.path.strForOS(0) . '  (buf name: ' . bufName . ')'] = bufName
+        let options[i+1 . '. ' . treeRoot.path.str() . '  (buf name: ' . bufName . ')'] = bufName
         let i = i + 1
     endwhile
 
@@ -2262,45 +2612,32 @@ function! s:unique(list)
   endfor
   return uniqlist
 endfunction
-&quot; SECTION: Public Functions {{{1
+&quot; SECTION: Public API {{{1
 &quot;============================================================
-&quot;Returns the node that the cursor is currently on.
-&quot;
-&quot;If the cursor is not in the NERDTree window, it is temporarily put there.
-&quot;
-&quot;If no NERD tree window exists for the current tab, a NERDTree.NoTreeForTab
-&quot;exception is thrown.
-&quot;
-&quot;If the cursor is not on a node then an empty dictionary {} is returned.
-function! NERDTreeGetCurrentNode()
-    if !s:treeExistsForTab() || !s:isTreeOpen()
-        throw &quot;NERDTree.NoTreeForTabError: there is no NERD tree open for the current tab&quot;
-    endif
+let g:NERDTreePath = s:Path
+let g:NERDTreeDirNode = s:TreeDirNode
+let g:NERDTreeFileNode = s:TreeFileNode
+let g:NERDTreeBookmark = s:Bookmark
 
-    let winnr = winnr()
-    if winnr != s:getTreeWinNum()
-        call s:putCursorInTreeWin()
-    endif
+function! NERDTreeAddMenuItem(options)
+    call s:MenuItem.Create(a:options)
+endfunction
 
-    let treenode = s:TreeFileNode.GetSelected()
+function! NERDTreeAddMenuSeparator(...)
+    let opts = a:0 ? a:1 : {}
+    call s:MenuItem.CreateSeparator(opts)
+endfunction
 
-    if winnr != winnr()
-        call s:exec('wincmd w')
-    endif
+function! NERDTreeAddSubmenu(options)
+    return s:MenuItem.Create(a:options)
+endfunction
 
-    return treenode
+function! NERDTreeAddKeyMap(options)
+    call s:KeyMap.Create(a:options)
 endfunction
 
-&quot;Returns the path object for the current node.
-&quot;
-&quot;Subject to the same conditions as NERDTreeGetCurrentNode
-function! NERDTreeGetCurrentPath()
-    let node = NERDTreeGetCurrentNode()
-    if node != {}
-        return node.path
-    else
-        return {}
-    endif
+function! NERDTreeRender()
+    call s:renderView()
 endfunction
 
 &quot; SECTION: View Functions {{{1
@@ -2344,7 +2681,7 @@ endfunction
 &quot;FUNCTION: s:closeTreeIfQuitOnOpen() {{{2
 &quot;Closes the NERD tree window if the close on open option is set
 function! s:closeTreeIfQuitOnOpen()
-    if g:NERDTreeQuitOnOpen
+    if g:NERDTreeQuitOnOpen &amp;&amp; s:isTreeOpen()
         call s:closeTree()
     endif
 endfunction
@@ -2355,12 +2692,13 @@ function! s:createTreeWin()
     &quot;create the nerd tree window
     let splitLocation = g:NERDTreeWinPos ==# &quot;left&quot; ? &quot;topleft &quot; : &quot;botright &quot;
     let splitSize = g:NERDTreeWinSize
-    silent! exec splitLocation . 'vertical ' . splitSize . ' new'
 
     if !exists('t:NERDTreeBufName')
         let t:NERDTreeBufName = s:nextBufferName()
+        silent! exec splitLocation . 'vertical ' . splitSize . ' new'
         silent! exec &quot;edit &quot; . t:NERDTreeBufName
     else
+        silent! exec splitLocation . 'vertical ' . splitSize . ' split'
         silent! exec &quot;buffer &quot; . t:NERDTreeBufName
     endif
 
@@ -2390,7 +2728,7 @@ function! s:createTreeWin()
     call s:bindMappings()
     setfiletype nerdtree
     &quot; syntax highlighting
-    if has(&quot;syntax&quot;) &amp;&amp; exists(&quot;g:syntax_on&quot;) &amp;&amp; !has(&quot;syntax_items&quot;)
+    if has(&quot;syntax&quot;) &amp;&amp; exists(&quot;g:syntax_on&quot;)
         call s:setupSyntaxHighlighting()
     endif
 endfunction
@@ -2404,6 +2742,7 @@ function! s:dumpHelp()
         let @h=@h.&quot;\&quot; ============================\n&quot;
         let @h=@h.&quot;\&quot; File node mappings~\n&quot;
         let @h=@h.&quot;\&quot; &quot;. (g:NERDTreeMouseMode ==# 3 ? &quot;single&quot; : &quot;double&quot;) .&quot;-click,\n&quot;
+        let @h=@h.&quot;\&quot; &lt;CR&gt;,\n&quot;
         if b:NERDTreeType ==# &quot;primary&quot;
             let @h=@h.&quot;\&quot; &quot;. g:NERDTreeMapActivateNode .&quot;: open in prev window\n&quot;
         else
@@ -2419,7 +2758,6 @@ function! s:dumpHelp()
         let @h=@h.&quot;\&quot; &quot;. g:NERDTreeMapPreviewSplit .&quot;: preview split\n&quot;
         let @h=@h.&quot;\&quot; &quot;. g:NERDTreeMapOpenVSplit .&quot;: open vsplit\n&quot;
         let @h=@h.&quot;\&quot; &quot;. g:NERDTreeMapPreviewVSplit .&quot;: preview vsplit\n&quot;
-        let @h=@h.&quot;\&quot; &quot;. g:NERDTreeMapExecute.&quot;: Execute file\n&quot;
 
         let @h=@h.&quot;\&quot;\n\&quot; ----------------------------\n&quot;
         let @h=@h.&quot;\&quot; Directory node mappings~\n&quot;
@@ -2458,7 +2796,7 @@ function! s:dumpHelp()
         let @h=@h.&quot;\&quot;    but leave old root open\n&quot;
         let @h=@h.&quot;\&quot; &quot;. g:NERDTreeMapRefresh .&quot;: refresh cursor dir\n&quot;
         let @h=@h.&quot;\&quot; &quot;. g:NERDTreeMapRefreshRoot .&quot;: refresh current root\n&quot;
-        let @h=@h.&quot;\&quot; &quot;. g:NERDTreeMapFilesystemMenu .&quot;: Show filesystem menu\n&quot;
+        let @h=@h.&quot;\&quot; &quot;. g:NERDTreeMapMenu .&quot;: Show menu\n&quot;
         let @h=@h.&quot;\&quot; &quot;. g:NERDTreeMapChdir .&quot;:change the CWD to the\n&quot;
         let @h=@h.&quot;\&quot;    selected dir\n&quot;
 
@@ -2469,9 +2807,20 @@ function! s:dumpHelp()
         let @h=@h.&quot;\&quot; &quot;. g:NERDTreeMapToggleFiles .&quot;: files (&quot; . (b:NERDTreeShowFiles ? &quot;on&quot; : &quot;off&quot;) . &quot;)\n&quot;
         let @h=@h.&quot;\&quot; &quot;. g:NERDTreeMapToggleBookmarks .&quot;: bookmarks (&quot; . (b:NERDTreeShowBookmarks ? &quot;on&quot; : &quot;off&quot;) . &quot;)\n&quot;
 
+        &quot;add quickhelp entries for each custom key map
+        if len(s:KeyMap.All())
+            let @h=@h.&quot;\&quot;\n\&quot; ----------------------------\n&quot;
+            let @h=@h.&quot;\&quot; Custom mappings~\n&quot;
+            for i in s:KeyMap.All()
+                let @h=@h.&quot;\&quot; &quot;. i.key .&quot;: &quot;. i.quickhelpText .&quot;\n&quot;
+            endfor
+        endif
+
         let @h=@h.&quot;\&quot;\n\&quot; ----------------------------\n&quot;
         let @h=@h.&quot;\&quot; Other mappings~\n&quot;
         let @h=@h.&quot;\&quot; &quot;. g:NERDTreeMapQuit .&quot;: Close the NERDTree window\n&quot;
+        let @h=@h.&quot;\&quot; &quot;. g:NERDTreeMapToggleZoom .&quot;: Zoom (maximize-minimize)\n&quot;
+        let @h=@h.&quot;\&quot;    the NERDTree window\n&quot;
         let @h=@h.&quot;\&quot; &quot;. g:NERDTreeMapHelp .&quot;: toggle help\n&quot;
         let @h=@h.&quot;\&quot;\n\&quot; ----------------------------\n&quot;
         let @h=@h.&quot;\&quot; Bookmark commands~\n&quot;
@@ -2516,14 +2865,15 @@ function! s:echoError(msg)
     call s:echo(a:msg)
     echohl normal
 endfunction
-&quot;FUNCTION: s:firstNormalWindow(){{{2
+&quot;FUNCTION: s:firstUsableWindow(){{{2
 &quot;find the window number of the first normal window
-function! s:firstNormalWindow()
+function! s:firstUsableWindow()
     let i = 1
     while i &lt;= winnr(&quot;$&quot;)
         let bnum = winbufnr(i)
         if bnum != -1 &amp;&amp; getbufvar(bnum, '&amp;buftype') ==# ''
                     \ &amp;&amp; !getwinvar(i, '&amp;previewwindow')
+                    \ &amp;&amp; (!getbufvar(bnum, '&amp;modified') || &amp;hidden)
             return i
         endif
 
@@ -2630,8 +2980,8 @@ function! s:isTreeOpen()
     return s:getTreeWinNum() != -1
 endfunction
 &quot;FUNCTION: s:isWindowUsable(winnumber) {{{2
-&quot;Returns 1 if opening a file from the tree in the given window requires it to
-&quot;be split
+&quot;Returns 0 if opening a file from the tree in the given window requires it to
+&quot;be split, 1 otherwise
 &quot;
 &quot;Args:
 &quot;winnumber: the number of the window in question
@@ -2778,7 +3128,7 @@ function! s:renderView()
     call cursor(line(&quot;.&quot;)+1, col(&quot;.&quot;))
 
     &quot;draw the header line
-    call setline(line(&quot;.&quot;)+1, b:NERDTreeRoot.path.str(0))
+    call setline(line(&quot;.&quot;)+1, b:NERDTreeRoot.path.str({'format': 'UI'}))
     call cursor(line(&quot;.&quot;)+1, col(&quot;.&quot;))
 
     &quot;draw the tree
@@ -3025,26 +3375,11 @@ function! s:activateNode(forceKeepWindowOpen)
 
     let treenode = s:TreeFileNode.GetSelected()
     if treenode != {}
-        if treenode.path.isDirectory
-            call treenode.toggleOpen()
-            call s:renderView()
-            call treenode.putCursorHere(0, 0)
-        else
-            call treenode.open()
-            if !a:forceKeepWindowOpen
-                call s:closeTreeIfQuitOnOpen()
-            end
-        endif
+        call treenode.activate(a:forceKeepWindowOpen)
     else
         let bookmark = s:getSelectedBookmark()
         if !empty(bookmark)
-            if bookmark.path.isDirectory
-                call bookmark.toRoot()
-            else
-                if bookmark.validate()
-                    call (s:TreeFileNode.New(bookmark.path)).open()
-                endif
-            endif
+            call bookmark.activate()
         endif
     endif
 endfunction
@@ -3058,6 +3393,7 @@ function! s:bindMappings()
 
     exec &quot;nnoremap &lt;silent&gt; &lt;buffer&gt; &quot;. g:NERDTreeMapActivateNode . &quot; :call &lt;SID&gt;activateNode(0)&lt;cr&gt;&quot;
     exec &quot;nnoremap &lt;silent&gt; &lt;buffer&gt; &quot;. g:NERDTreeMapOpenSplit .&quot; :call &lt;SID&gt;openEntrySplit(0,0)&lt;cr&gt;&quot;
+    exec &quot;nnoremap &lt;silent&gt; &lt;buffer&gt; &lt;cr&gt; :call &lt;SID&gt;activateNode(0)&lt;cr&gt;&quot;
 
     exec &quot;nnoremap &lt;silent&gt; &lt;buffer&gt; &quot;. g:NERDTreeMapPreview .&quot; :call &lt;SID&gt;previewNode(0)&lt;cr&gt;&quot;
     exec &quot;nnoremap &lt;silent&gt; &lt;buffer&gt; &quot;. g:NERDTreeMapPreviewSplit .&quot; :call &lt;SID&gt;previewNode(1)&lt;cr&gt;&quot;
@@ -3065,8 +3401,6 @@ function! s:bindMappings()
     exec &quot;nnoremap &lt;silent&gt; &lt;buffer&gt; &quot;. g:NERDTreeMapOpenVSplit .&quot; :call &lt;SID&gt;openEntrySplit(1,0)&lt;cr&gt;&quot;
     exec &quot;nnoremap &lt;silent&gt; &lt;buffer&gt; &quot;. g:NERDTreeMapPreviewVSplit .&quot; :call &lt;SID&gt;previewNode(2)&lt;cr&gt;&quot;
 
-    exec &quot;nnoremap &lt;silent&gt; &lt;buffer&gt; &quot;. g:NERDTreeMapExecute .&quot; :call &lt;SID&gt;executeNode()&lt;cr&gt;&quot;
-
     exec &quot;nnoremap &lt;silent&gt; &lt;buffer&gt; &quot;. g:NERDTreeMapOpenRecursively .&quot; :call &lt;SID&gt;openNodeRecursively()&lt;cr&gt;&quot;
 
     exec &quot;nnoremap &lt;silent&gt; &lt;buffer&gt; &quot;. g:NERDTreeMapUpdirKeepOpen .&quot; :call &lt;SID&gt;upDir(1)&lt;cr&gt;&quot;
@@ -3081,6 +3415,7 @@ function! s:bindMappings()
     exec &quot;nnoremap &lt;silent&gt; &lt;buffer&gt; &quot;. g:NERDTreeMapRefresh .&quot; :call &lt;SID&gt;refreshCurrent()&lt;cr&gt;&quot;
 
     exec &quot;nnoremap &lt;silent&gt; &lt;buffer&gt; &quot;. g:NERDTreeMapHelp .&quot; :call &lt;SID&gt;displayHelp()&lt;cr&gt;&quot;
+    exec &quot;nnoremap &lt;silent&gt; &lt;buffer&gt; &quot;. g:NERDTreeMapToggleZoom .&quot; :call &lt;SID&gt;toggleZoom()&lt;cr&gt;&quot;
     exec &quot;nnoremap &lt;silent&gt; &lt;buffer&gt; &quot;. g:NERDTreeMapToggleHidden .&quot; :call &lt;SID&gt;toggleShowHidden()&lt;cr&gt;&quot;
     exec &quot;nnoremap &lt;silent&gt; &lt;buffer&gt; &quot;. g:NERDTreeMapToggleFilters .&quot; :call &lt;SID&gt;toggleIgnoreFilter()&lt;cr&gt;&quot;
     exec &quot;nnoremap &lt;silent&gt; &lt;buffer&gt; &quot;. g:NERDTreeMapToggleFiles .&quot; :call &lt;SID&gt;toggleShowFiles()&lt;cr&gt;&quot;
@@ -3089,7 +3424,7 @@ function! s:bindMappings()
     exec &quot;nnoremap &lt;silent&gt; &lt;buffer&gt; &quot;. g:NERDTreeMapCloseDir .&quot; :call &lt;SID&gt;closeCurrentDir()&lt;cr&gt;&quot;
     exec &quot;nnoremap &lt;silent&gt; &lt;buffer&gt; &quot;. g:NERDTreeMapCloseChildren .&quot; :call &lt;SID&gt;closeChildren()&lt;cr&gt;&quot;
 
-    exec &quot;nnoremap &lt;silent&gt; &lt;buffer&gt; &quot;. g:NERDTreeMapFilesystemMenu .&quot; :call &lt;SID&gt;showFileSystemMenu()&lt;cr&gt;&quot;
+    exec &quot;nnoremap &lt;silent&gt; &lt;buffer&gt; &quot;. g:NERDTreeMapMenu .&quot; :call &lt;SID&gt;showMenu()&lt;cr&gt;&quot;
 
     exec &quot;nnoremap &lt;silent&gt; &lt;buffer&gt; &quot;. g:NERDTreeMapJumpParent .&quot; :call &lt;SID&gt;jumpToParent()&lt;cr&gt;&quot;
     exec &quot;nnoremap &lt;silent&gt; &lt;buffer&gt; &quot;. g:NERDTreeMapJumpNextSibling .&quot; :call &lt;SID&gt;jumpToSibling(1)&lt;cr&gt;&quot;
@@ -3105,6 +3440,9 @@ function! s:bindMappings()
 
     exec &quot;nnoremap &lt;silent&gt; &lt;buffer&gt; &quot;. g:NERDTreeMapDeleteBookmark .&quot; :call &lt;SID&gt;deleteBookmark()&lt;cr&gt;&quot;
 
+    &quot;bind all the user custom maps
+    call s:KeyMap.BindAll()
+
     command! -buffer -nargs=1 Bookmark :call &lt;SID&gt;bookmarkNode('&lt;args&gt;')
     command! -buffer -complete=customlist,s:completeBookmarks -nargs=1 RevealBookmark :call &lt;SID&gt;revealBookmark('&lt;args&gt;')
     command! -buffer -complete=customlist,s:completeBookmarks -nargs=1 OpenBookmark :call &lt;SID&gt;openBookmark('&lt;args&gt;')
@@ -3225,7 +3563,7 @@ function! s:closeCurrentDir()
     endif
 
     let parent = treenode.parent
-    if parent.isRoot()
+    if parent ==# {} || parent.isRoot()
         call s:echo(&quot;cannot close tree root&quot;)
     else
         call treenode.parent.close()
@@ -3246,45 +3584,6 @@ function! s:closeTreeWindow()
         endif
     endif
 endfunction
-&quot; FUNCTION: s:copyNode() {{{2
-function! s:copyNode()
-    let currentNode = s:TreeFileNode.GetSelected()
-    if currentNode ==# {}
-        call s:echo(&quot;Put the cursor on a file node first&quot;)
-        return
-    endif
-
-    let newNodePath = input(&quot;Copy the current node\n&quot; .
-                          \ &quot;==========================================================\n&quot; .
-                          \ &quot;Enter the new path to copy the node to:                   \n&quot; .
-                          \ &quot;&quot;, currentNode.path.str(0))
-
-    if newNodePath != &quot;&quot;
-        &quot;strip trailing slash
-        let newNodePath = substitute(newNodePath, '\/$', '', '')
-
-        let confirmed = 1
-        if currentNode.path.copyingWillOverwrite(newNodePath)
-            call s:echo(&quot;\nWarning: copying may overwrite files! Continue? (yN)&quot;)
-            let choice = nr2char(getchar())
-            let confirmed = choice ==# 'y'
-        endif
-
-        if confirmed
-            try
-                let newNode = currentNode.copy(newNodePath)
-                call s:renderView()
-                call newNode.putCursorHere(0, 0)
-            catch /^NERDTree/
-                call s:echoWarning(&quot;Could not copy node&quot;)
-            endtry
-        endif
-    else
-        call s:echo(&quot;Copy aborted.&quot;)
-    endif
-    redraw
-endfunction
-
 &quot; FUNCTION: s:deleteBookmark() {{{2
 &quot; if the cursor is on a bookmark, prompt to delete
 function! s:deleteBookmark()
@@ -3310,57 +3609,6 @@ function! s:deleteBookmark()
 
 endfunction
 
-&quot; FUNCTION: s:deleteNode() {{{2
-&quot; if the current node is a file, pops up a dialog giving the user the option
-&quot; to delete it
-function! s:deleteNode()
-    let currentNode = s:TreeFileNode.GetSelected()
-    if currentNode ==# {}
-        call s:echo(&quot;Put the cursor on a file node first&quot;)
-        return
-    endif
-
-    let confirmed = 0
-
-    if currentNode.path.isDirectory
-        let choice =input(&quot;Delete the current node\n&quot; .
-                         \ &quot;==========================================================\n&quot; .
-                         \ &quot;STOP! To delete this entire directory, type 'yes'\n&quot; .
-                         \ &quot;&quot; . currentNode.path.strForOS(0) . &quot;: &quot;)
-        let confirmed = choice ==# 'yes'
-    else
-        echo &quot;Delete the current node\n&quot; .
-           \ &quot;==========================================================\n&quot;.
-           \ &quot;Are you sure you wish to delete the node:\n&quot; .
-           \ &quot;&quot; . currentNode.path.strForOS(0) . &quot; (yN):&quot;
-        let choice = nr2char(getchar())
-        let confirmed = choice ==# 'y'
-    endif
-
-
-    if confirmed
-        try
-            call currentNode.delete()
-            call s:renderView()
-
-            &quot;if the node is open in a buffer, ask the user if they want to
-            &quot;close that buffer
-            let bufnum = bufnr(currentNode.path.str(0))
-            if buflisted(bufnum)
-                let prompt = &quot;\nNode deleted.\n\nThe file is open in buffer &quot;. bufnum . (bufwinnr(bufnum) ==# -1 ? &quot; (hidden)&quot; : &quot;&quot;) .&quot;. Delete this buffer? (yN)&quot;
-                call s:promptToDelBuffer(bufnum, prompt)
-            endif
-
-            redraw
-        catch /^NERDTree/
-            call s:echoWarning(&quot;Could not remove node&quot;)
-        endtry
-    else
-        call s:echo(&quot;delete aborted&quot; )
-    endif
-
-endfunction
-
 &quot; FUNCTION: s:displayHelp() {{{2
 &quot; toggles the help display
 function! s:displayHelp()
@@ -3369,26 +3617,6 @@ function! s:displayHelp()
     call s:centerView()
 endfunction
 
-&quot; FUNCTION: s:executeNode() {{{2
-function! s:executeNode()
-    let treenode = s:TreeFileNode.GetSelected()
-    if treenode ==# {} || treenode.path.isDirectory
-        call s:echo(&quot;Select an executable file node first&quot; )
-    else
-        echo &quot;NERDTree executor\n&quot; .
-           \ &quot;==========================================================\n&quot;.
-           \ &quot;Complete the command to execute (add arguments etc): \n\n&quot;
-        let cmd = treenode.path.strForOS(1)
-        let cmd = input(':!', cmd . ' ')
-
-        if cmd != ''
-            exec ':!' . cmd
-        else
-            call s:echo(&quot;command aborted&quot;)
-        endif
-    endif
-endfunction
-
 &quot; FUNCTION: s:handleMiddleMouse() {{{2
 function! s:handleMiddleMouse()
     let curNode = s:TreeFileNode.GetSelected()
@@ -3405,40 +3633,6 @@ function! s:handleMiddleMouse()
 endfunction
 
 
-&quot; FUNCTION: s:insertNewNode() {{{2
-&quot; Adds a new node to the filesystem and then into the tree
-function! s:insertNewNode()
-    let curDirNode = s:TreeDirNode.GetSelected()
-    if curDirNode ==# {}
-        call s:echo(&quot;Put the cursor on a node first&quot; )
-        return
-    endif
-
-    let newNodeName = input(&quot;Add a childnode\n&quot;.
-                          \ &quot;==========================================================\n&quot;.
-                          \ &quot;Enter the dir/file name to be created. Dirs end with a '/'\n&quot; .
-                          \ &quot;&quot;, curDirNode.path.strForGlob() . s:os_slash)
-
-    if newNodeName ==# ''
-        call s:echo(&quot;Node Creation Aborted.&quot;)
-        return
-    endif
-
-    try
-        let newPath = s:Path.Create(newNodeName)
-        let parentNode = b:NERDTreeRoot.findNode(newPath.getPathTrunk())
-
-        let newTreeNode = s:TreeFileNode.New(newPath)
-        if parentNode.isOpen || !empty(parentNode.children)
-            call parentNode.addChild(newTreeNode, 1)
-            call s:renderView()
-            call newTreeNode.putCursorHere(1, 0)
-        endif
-    catch /^NERDTree/
-        call s:echoWarning(&quot;Node Not Created.&quot;)
-    endtry
-endfunction
-
 &quot; FUNCTION: s:jumpToFirstChild() {{{2
 &quot; wrapper for the jump to child method
 function! s:jumpToFirstChild()
@@ -3556,9 +3750,9 @@ function! s:openInNewTab(stayCurrentTab)
     if treenode != {}
         if treenode.path.isDirectory
             tabnew
-            call s:initNerdTree(treenode.path.strForOS(0))
+            call s:initNerdTree(treenode.path.str())
         else
-            exec &quot;tabedit &quot; . treenode.path.strForEditCmd()
+            exec &quot;tabedit &quot; . treenode.path.str({'format': 'Edit'})
         endif
     else
         let bookmark = s:getSelectedBookmark()
@@ -3567,7 +3761,7 @@ function! s:openInNewTab(stayCurrentTab)
                 tabnew
                 call s:initNerdTree(bookmark.name)
             else
-                exec &quot;tabedit &quot; . bookmark.path.strForEditCmd()
+                exec &quot;tabedit &quot; . bookmark.path.str({'format': 'Edit'})
             endif
         endif
     endif
@@ -3641,80 +3835,16 @@ function! s:refreshCurrent()
     redraw
     call s:echo(&quot;Refreshing node. This could take a while... DONE&quot;)
 endfunction
-&quot; FUNCTION: s:renameCurrent() {{{2
-&quot; allows the user to rename the current node
-function! s:renameCurrent()
-    let curNode = s:TreeFileNode.GetSelected()
-    if curNode ==# {}
-        call s:echo(&quot;Put the cursor on a node first&quot; )
-        return
-    endif
-
-    let newNodePath = input(&quot;Rename the current node\n&quot; .
-                          \ &quot;==========================================================\n&quot; .
-                          \ &quot;Enter the new path for the node:                          \n&quot; .
-                          \ &quot;&quot;, curNode.path.strForOS(0))
-
-    if newNodePath ==# ''
-        call s:echo(&quot;Node Renaming Aborted.&quot;)
-        return
-    endif
-
-    try
-        let bufnum = bufnr(curNode.path.str(0))
-
-        call curNode.rename(newNodePath)
-        call s:renderView()
-
-        &quot;if the node is open in a buffer, ask the user if they want to
-        &quot;close that buffer
-        if bufnum != -1
-            let prompt = &quot;\nNode renamed.\n\nThe old file is open in buffer &quot;. bufnum . (bufwinnr(bufnum) ==# -1 ? &quot; (hidden)&quot; : &quot;&quot;) .&quot;. Delete this buffer? (yN)&quot;
-            call s:promptToDelBuffer(bufnum, prompt)
-        endif
-
-        call curNode.putCursorHere(1, 0)
-
-        redraw
-    catch /^NERDTree/
-        call s:echoWarning(&quot;Node Not Renamed.&quot;)
-    endtry
-endfunction
-
-&quot; FUNCTION: s:showFileSystemMenu() {{{2
-function! s:showFileSystemMenu()
+&quot; FUNCTION: s:showMenu() {{{2
+function! s:showMenu()
     let curNode = s:TreeFileNode.GetSelected()
     if curNode ==# {}
         call s:echo(&quot;Put the cursor on a node first&quot; )
         return
     endif
 
-
-    let prompt = &quot;NERDTree Filesystem Menu\n&quot; .
-       \ &quot;==========================================================\n&quot;.
-       \ &quot;Select the desired operation:                             \n&quot; .
-       \ &quot; (a)dd a childnode\n&quot;.
-       \ &quot; (m)ove the current node\n&quot;.
-       \ &quot; (d)elete the current node\n&quot;
-    if s:Path.CopyingSupported()
-        let prompt = prompt . &quot; (c)opy the current node\n\n&quot;
-    else
-        let prompt = prompt . &quot; \n&quot;
-    endif
-
-    echo prompt
-
-    let choice = nr2char(getchar())
-
-    if choice ==? &quot;a&quot;
-        call s:insertNewNode()
-    elseif choice ==? &quot;m&quot;
-        call s:renameCurrent()
-    elseif choice ==? &quot;d&quot;
-        call s:deleteNode()
-    elseif choice ==? &quot;c&quot; &amp;&amp; s:Path.CopyingSupported()
-        call s:copyNode()
-    endif
+    let mc = s:MenuController.New(s:MenuItem.AllEnabled())
+    call mc.showMenu()
 endfunction
 
 &quot; FUNCTION: s:toggleIgnoreFilter() {{{2
@@ -3753,6 +3883,19 @@ function! s:toggleShowHidden()
     call s:centerView()
 endfunction
 
+&quot; FUNCTION: s:toggleZoom() {{2
+&quot; zoom (maximize/minimize) the NERDTree window
+function! s:toggleZoom()
+    if exists(&quot;b:NERDTreeZoomed&quot;) &amp;&amp; b:NERDTreeZoomed
+        let size = exists(&quot;b:NERDTreeOldWindowSize&quot;) ? b:NERDTreeOldWindowSize : g:NERDTreeWinSize
+        exec &quot;silent vertical resize &quot;. size
+        let b:NERDTreeZoomed = 0
+    else
+        exec &quot;vertical resize&quot;
+        let b:NERDTreeZoomed = 1
+    endif
+endfunction
+
 &quot;FUNCTION: s:upDir(keepState) {{{2
 &quot;moves the tree up a level
 &quot;
@@ -3760,7 +3903,7 @@ endfunction
 &quot;keepState: 1 if the current root should be left open when the tree is
 &quot;re-rendered
 function! s:upDir(keepState)
-    let cwd = b:NERDTreeRoot.path.str(0)
+    let cwd = b:NERDTreeRoot.path.str({'format': 'UI'})
     if cwd ==# &quot;/&quot; || cwd =~ '^[^/]..$'
         call s:echo(&quot;already at top dir&quot;)
     else
@@ -3771,7 +3914,7 @@ function! s:upDir(keepState)
         let oldRoot = b:NERDTreeRoot
 
         if empty(b:NERDTreeRoot.parent)
-            let path = b:NERDTreeRoot.path.getPathTrunk()
+            let path = b:NERDTreeRoot.path.getParent()
             let newRoot = s:TreeDirNode.New(path)
             call newRoot.open()
             call newRoot.transplantChild(b:NERDTreeRoot)</diff>
      <filename>plugin/NERD_tree.vim</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>0ede6d1d2e9f18cd2f30fb085a9baa1874bedeb2</id>
    </parent>
  </parents>
  <author>
    <name>unknown</name>
    <email>v-vixavi@.southamerica.corp.microsoft.com</email>
  </author>
  <url>http://github.com/vcx/vimfiles/commit/4923587a9d329fc03495668975b3f74f2708249a</url>
  <id>4923587a9d329fc03495668975b3f74f2708249a</id>
  <committed-date>2009-09-09T12:26:11-07:00</committed-date>
  <authored-date>2009-09-09T12:26:11-07:00</authored-date>
  <message>update plugins nerd_commenter and nerd_tree</message>
  <tree>a2b19052f18df2710f743a6365b693c109e004c6</tree>
  <committer>
    <name>unknown</name>
    <email>v-vixavi@.southamerica.corp.microsoft.com</email>
  </committer>
</commit>
