Allows the user to create or copy a nested node
in a single step with ma or mc, recursively
creating nested parent directories if needed, and
without throwing any errors if they already exist.
[Finishes #163, #34]
As a user it's a little jarring when a plugin maps over something I've
already defined. This patch fixes that problem, by using `<unique>` to
ensure unique mappings.
For more info see `:help <unique>`
Note: This has no effect if the mapping isn't already defined (that is,
NERDTree is defining a unique mapping), so this won't break for normal
users of the plugin.
Note: `:silent!` is needed to ignore the error that occurs when a
mapping is already defined.
Fixes#252
On some new versions of vim these files were being loaded before the
main NERD_tree.vim which was causing errors as dependencies werent
loaded in time. Move the classes into lib - so vim wont try to load them
until we tell it
Because NERD_Tree sets the filetype in its buffer, it's tempting to hook into the FileType event in order to customize it. Unfortunately, the buffer-local mappings are only defined _after_ setting the filetype, so one cannot un-/redefine them via this mechanism. (I know there are config variables and an API for that, but one may have other unforeseen uses.)
Therefore, swap the order and set the filetype last. Also, use :setlocal filetype= instead of :setfiletype. In the (remote) chance that a custom filetype detection mistakenly sets a filetype for the NERD_Tree buffer, the :setfiletype would be without effect, but we want to force the filetype (for the special syntax) here.
This is needed because some versions of vim dont let you chain method
calls together. So do the work in NERDTreeCreator instead of forcing all
callers to break the New().createXXX() calls out onto 2 lines with an
intermediate variable.
Fixes#226.
Add the NERDTreeCreator class.
Stick all functions related to creating a primary/secondary/mirror
nerdtree in there. We may break this down further in the future, but
this is a good starting point.
Make some of the interface binding functions in autoload/nerdtree
public. This is needed since we are accessing some of them from
NERDTreeCreator. Should be temporary until we get some kind of proper
interface binding system set up.
* fix the fold markers (they were unnecessarily deep)
* always have one line under each method
* update some of the fold comments -> always use FUNCTION in all caps
* add a modeline to each class file
* Move the classes out into `plugin/nerdtree/<classname>`.
* Move the other functions out into `autoload/nerdtree.vim`.
Stuff still to do:
* extract out at least one view class from `autoload/nerdtree` -
something like NERDTreeWindow
* figure out which functions in autoload/nerdtree should be scoped to
the script instead of public
If you are renaming a file via the mm hotkey and it is already opened then all
tabs and windows containing the old file will be replaced with a
new file. Current tab and windows structure is not changed anymore
If you are deleting a file via the md hotkey and it is already open, i.e.
presents in buffer lists then a buffer will be removed but a window and tab
will be kept with a ':enew' file
Previously when you delete or moved a file via
md or mm commands the NERDTree was asking you about what to do
with the remaining buffer of the just deleted or moved file. I
always press 'y' in this cases so I've decided to add a new parameter,
NERDTreeAutoDeleteBuffer which you can set to 1 in order to skip
this confirmation.