vim-nerdtree 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/doc/NERD_tree.txt +1222 -0
- data/nerdtree_plugin/exec_menuitem.vim +41 -0
- data/nerdtree_plugin/fs_menu.vim +194 -0
- data/plugin/NERD_tree.vim +4076 -0
- metadata +67 -0
data/doc/NERD_tree.txt
ADDED
@@ -0,0 +1,1222 @@
|
|
1
|
+
*NERD_tree.txt* A tree explorer plugin that owns your momma!
|
2
|
+
|
3
|
+
|
4
|
+
|
5
|
+
omg its ... ~
|
6
|
+
|
7
|
+
________ ________ _ ____________ ____ __________ ____________~
|
8
|
+
/_ __/ / / / ____/ / | / / ____/ __ \/ __ \ /_ __/ __ \/ ____/ ____/~
|
9
|
+
/ / / /_/ / __/ / |/ / __/ / /_/ / / / / / / / /_/ / __/ / __/ ~
|
10
|
+
/ / / __ / /___ / /| / /___/ _, _/ /_/ / / / / _, _/ /___/ /___ ~
|
11
|
+
/_/ /_/ /_/_____/ /_/ |_/_____/_/ |_/_____/ /_/ /_/ |_/_____/_____/ ~
|
12
|
+
|
13
|
+
|
14
|
+
Reference Manual~
|
15
|
+
|
16
|
+
|
17
|
+
|
18
|
+
|
19
|
+
==============================================================================
|
20
|
+
CONTENTS *NERDTree-contents*
|
21
|
+
|
22
|
+
1.Intro...................................|NERDTree|
|
23
|
+
2.Functionality provided..................|NERDTreeFunctionality|
|
24
|
+
2.1.Global commands...................|NERDTreeGlobalCommands|
|
25
|
+
2.2.Bookmarks.........................|NERDTreeBookmarks|
|
26
|
+
2.2.1.The bookmark table..........|NERDTreeBookmarkTable|
|
27
|
+
2.2.2.Bookmark commands...........|NERDTreeBookmarkCommands|
|
28
|
+
2.2.3.Invalid bookmarks...........|NERDTreeInvalidBookmarks|
|
29
|
+
2.3.NERD tree mappings................|NERDTreeMappings|
|
30
|
+
2.4.The NERD tree menu................|NERDTreeMenu|
|
31
|
+
3.Options.................................|NERDTreeOptions|
|
32
|
+
3.1.Option summary....................|NERDTreeOptionSummary|
|
33
|
+
3.2.Option details....................|NERDTreeOptionDetails|
|
34
|
+
4.The NERD tree API.......................|NERDTreeAPI|
|
35
|
+
4.1.Key map API.......................|NERDTreeKeymapAPI|
|
36
|
+
4.2.Menu API..........................|NERDTreeMenuAPI|
|
37
|
+
5.About...................................|NERDTreeAbout|
|
38
|
+
6.Changelog...............................|NERDTreeChangelog|
|
39
|
+
7.Credits.................................|NERDTreeCredits|
|
40
|
+
8.License.................................|NERDTreeLicense|
|
41
|
+
|
42
|
+
==============================================================================
|
43
|
+
1. Intro *NERDTree*
|
44
|
+
|
45
|
+
What is this "NERD tree"??
|
46
|
+
|
47
|
+
The NERD tree allows you to explore your filesystem and to open files and
|
48
|
+
directories. It presents the filesystem to you in the form of a tree which you
|
49
|
+
manipulate with the keyboard and/or mouse. It also allows you to perform
|
50
|
+
simple filesystem operations.
|
51
|
+
|
52
|
+
The following features and functionality are provided by the NERD tree:
|
53
|
+
* Files and directories are displayed in a hierarchical tree structure
|
54
|
+
* Different highlighting is provided for the following types of nodes:
|
55
|
+
* files
|
56
|
+
* directories
|
57
|
+
* sym-links
|
58
|
+
* windows .lnk files
|
59
|
+
* read-only files
|
60
|
+
* executable files
|
61
|
+
* Many (customisable) mappings are provided to manipulate the tree:
|
62
|
+
* Mappings to open/close/explore directory nodes
|
63
|
+
* Mappings to open files in new/existing windows/tabs
|
64
|
+
* Mappings to change the current root of the tree
|
65
|
+
* Mappings to navigate around the tree
|
66
|
+
* ...
|
67
|
+
* Directories and files can be bookmarked.
|
68
|
+
* Most NERD tree navigation can also be done with the mouse
|
69
|
+
* Filtering of tree content (can be toggled at runtime)
|
70
|
+
* custom file filters to prevent e.g. vim backup files being displayed
|
71
|
+
* optional displaying of hidden files (. files)
|
72
|
+
* files can be "turned off" so that only directories are displayed
|
73
|
+
* The position and size of the NERD tree window can be customised
|
74
|
+
* The order in which the nodes in the tree are listed can be customised.
|
75
|
+
* A model of your filesystem is created/maintained as you explore it. This
|
76
|
+
has several advantages:
|
77
|
+
* All filesystem information is cached and is only re-read on demand
|
78
|
+
* If you revisit a part of the tree that you left earlier in your
|
79
|
+
session, the directory nodes will be opened/closed as you left them
|
80
|
+
* The script remembers the cursor position and window position in the NERD
|
81
|
+
tree so you can toggle it off (or just close the tree window) and then
|
82
|
+
reopen it (with NERDTreeToggle) the NERD tree window will appear exactly
|
83
|
+
as you left it
|
84
|
+
* You can have a separate NERD tree for each tab, share trees across tabs,
|
85
|
+
or a mix of both.
|
86
|
+
* By default the script overrides the default file browser (netw), so if
|
87
|
+
you :edit a directory a (slighly modified) NERD tree will appear in the
|
88
|
+
current window
|
89
|
+
* A programmable menu system is provided (simulates right clicking on a
|
90
|
+
node)
|
91
|
+
* one default menu plugin is provided to perform basic filesytem
|
92
|
+
operations (create/delete/move/copy files/directories)
|
93
|
+
* There's an API for adding your own keymappings
|
94
|
+
|
95
|
+
|
96
|
+
==============================================================================
|
97
|
+
2. Functionality provided *NERDTreeFunctionality*
|
98
|
+
|
99
|
+
------------------------------------------------------------------------------
|
100
|
+
2.1. Global Commands *NERDTreeGlobalCommands*
|
101
|
+
|
102
|
+
:NERDTree [<start-directory> | <bookmark>] *:NERDTree*
|
103
|
+
Opens a fresh NERD tree. The root of the tree depends on the argument
|
104
|
+
given. There are 3 cases: If no argument is given, the current directory
|
105
|
+
will be used. If a directory is given, that will be used. If a bookmark
|
106
|
+
name is given, the corresponding directory will be used. For example: >
|
107
|
+
:NERDTree /home/marty/vim7/src
|
108
|
+
:NERDTree foo (foo is the name of a bookmark)
|
109
|
+
<
|
110
|
+
:NERDTreeFromBookmark <bookmark> *:NERDTreeFromBookmark*
|
111
|
+
Opens a fresh NERD tree with the root initialized to the dir for
|
112
|
+
<bookmark>. This only reason to use this command over :NERDTree is for
|
113
|
+
the completion (which is for bookmarks rather than directories).
|
114
|
+
|
115
|
+
:NERDTreeToggle [<start-directory> | <bookmark>] *:NERDTreeToggle*
|
116
|
+
If a NERD tree already exists for this tab, it is reopened and rendered
|
117
|
+
again. If no NERD tree exists for this tab then this command acts the
|
118
|
+
same as the |:NERDTree| command.
|
119
|
+
|
120
|
+
:NERDTreeMirror *:NERDTreeMirror*
|
121
|
+
Shares an existing NERD tree, from another tab, in the current tab.
|
122
|
+
Changes made to one tree are reflected in both as they are actually the
|
123
|
+
same buffer.
|
124
|
+
|
125
|
+
If only one other NERD tree exists, that tree is automatically mirrored. If
|
126
|
+
more than one exists, the script will ask which tree to mirror.
|
127
|
+
|
128
|
+
:NERDTreeClose *:NERDTreeClose*
|
129
|
+
Close the NERD tree in this tab.
|
130
|
+
|
131
|
+
:NERDTreeFind *:NERDTreeFind*
|
132
|
+
Find the current file in the tree. If no tree exists for the current tab,
|
133
|
+
or the file is not under the current root, then initialize a new tree where
|
134
|
+
the root is the directory of the current file.
|
135
|
+
|
136
|
+
------------------------------------------------------------------------------
|
137
|
+
2.2. Bookmarks *NERDTreeBookmarks*
|
138
|
+
|
139
|
+
Bookmarks in the NERD tree are a way to tag files or directories of interest.
|
140
|
+
For example, you could use bookmarks to tag all of your project directories.
|
141
|
+
|
142
|
+
------------------------------------------------------------------------------
|
143
|
+
2.2.1. The Bookmark Table *NERDTreeBookmarkTable*
|
144
|
+
|
145
|
+
If the bookmark table is active (see |NERDTree-B| and
|
146
|
+
|'NERDTreeShowBookmarks'|), it will be rendered above the tree. You can double
|
147
|
+
click bookmarks or use the |NERDTree-o| mapping to activate them. See also,
|
148
|
+
|NERDTree-t| and |NERDTree-T|
|
149
|
+
|
150
|
+
------------------------------------------------------------------------------
|
151
|
+
2.2.2. Bookmark commands *NERDTreeBookmarkCommands*
|
152
|
+
|
153
|
+
Note that the following commands are only available in the NERD tree buffer.
|
154
|
+
|
155
|
+
:Bookmark <name>
|
156
|
+
Bookmark the current node as <name>. If there is already a <name>
|
157
|
+
bookmark, it is overwritten. <name> must not contain spaces.
|
158
|
+
|
159
|
+
:BookmarkToRoot <bookmark>
|
160
|
+
Make the directory corresponding to <bookmark> the new root. If a treenode
|
161
|
+
corresponding to <bookmark> is already cached somewhere in the tree then
|
162
|
+
the current tree will be used, otherwise a fresh tree will be opened.
|
163
|
+
Note that if <bookmark> points to a file then its parent will be used
|
164
|
+
instead.
|
165
|
+
|
166
|
+
:RevealBookmark <bookmark>
|
167
|
+
If the node is cached under the current root then it will be revealed
|
168
|
+
(i.e. directory nodes above it will be opened) and the cursor will be
|
169
|
+
placed on it.
|
170
|
+
|
171
|
+
:OpenBookmark <bookmark>
|
172
|
+
<bookmark> must point to a file. The file is opened as though |NERDTree-o|
|
173
|
+
was applied. If the node is cached under the current root then it will be
|
174
|
+
revealed and the cursor will be placed on it.
|
175
|
+
|
176
|
+
:ClearBookmarks [<bookmarks>]
|
177
|
+
Remove all the given bookmarks. If no bookmarks are given then remove all
|
178
|
+
bookmarks on the current node.
|
179
|
+
|
180
|
+
:ClearAllBookmarks
|
181
|
+
Remove all bookmarks.
|
182
|
+
|
183
|
+
:ReadBookmarks
|
184
|
+
Re-read the bookmarks in the |'NERDTreeBookmarksFile'|.
|
185
|
+
|
186
|
+
See also |:NERDTree| and |:NERDTreeFromBookmark|.
|
187
|
+
|
188
|
+
------------------------------------------------------------------------------
|
189
|
+
2.2.3. Invalid Bookmarks *NERDTreeInvalidBookmarks*
|
190
|
+
|
191
|
+
If invalid bookmarks are detected, the script will issue an error message and
|
192
|
+
the invalid bookmarks will become unavailable for use.
|
193
|
+
|
194
|
+
These bookmarks will still be stored in the bookmarks file (see
|
195
|
+
|'NERDTreeBookmarksFile'|), down the bottom. There will always be a blank line
|
196
|
+
after the valid bookmarks but before the invalid ones.
|
197
|
+
|
198
|
+
Each line in the bookmarks file represents one bookmark. The proper format is:
|
199
|
+
<bookmark name><space><full path to the bookmark location>
|
200
|
+
|
201
|
+
After you have corrected any invalid bookmarks, either restart vim, or go
|
202
|
+
:ReadBookmarks from the NERD tree window.
|
203
|
+
|
204
|
+
------------------------------------------------------------------------------
|
205
|
+
2.3. NERD tree Mappings *NERDTreeMappings*
|
206
|
+
|
207
|
+
Default Description~ help-tag~
|
208
|
+
Key~
|
209
|
+
|
210
|
+
o.......Open files, directories and bookmarks....................|NERDTree-o|
|
211
|
+
go......Open selected file, but leave cursor in the NERDTree.....|NERDTree-go|
|
212
|
+
t.......Open selected node/bookmark in a new tab.................|NERDTree-t|
|
213
|
+
T.......Same as 't' but keep the focus on the current tab........|NERDTree-T|
|
214
|
+
i.......Open selected file in a split window.....................|NERDTree-i|
|
215
|
+
gi......Same as i, but leave the cursor on the NERDTree..........|NERDTree-gi|
|
216
|
+
s.......Open selected file in a new vsplit.......................|NERDTree-s|
|
217
|
+
gs......Same as s, but leave the cursor on the NERDTree..........|NERDTree-gs|
|
218
|
+
O.......Recursively open the selected directory..................|NERDTree-O|
|
219
|
+
x.......Close the current nodes parent...........................|NERDTree-x|
|
220
|
+
X.......Recursively close all children of the current node.......|NERDTree-X|
|
221
|
+
e.......Edit the current dif.....................................|NERDTree-e|
|
222
|
+
|
223
|
+
<CR>...............same as |NERDTree-o|.
|
224
|
+
double-click.......same as the |NERDTree-o| map.
|
225
|
+
middle-click.......same as |NERDTree-i| for files, same as
|
226
|
+
|NERDTree-e| for dirs.
|
227
|
+
|
228
|
+
D.......Delete the current bookmark .............................|NERDTree-D|
|
229
|
+
|
230
|
+
P.......Jump to the root node....................................|NERDTree-P|
|
231
|
+
p.......Jump to current nodes parent.............................|NERDTree-p|
|
232
|
+
K.......Jump up inside directories at the current tree depth.....|NERDTree-K|
|
233
|
+
J.......Jump down inside directories at the current tree depth...|NERDTree-J|
|
234
|
+
<C-J>...Jump down to the next sibling of the current directory...|NERDTree-C-J|
|
235
|
+
<C-K>...Jump up to the previous sibling of the current directory.|NERDTree-C-K|
|
236
|
+
|
237
|
+
C.......Change the tree root to the selected dir.................|NERDTree-C|
|
238
|
+
u.......Move the tree root up one directory......................|NERDTree-u|
|
239
|
+
U.......Same as 'u' except the old root node is left open........|NERDTree-U|
|
240
|
+
r.......Recursively refresh the current directory................|NERDTree-r|
|
241
|
+
R.......Recursively refresh the current root.....................|NERDTree-R|
|
242
|
+
m.......Display the NERD tree menu...............................|NERDTree-m|
|
243
|
+
cd......Change the CWD to the dir of the selected node...........|NERDTree-cd|
|
244
|
+
|
245
|
+
I.......Toggle whether hidden files displayed....................|NERDTree-I|
|
246
|
+
f.......Toggle whether the file filters are used.................|NERDTree-f|
|
247
|
+
F.......Toggle whether files are displayed.......................|NERDTree-F|
|
248
|
+
B.......Toggle whether the bookmark table is displayed...........|NERDTree-B|
|
249
|
+
|
250
|
+
q.......Close the NERDTree window................................|NERDTree-q|
|
251
|
+
A.......Zoom (maximize/minimize) the NERDTree window.............|NERDTree-A|
|
252
|
+
?.......Toggle the display of the quick help.....................|NERDTree-?|
|
253
|
+
|
254
|
+
------------------------------------------------------------------------------
|
255
|
+
*NERDTree-o*
|
256
|
+
Default key: o
|
257
|
+
Map option: NERDTreeMapActivateNode
|
258
|
+
Applies to: files and directories.
|
259
|
+
|
260
|
+
If a file node is selected, it is opened in the previous window.
|
261
|
+
|
262
|
+
If a directory is selected it is opened or closed depending on its current
|
263
|
+
state.
|
264
|
+
|
265
|
+
If a bookmark that links to a directory is selected then that directory
|
266
|
+
becomes the new root.
|
267
|
+
|
268
|
+
If a bookmark that links to a file is selected then that file is opened in the
|
269
|
+
previous window.
|
270
|
+
|
271
|
+
------------------------------------------------------------------------------
|
272
|
+
*NERDTree-go*
|
273
|
+
Default key: go
|
274
|
+
Map option: None
|
275
|
+
Applies to: files.
|
276
|
+
|
277
|
+
If a file node is selected, it is opened in the previous window, but the
|
278
|
+
cursor does not move.
|
279
|
+
|
280
|
+
The key combo for this mapping is always "g" + NERDTreeMapActivateNode (see
|
281
|
+
|NERDTree-o|).
|
282
|
+
|
283
|
+
------------------------------------------------------------------------------
|
284
|
+
*NERDTree-t*
|
285
|
+
Default key: t
|
286
|
+
Map option: NERDTreeMapOpenInTab
|
287
|
+
Applies to: files and directories.
|
288
|
+
|
289
|
+
Opens the selected file in a new tab. If a directory is selected, a fresh
|
290
|
+
NERD Tree for that directory is opened in a new tab.
|
291
|
+
|
292
|
+
If a bookmark which points to a directory is selected, open a NERD tree for
|
293
|
+
that directory in a new tab. If the bookmark points to a file, open that file
|
294
|
+
in a new tab.
|
295
|
+
|
296
|
+
------------------------------------------------------------------------------
|
297
|
+
*NERDTree-T*
|
298
|
+
Default key: T
|
299
|
+
Map option: NERDTreeMapOpenInTabSilent
|
300
|
+
Applies to: files and directories.
|
301
|
+
|
302
|
+
The same as |NERDTree-t| except that the focus is kept in the current tab.
|
303
|
+
|
304
|
+
------------------------------------------------------------------------------
|
305
|
+
*NERDTree-i*
|
306
|
+
Default key: i
|
307
|
+
Map option: NERDTreeMapOpenSplit
|
308
|
+
Applies to: files.
|
309
|
+
|
310
|
+
Opens the selected file in a new split window and puts the cursor in the new
|
311
|
+
window.
|
312
|
+
|
313
|
+
------------------------------------------------------------------------------
|
314
|
+
*NERDTree-gi*
|
315
|
+
Default key: gi
|
316
|
+
Map option: None
|
317
|
+
Applies to: files.
|
318
|
+
|
319
|
+
The same as |NERDTree-i| except that the cursor is not moved.
|
320
|
+
|
321
|
+
The key combo for this mapping is always "g" + NERDTreeMapOpenSplit (see
|
322
|
+
|NERDTree-i|).
|
323
|
+
|
324
|
+
------------------------------------------------------------------------------
|
325
|
+
*NERDTree-s*
|
326
|
+
Default key: s
|
327
|
+
Map option: NERDTreeMapOpenVSplit
|
328
|
+
Applies to: files.
|
329
|
+
|
330
|
+
Opens the selected file in a new vertically split window and puts the cursor in
|
331
|
+
the new window.
|
332
|
+
|
333
|
+
------------------------------------------------------------------------------
|
334
|
+
*NERDTree-gs*
|
335
|
+
Default key: gs
|
336
|
+
Map option: None
|
337
|
+
Applies to: files.
|
338
|
+
|
339
|
+
The same as |NERDTree-s| except that the cursor is not moved.
|
340
|
+
|
341
|
+
The key combo for this mapping is always "g" + NERDTreeMapOpenVSplit (see
|
342
|
+
|NERDTree-s|).
|
343
|
+
|
344
|
+
------------------------------------------------------------------------------
|
345
|
+
*NERDTree-O*
|
346
|
+
Default key: O
|
347
|
+
Map option: NERDTreeMapOpenRecursively
|
348
|
+
Applies to: directories.
|
349
|
+
|
350
|
+
Recursively opens the selelected directory.
|
351
|
+
|
352
|
+
All files and directories are cached, but if a directory would not be
|
353
|
+
displayed due to file filters (see |'NERDTreeIgnore'| |NERDTree-f|) or the
|
354
|
+
hidden file filter (see |'NERDTreeShowHidden'|) then its contents are not
|
355
|
+
cached. This is handy, especially if you have .svn directories.
|
356
|
+
|
357
|
+
------------------------------------------------------------------------------
|
358
|
+
*NERDTree-x*
|
359
|
+
Default key: x
|
360
|
+
Map option: NERDTreeMapCloseDir
|
361
|
+
Applies to: files and directories.
|
362
|
+
|
363
|
+
Closes the parent of the selected node.
|
364
|
+
|
365
|
+
------------------------------------------------------------------------------
|
366
|
+
*NERDTree-X*
|
367
|
+
Default key: X
|
368
|
+
Map option: NERDTreeMapCloseChildren
|
369
|
+
Applies to: directories.
|
370
|
+
|
371
|
+
Recursively closes all children of the selected directory.
|
372
|
+
|
373
|
+
Tip: To quickly "reset" the tree, use |NERDTree-P| with this mapping.
|
374
|
+
|
375
|
+
------------------------------------------------------------------------------
|
376
|
+
*NERDTree-e*
|
377
|
+
Default key: e
|
378
|
+
Map option: NERDTreeMapOpenExpl
|
379
|
+
Applies to: files and directories.
|
380
|
+
|
381
|
+
|:edit|s the selected directory, or the selected file's directory. This could
|
382
|
+
result in a NERD tree or a netrw being opened, depending on
|
383
|
+
|'NERDTreeHijackNetrw'|.
|
384
|
+
|
385
|
+
------------------------------------------------------------------------------
|
386
|
+
*NERDTree-D*
|
387
|
+
Default key: D
|
388
|
+
Map option: NERDTreeMapDeleteBookmark
|
389
|
+
Applies to: lines in the bookmarks table
|
390
|
+
|
391
|
+
Deletes the currently selected bookmark.
|
392
|
+
|
393
|
+
------------------------------------------------------------------------------
|
394
|
+
*NERDTree-P*
|
395
|
+
Default key: P
|
396
|
+
Map option: NERDTreeMapJumpRoot
|
397
|
+
Applies to: no restrictions.
|
398
|
+
|
399
|
+
Jump to the tree root.
|
400
|
+
|
401
|
+
------------------------------------------------------------------------------
|
402
|
+
*NERDTree-p*
|
403
|
+
Default key: p
|
404
|
+
Map option: NERDTreeMapJumpParent
|
405
|
+
Applies to: files and directories.
|
406
|
+
|
407
|
+
Jump to the parent node of the selected node.
|
408
|
+
|
409
|
+
------------------------------------------------------------------------------
|
410
|
+
*NERDTree-K*
|
411
|
+
Default key: K
|
412
|
+
Map option: NERDTreeMapJumpFirstChild
|
413
|
+
Applies to: files and directories.
|
414
|
+
|
415
|
+
Jump to the first child of the current nodes parent.
|
416
|
+
|
417
|
+
If the cursor is already on the first node then do the following:
|
418
|
+
* loop back thru the siblings of the current nodes parent until we find an
|
419
|
+
open dir with children
|
420
|
+
* go to the first child of that node
|
421
|
+
|
422
|
+
------------------------------------------------------------------------------
|
423
|
+
*NERDTree-J*
|
424
|
+
Default key: J
|
425
|
+
Map option: NERDTreeMapJumpLastChild
|
426
|
+
Applies to: files and directories.
|
427
|
+
|
428
|
+
Jump to the last child of the current nodes parent.
|
429
|
+
|
430
|
+
If the cursor is already on the last node then do the following:
|
431
|
+
* loop forward thru the siblings of the current nodes parent until we find
|
432
|
+
an open dir with children
|
433
|
+
* go to the last child of that node
|
434
|
+
|
435
|
+
------------------------------------------------------------------------------
|
436
|
+
*NERDTree-C-J*
|
437
|
+
Default key: <C-J>
|
438
|
+
Map option: NERDTreeMapJumpNextSibling
|
439
|
+
Applies to: files and directories.
|
440
|
+
|
441
|
+
Jump to the next sibling of the selected node.
|
442
|
+
|
443
|
+
------------------------------------------------------------------------------
|
444
|
+
*NERDTree-C-K*
|
445
|
+
Default key: <C-K>
|
446
|
+
Map option: NERDTreeMapJumpPrevSibling
|
447
|
+
Applies to: files and directories.
|
448
|
+
|
449
|
+
Jump to the previous sibling of the selected node.
|
450
|
+
|
451
|
+
------------------------------------------------------------------------------
|
452
|
+
*NERDTree-C*
|
453
|
+
Default key: C
|
454
|
+
Map option: NERDTreeMapChdir
|
455
|
+
Applies to: directories.
|
456
|
+
|
457
|
+
Make the selected directory node the new tree root. If a file is selected, its
|
458
|
+
parent is used.
|
459
|
+
|
460
|
+
------------------------------------------------------------------------------
|
461
|
+
*NERDTree-u*
|
462
|
+
Default key: u
|
463
|
+
Map option: NERDTreeMapUpdir
|
464
|
+
Applies to: no restrictions.
|
465
|
+
|
466
|
+
Move the tree root up a dir (like doing a "cd ..").
|
467
|
+
|
468
|
+
------------------------------------------------------------------------------
|
469
|
+
*NERDTree-U*
|
470
|
+
Default key: U
|
471
|
+
Map option: NERDTreeMapUpdirKeepOpen
|
472
|
+
Applies to: no restrictions.
|
473
|
+
|
474
|
+
Like |NERDTree-u| except that the old tree root is kept open.
|
475
|
+
|
476
|
+
------------------------------------------------------------------------------
|
477
|
+
*NERDTree-r*
|
478
|
+
Default key: r
|
479
|
+
Map option: NERDTreeMapRefresh
|
480
|
+
Applies to: files and directories.
|
481
|
+
|
482
|
+
If a dir is selected, recursively refresh that dir, i.e. scan the filesystem
|
483
|
+
for changes and represent them in the tree.
|
484
|
+
|
485
|
+
If a file node is selected then the above is done on it's parent.
|
486
|
+
|
487
|
+
------------------------------------------------------------------------------
|
488
|
+
*NERDTree-R*
|
489
|
+
Default key: R
|
490
|
+
Map option: NERDTreeMapRefreshRoot
|
491
|
+
Applies to: no restrictions.
|
492
|
+
|
493
|
+
Recursively refresh the tree root.
|
494
|
+
|
495
|
+
------------------------------------------------------------------------------
|
496
|
+
*NERDTree-m*
|
497
|
+
Default key: m
|
498
|
+
Map option: NERDTreeMapMenu
|
499
|
+
Applies to: files and directories.
|
500
|
+
|
501
|
+
Display the NERD tree menu. See |NERDTreeMenu| for details.
|
502
|
+
|
503
|
+
------------------------------------------------------------------------------
|
504
|
+
*NERDTree-cd*
|
505
|
+
Default key: cd
|
506
|
+
Map option: NERDTreeMapChdir
|
507
|
+
Applies to: files and directories.
|
508
|
+
|
509
|
+
Change vims current working directory to that of the selected node.
|
510
|
+
|
511
|
+
------------------------------------------------------------------------------
|
512
|
+
*NERDTree-I*
|
513
|
+
Default key: I
|
514
|
+
Map option: NERDTreeMapToggleHidden
|
515
|
+
Applies to: no restrictions.
|
516
|
+
|
517
|
+
Toggles whether hidden files (i.e. "dot files") are displayed.
|
518
|
+
|
519
|
+
------------------------------------------------------------------------------
|
520
|
+
*NERDTree-f*
|
521
|
+
Default key: f
|
522
|
+
Map option: NERDTreeMapToggleFilters
|
523
|
+
Applies to: no restrictions.
|
524
|
+
|
525
|
+
Toggles whether file filters are used. See |'NERDTreeIgnore'| for details.
|
526
|
+
|
527
|
+
------------------------------------------------------------------------------
|
528
|
+
*NERDTree-F*
|
529
|
+
Default key: F
|
530
|
+
Map option: NERDTreeMapToggleFiles
|
531
|
+
Applies to: no restrictions.
|
532
|
+
|
533
|
+
Toggles whether file nodes are displayed.
|
534
|
+
|
535
|
+
------------------------------------------------------------------------------
|
536
|
+
*NERDTree-B*
|
537
|
+
Default key: B
|
538
|
+
Map option: NERDTreeMapToggleBookmarks
|
539
|
+
Applies to: no restrictions.
|
540
|
+
|
541
|
+
Toggles whether the bookmarks table is displayed.
|
542
|
+
|
543
|
+
------------------------------------------------------------------------------
|
544
|
+
*NERDTree-q*
|
545
|
+
Default key: q
|
546
|
+
Map option: NERDTreeMapQuit
|
547
|
+
Applies to: no restrictions.
|
548
|
+
|
549
|
+
Closes the NERDtree window.
|
550
|
+
|
551
|
+
------------------------------------------------------------------------------
|
552
|
+
*NERDTree-A*
|
553
|
+
Default key: A
|
554
|
+
Map option: NERDTreeMapToggleZoom
|
555
|
+
Applies to: no restrictions.
|
556
|
+
|
557
|
+
Maximize (zoom) and minimize the NERDtree window.
|
558
|
+
|
559
|
+
------------------------------------------------------------------------------
|
560
|
+
*NERDTree-?*
|
561
|
+
Default key: ?
|
562
|
+
Map option: NERDTreeMapHelp
|
563
|
+
Applies to: no restrictions.
|
564
|
+
|
565
|
+
Toggles whether the quickhelp is displayed.
|
566
|
+
|
567
|
+
------------------------------------------------------------------------------
|
568
|
+
2.3. The NERD tree menu *NERDTreeMenu*
|
569
|
+
|
570
|
+
The NERD tree has a menu that can be programmed via the an API (see
|
571
|
+
|NERDTreeMenuAPI|). The idea is to simulate the "right click" menus that most
|
572
|
+
file explorers have.
|
573
|
+
|
574
|
+
The script comes with two default menu plugins: exec_menuitem.vim and
|
575
|
+
fs_menu.vim. fs_menu.vim adds some basic filesystem operations to the menu for
|
576
|
+
creating/deleting/moving/copying files and dirs. exec_menuitem.vim provides a
|
577
|
+
menu item to execute executable files.
|
578
|
+
|
579
|
+
Related tags: |NERDTree-m| |NERDTreeApi|
|
580
|
+
|
581
|
+
==============================================================================
|
582
|
+
3. Customisation *NERDTreeOptions*
|
583
|
+
|
584
|
+
|
585
|
+
------------------------------------------------------------------------------
|
586
|
+
3.1. Customisation summary *NERDTreeOptionSummary*
|
587
|
+
|
588
|
+
The script provides the following options that can customise the behaviour the
|
589
|
+
NERD tree. These options should be set in your vimrc.
|
590
|
+
|
591
|
+
|'loaded_nerd_tree'| Turns off the script.
|
592
|
+
|
593
|
+
|'NERDChristmasTree'| Tells the NERD tree to make itself colourful
|
594
|
+
and pretty.
|
595
|
+
|
596
|
+
|'NERDTreeAutoCenter'| Controls whether the NERD tree window centers
|
597
|
+
when the cursor moves within a specified
|
598
|
+
distance to the top/bottom of the window.
|
599
|
+
|'NERDTreeAutoCenterThreshold'| Controls the sensitivity of autocentering.
|
600
|
+
|
601
|
+
|'NERDTreeCaseSensitiveSort'| Tells the NERD tree whether to be case
|
602
|
+
sensitive or not when sorting nodes.
|
603
|
+
|
604
|
+
|'NERDTreeChDirMode'| Tells the NERD tree if/when it should change
|
605
|
+
vim's current working directory.
|
606
|
+
|
607
|
+
|'NERDTreeHighlightCursorline'| Tell the NERD tree whether to highlight the
|
608
|
+
current cursor line.
|
609
|
+
|
610
|
+
|'NERDTreeHijackNetrw'| Tell the NERD tree whether to replace the netrw
|
611
|
+
autocommands for exploring local directories.
|
612
|
+
|
613
|
+
|'NERDTreeIgnore'| Tells the NERD tree which files to ignore.
|
614
|
+
|
615
|
+
|'NERDTreeBookmarksFile'| Where the bookmarks are stored.
|
616
|
+
|
617
|
+
|'NERDTreeMouseMode'| Tells the NERD tree how to handle mouse
|
618
|
+
clicks.
|
619
|
+
|
620
|
+
|'NERDTreeQuitOnOpen'| Closes the tree window after opening a file.
|
621
|
+
|
622
|
+
|'NERDTreeShowBookmarks'| Tells the NERD tree whether to display the
|
623
|
+
bookmarks table on startup.
|
624
|
+
|
625
|
+
|'NERDTreeShowFiles'| Tells the NERD tree whether to display files
|
626
|
+
in the tree on startup.
|
627
|
+
|
628
|
+
|'NERDTreeShowHidden'| Tells the NERD tree whether to display hidden
|
629
|
+
files on startup.
|
630
|
+
|
631
|
+
|'NERDTreeShowLineNumbers'| Tells the NERD tree whether to display line
|
632
|
+
numbers in the tree window.
|
633
|
+
|
634
|
+
|'NERDTreeSortOrder'| Tell the NERD tree how to sort the nodes in
|
635
|
+
the tree.
|
636
|
+
|
637
|
+
|'NERDTreeStatusline'| Set a statusline for NERD tree windows.
|
638
|
+
|
639
|
+
|'NERDTreeWinPos'| Tells the script where to put the NERD tree
|
640
|
+
window.
|
641
|
+
|
642
|
+
|'NERDTreeWinSize'| Sets the window size when the NERD tree is
|
643
|
+
opened.
|
644
|
+
|
645
|
+
------------------------------------------------------------------------------
|
646
|
+
3.2. Customisation details *NERDTreeOptionDetails*
|
647
|
+
|
648
|
+
To enable any of the below options you should put the given line in your
|
649
|
+
~/.vimrc
|
650
|
+
|
651
|
+
*'loaded_nerd_tree'*
|
652
|
+
If this plugin is making you feel homicidal, it may be a good idea to turn it
|
653
|
+
off with this line in your vimrc: >
|
654
|
+
let loaded_nerd_tree=1
|
655
|
+
<
|
656
|
+
------------------------------------------------------------------------------
|
657
|
+
*'NERDChristmasTree'*
|
658
|
+
Values: 0 or 1.
|
659
|
+
Default: 1.
|
660
|
+
|
661
|
+
If this option is set to 1 then some extra syntax highlighting elements are
|
662
|
+
added to the nerd tree to make it more colourful.
|
663
|
+
|
664
|
+
Set it to 0 for a more vanilla looking tree.
|
665
|
+
|
666
|
+
------------------------------------------------------------------------------
|
667
|
+
*'NERDTreeAutoCenter'*
|
668
|
+
Values: 0 or 1.
|
669
|
+
Default: 1
|
670
|
+
|
671
|
+
If set to 1, the NERD tree window will center around the cursor if it moves to
|
672
|
+
within |'NERDTreeAutoCenterThreshold'| lines of the top/bottom of the window.
|
673
|
+
|
674
|
+
This is ONLY done in response to tree navigation mappings,
|
675
|
+
i.e. |NERDTree-J| |NERDTree-K| |NERDTree-C-J| |NERDTree-C-K| |NERDTree-p|
|
676
|
+
|NERDTree-P|
|
677
|
+
|
678
|
+
The centering is done with a |zz| operation.
|
679
|
+
|
680
|
+
------------------------------------------------------------------------------
|
681
|
+
*'NERDTreeAutoCenterThreshold'*
|
682
|
+
Values: Any natural number.
|
683
|
+
Default: 3
|
684
|
+
|
685
|
+
This option controls the "sensitivity" of the NERD tree auto centering. See
|
686
|
+
|'NERDTreeAutoCenter'| for details.
|
687
|
+
|
688
|
+
------------------------------------------------------------------------------
|
689
|
+
*'NERDTreeCaseSensitiveSort'*
|
690
|
+
Values: 0 or 1.
|
691
|
+
Default: 0.
|
692
|
+
|
693
|
+
By default the NERD tree does not sort nodes case sensitively, i.e. nodes
|
694
|
+
could appear like this: >
|
695
|
+
bar.c
|
696
|
+
Baz.c
|
697
|
+
blarg.c
|
698
|
+
boner.c
|
699
|
+
Foo.c
|
700
|
+
<
|
701
|
+
But, if you set this option to 1 then the case of the nodes will be taken into
|
702
|
+
account. The above nodes would then be sorted like this: >
|
703
|
+
Baz.c
|
704
|
+
Foo.c
|
705
|
+
bar.c
|
706
|
+
blarg.c
|
707
|
+
boner.c
|
708
|
+
<
|
709
|
+
------------------------------------------------------------------------------
|
710
|
+
*'NERDTreeChDirMode'*
|
711
|
+
|
712
|
+
Values: 0, 1 or 2.
|
713
|
+
Default: 0.
|
714
|
+
|
715
|
+
Use this option to tell the script when (if at all) to change the current
|
716
|
+
working directory (CWD) for vim.
|
717
|
+
|
718
|
+
If it is set to 0 then the CWD is never changed by the NERD tree.
|
719
|
+
|
720
|
+
If set to 1 then the CWD is changed when the NERD tree is first loaded to the
|
721
|
+
directory it is initialized in. For example, if you start the NERD tree with >
|
722
|
+
:NERDTree /home/marty/foobar
|
723
|
+
<
|
724
|
+
then the CWD will be changed to /home/marty/foobar and will not be changed
|
725
|
+
again unless you init another NERD tree with a similar command.
|
726
|
+
|
727
|
+
If the option is set to 2 then it behaves the same as if set to 1 except that
|
728
|
+
the CWD is changed whenever the tree root is changed. For example, if the CWD
|
729
|
+
is /home/marty/foobar and you make the node for /home/marty/foobar/baz the new
|
730
|
+
root then the CWD will become /home/marty/foobar/baz.
|
731
|
+
|
732
|
+
------------------------------------------------------------------------------
|
733
|
+
*'NERDTreeHighlightCursorline'*
|
734
|
+
Values: 0 or 1.
|
735
|
+
Default: 1.
|
736
|
+
|
737
|
+
If set to 1, the current cursor line in the NERD tree buffer will be
|
738
|
+
highlighted. This is done using the |'cursorline'| option.
|
739
|
+
|
740
|
+
------------------------------------------------------------------------------
|
741
|
+
*'NERDTreeHijackNetrw'*
|
742
|
+
Values: 0 or 1.
|
743
|
+
Default: 1.
|
744
|
+
|
745
|
+
If set to 1, doing a >
|
746
|
+
:edit <some directory>
|
747
|
+
<
|
748
|
+
will open up a "secondary" NERD tree instead of a netrw in the target window.
|
749
|
+
|
750
|
+
Secondary NERD trees behaves slighly different from a regular trees in the
|
751
|
+
following respects:
|
752
|
+
1. 'o' will open the selected file in the same window as the tree,
|
753
|
+
replacing it.
|
754
|
+
2. you can have as many secondary tree as you want in the same tab.
|
755
|
+
|
756
|
+
------------------------------------------------------------------------------
|
757
|
+
*'NERDTreeIgnore'*
|
758
|
+
Values: a list of regular expressions.
|
759
|
+
Default: ['\~$'].
|
760
|
+
|
761
|
+
This option is used to specify which files the NERD tree should ignore. It
|
762
|
+
must be a list of regular expressions. When the NERD tree is rendered, any
|
763
|
+
files/dirs that match any of the regex's in 'NERDTreeIgnore' wont be
|
764
|
+
displayed.
|
765
|
+
|
766
|
+
For example if you put the following line in your vimrc: >
|
767
|
+
let NERDTreeIgnore=['\.vim$', '\~$']
|
768
|
+
<
|
769
|
+
then all files ending in .vim or ~ will be ignored.
|
770
|
+
|
771
|
+
Note: to tell the NERD tree not to ignore any files you must use the following
|
772
|
+
line: >
|
773
|
+
let NERDTreeIgnore=[]
|
774
|
+
<
|
775
|
+
|
776
|
+
The file filters can be turned on and off dynamically with the |NERDTree-f|
|
777
|
+
mapping.
|
778
|
+
|
779
|
+
------------------------------------------------------------------------------
|
780
|
+
*'NERDTreeBookmarksFile'*
|
781
|
+
Values: a path
|
782
|
+
Default: $HOME/.NERDTreeBookmarks
|
783
|
+
|
784
|
+
This is where bookmarks are saved. See |NERDTreeBookmarkCommands|.
|
785
|
+
|
786
|
+
------------------------------------------------------------------------------
|
787
|
+
*'NERDTreeMouseMode'*
|
788
|
+
Values: 1, 2 or 3.
|
789
|
+
Default: 1.
|
790
|
+
|
791
|
+
If set to 1 then a double click on a node is required to open it.
|
792
|
+
If set to 2 then a single click will open directory nodes, while a double
|
793
|
+
click will still be required for file nodes.
|
794
|
+
If set to 3 then a single click will open any node.
|
795
|
+
|
796
|
+
Note: a double click anywhere on a line that a tree node is on will
|
797
|
+
activate it, but all single-click activations must be done on name of the node
|
798
|
+
itself. For example, if you have the following node: >
|
799
|
+
| | |-application.rb
|
800
|
+
<
|
801
|
+
then (to single click activate it) you must click somewhere in
|
802
|
+
'application.rb'.
|
803
|
+
|
804
|
+
------------------------------------------------------------------------------
|
805
|
+
*'NERDTreeQuitOnOpen'*
|
806
|
+
|
807
|
+
Values: 0 or 1.
|
808
|
+
Default: 0
|
809
|
+
|
810
|
+
If set to 1, the NERD tree window will close after opening a file with the
|
811
|
+
|NERDTree-o|, |NERDTree-i|, |NERDTree-t| and |NERDTree-T| mappings.
|
812
|
+
|
813
|
+
------------------------------------------------------------------------------
|
814
|
+
*'NERDTreeShowBookmarks'*
|
815
|
+
Values: 0 or 1.
|
816
|
+
Default: 0.
|
817
|
+
|
818
|
+
If this option is set to 1 then the bookmarks table will be displayed.
|
819
|
+
|
820
|
+
This option can be toggled dynamically, per tree, with the |NERDTree-B|
|
821
|
+
mapping.
|
822
|
+
|
823
|
+
------------------------------------------------------------------------------
|
824
|
+
*'NERDTreeShowFiles'*
|
825
|
+
Values: 0 or 1.
|
826
|
+
Default: 1.
|
827
|
+
|
828
|
+
If this option is set to 1 then files are displayed in the NERD tree. If it is
|
829
|
+
set to 0 then only directories are displayed.
|
830
|
+
|
831
|
+
This option can be toggled dynamically, per tree, with the |NERDTree-F|
|
832
|
+
mapping and is useful for drastically shrinking the tree when you are
|
833
|
+
navigating to a different part of the tree.
|
834
|
+
|
835
|
+
------------------------------------------------------------------------------
|
836
|
+
*'NERDTreeShowHidden'*
|
837
|
+
Values: 0 or 1.
|
838
|
+
Default: 0.
|
839
|
+
|
840
|
+
This option tells vim whether to display hidden files by default. This option
|
841
|
+
can be dynamically toggled, per tree, with the |NERDTree-I| mapping. Use one
|
842
|
+
of the follow lines to set this option: >
|
843
|
+
let NERDTreeShowHidden=0
|
844
|
+
let NERDTreeShowHidden=1
|
845
|
+
<
|
846
|
+
|
847
|
+
------------------------------------------------------------------------------
|
848
|
+
*'NERDTreeShowLineNumbers'*
|
849
|
+
Values: 0 or 1.
|
850
|
+
Default: 0.
|
851
|
+
|
852
|
+
This option tells vim whether to display line numbers for the NERD tree
|
853
|
+
window. Use one of the follow lines to set this option: >
|
854
|
+
let NERDTreeShowLineNumbers=0
|
855
|
+
let NERDTreeShowLineNumbers=1
|
856
|
+
<
|
857
|
+
|
858
|
+
------------------------------------------------------------------------------
|
859
|
+
*'NERDTreeSortOrder'*
|
860
|
+
Values: a list of regular expressions.
|
861
|
+
Default: ['\/$', '*', '\.swp$', '\.bak$', '\~$']
|
862
|
+
|
863
|
+
This option is set to a list of regular expressions which are used to
|
864
|
+
specify the order of nodes under their parent.
|
865
|
+
|
866
|
+
For example, if the option is set to: >
|
867
|
+
['\.vim$', '\.c$', '\.h$', '*', 'foobar']
|
868
|
+
<
|
869
|
+
then all .vim files will be placed at the top, followed by all .c files then
|
870
|
+
all .h files. All files containing the string 'foobar' will be placed at the
|
871
|
+
end. The star is a special flag: it tells the script that every node that
|
872
|
+
doesnt match any of the other regexps should be placed here.
|
873
|
+
|
874
|
+
If no star is present in 'NERDTreeSortOrder' then one is automatically
|
875
|
+
appended to the array.
|
876
|
+
|
877
|
+
The regex '\/$' should be used to match directory nodes.
|
878
|
+
|
879
|
+
After this sorting is done, the files in each group are sorted alphabetically.
|
880
|
+
|
881
|
+
Other examples: >
|
882
|
+
(1) ['*', '\/$']
|
883
|
+
(2) []
|
884
|
+
(3) ['\/$', '\.rb$', '\.php$', '*', '\.swp$', '\.bak$', '\~$']
|
885
|
+
<
|
886
|
+
1. Directories will appear last, everything else will appear above.
|
887
|
+
2. Everything will simply appear in alphabetical order.
|
888
|
+
3. Dirs will appear first, then ruby and php. Swap files, bak files and vim
|
889
|
+
backup files will appear last with everything else preceding them.
|
890
|
+
|
891
|
+
------------------------------------------------------------------------------
|
892
|
+
*'NERDTreeStatusline'*
|
893
|
+
Values: Any valid statusline setting.
|
894
|
+
Default: %{b:NERDTreeRoot.path.strForOS(0)}
|
895
|
+
|
896
|
+
Tells the script what to use as the |'statusline'| setting for NERD tree
|
897
|
+
windows.
|
898
|
+
|
899
|
+
Note that the statusline is set using |:let-&| not |:set| so escaping spaces
|
900
|
+
isn't necessary.
|
901
|
+
|
902
|
+
Setting this option to -1 will will deactivate it so that your global
|
903
|
+
statusline setting is used instead.
|
904
|
+
|
905
|
+
------------------------------------------------------------------------------
|
906
|
+
*'NERDTreeWinPos'*
|
907
|
+
Values: "left" or "right"
|
908
|
+
Default: "left".
|
909
|
+
|
910
|
+
This option is used to determine where NERD tree window is placed on the
|
911
|
+
screen.
|
912
|
+
|
913
|
+
This option makes it possible to use two different explorer plugins
|
914
|
+
simultaneously. For example, you could have the taglist plugin on the left of
|
915
|
+
the window and the NERD tree on the right.
|
916
|
+
|
917
|
+
------------------------------------------------------------------------------
|
918
|
+
*'NERDTreeWinSize'*
|
919
|
+
Values: a positive integer.
|
920
|
+
Default: 31.
|
921
|
+
|
922
|
+
This option is used to change the size of the NERD tree when it is loaded.
|
923
|
+
|
924
|
+
==============================================================================
|
925
|
+
4. The NERD tree API *NERDTreeAPI*
|
926
|
+
|
927
|
+
The NERD tree script allows you to add custom key mappings and menu items via
|
928
|
+
a set of API calls. Any scripts that use this API should be placed in
|
929
|
+
~/.vim/nerdtree_plugin/ (*nix) or ~/vimfiles/nerdtree_plugin (windows).
|
930
|
+
|
931
|
+
The script exposes some prototype objects that can be used to manipulate the
|
932
|
+
tree and/or get information from it: >
|
933
|
+
g:NERDTreePath
|
934
|
+
g:NERDTreeDirNode
|
935
|
+
g:NERDTreeFileNode
|
936
|
+
g:NERDTreeBookmark
|
937
|
+
<
|
938
|
+
See the code/comments in NERD_tree.vim to find how to use these objects. The
|
939
|
+
following code conventions are used:
|
940
|
+
* class members start with a capital letter
|
941
|
+
* instance members start with a lower case letter
|
942
|
+
* private members start with an underscore
|
943
|
+
|
944
|
+
See this blog post for more details:
|
945
|
+
http://got-ravings.blogspot.com/2008/09/vim-pr0n-prototype-based-objects.html
|
946
|
+
|
947
|
+
------------------------------------------------------------------------------
|
948
|
+
4.1. Key map API *NERDTreeKeymapAPI*
|
949
|
+
|
950
|
+
NERDTreeAddKeyMap({options}) *NERDTreeAddKeyMap()*
|
951
|
+
Adds a new keymapping for all NERD tree buffers.
|
952
|
+
{options} must be a dictionary, and must contain the following keys:
|
953
|
+
"key" - the trigger key for the new mapping
|
954
|
+
"callback" - the function the new mapping will be bound to
|
955
|
+
"quickhelpText" - the text that will appear in the quickhelp (see
|
956
|
+
|NERDTree-?|)
|
957
|
+
|
958
|
+
Example: >
|
959
|
+
call NERDTreeAddKeyMap({
|
960
|
+
\ 'key': 'b',
|
961
|
+
\ 'callback': 'NERDTreeEchoCurrentNode',
|
962
|
+
\ 'quickhelpText': 'echo full path of current node' })
|
963
|
+
|
964
|
+
function! NERDTreeEchoCurrentNode()
|
965
|
+
let n = g:NERDTreeFileNode.GetSelected()
|
966
|
+
if n != {}
|
967
|
+
echomsg 'Current node: ' . n.path.str()
|
968
|
+
endif
|
969
|
+
endfunction
|
970
|
+
<
|
971
|
+
This code should sit in a file like ~/.vim/nerdtree_plugin/mymapping.vim.
|
972
|
+
It adds a (rather useless) mapping on 'b' which echos the full path to the
|
973
|
+
current node.
|
974
|
+
|
975
|
+
------------------------------------------------------------------------------
|
976
|
+
4.2. Menu API *NERDTreeMenuAPI*
|
977
|
+
|
978
|
+
NERDTreeAddSubmenu({options}) *NERDTreeAddSubmenu()*
|
979
|
+
Creates and returns a new submenu.
|
980
|
+
|
981
|
+
{options} must be a dictionary and must contain the following keys:
|
982
|
+
"text" - the text of the submenu that the user will see
|
983
|
+
"shortcut" - a shortcut key for the submenu (need not be unique)
|
984
|
+
|
985
|
+
The following keys are optional:
|
986
|
+
"isActiveCallback" - a function that will be called to determine whether
|
987
|
+
this submenu item will be displayed or not. The callback function must return
|
988
|
+
0 or 1.
|
989
|
+
"parent" - the parent submenu of the new submenu (returned from a previous
|
990
|
+
invocation of NERDTreeAddSubmenu()). If this key is left out then the new
|
991
|
+
submenu will sit under the top level menu.
|
992
|
+
|
993
|
+
See below for an example.
|
994
|
+
|
995
|
+
NERDTreeAddMenuItem({options}) *NERDTreeAddMenuItem()*
|
996
|
+
Adds a new menu item to the NERD tree menu (see |NERDTreeMenu|).
|
997
|
+
|
998
|
+
{options} must be a dictionary and must contain the
|
999
|
+
following keys:
|
1000
|
+
"text" - the text of the menu item which the user will see
|
1001
|
+
"shortcut" - a shortcut key for the menu item (need not be unique)
|
1002
|
+
"callback" - the function that will be called when the user activates the
|
1003
|
+
menu item.
|
1004
|
+
|
1005
|
+
The following keys are optional:
|
1006
|
+
"isActiveCallback" - a function that will be called to determine whether
|
1007
|
+
this menu item will be displayed or not. The callback function must return
|
1008
|
+
0 or 1.
|
1009
|
+
"parent" - if the menu item belongs under a submenu then this key must be
|
1010
|
+
specified. This value for this key will be the object that
|
1011
|
+
was returned when the submenu was created with |NERDTreeAddSubmenu()|.
|
1012
|
+
|
1013
|
+
See below for an example.
|
1014
|
+
|
1015
|
+
NERDTreeAddMenuSeparator([{options}]) *NERDTreeAddMenuSeparator()*
|
1016
|
+
Adds a menu separator (a row of dashes).
|
1017
|
+
|
1018
|
+
{options} is an optional dictionary that may contain the following keys:
|
1019
|
+
"isActiveCallback" - see description in |NERDTreeAddMenuItem()|.
|
1020
|
+
|
1021
|
+
Below is an example of the menu API in action. >
|
1022
|
+
call NERDTreeAddMenuSeparator()
|
1023
|
+
|
1024
|
+
call NERDTreeAddMenuItem({
|
1025
|
+
\ 'text': 'a (t)op level menu item',
|
1026
|
+
\ 'shortcut': 't',
|
1027
|
+
\ 'callback': 'SomeFunction' })
|
1028
|
+
|
1029
|
+
let submenu = NERDTreeAddSubmenu({
|
1030
|
+
\ 'text': 'a (s)ub menu',
|
1031
|
+
\ 'shortcut': 's' })
|
1032
|
+
|
1033
|
+
call NERDTreeAddMenuItem({
|
1034
|
+
\ 'text': '(n)ested item 1',
|
1035
|
+
\ 'shortcut': 'n',
|
1036
|
+
\ 'callback': 'SomeFunction',
|
1037
|
+
\ 'parent': submenu })
|
1038
|
+
|
1039
|
+
call NERDTreeAddMenuItem({
|
1040
|
+
\ 'text': '(n)ested item 2',
|
1041
|
+
\ 'shortcut': 'n',
|
1042
|
+
\ 'callback': 'SomeFunction',
|
1043
|
+
\ 'parent': submenu })
|
1044
|
+
<
|
1045
|
+
This will create the following menu: >
|
1046
|
+
--------------------
|
1047
|
+
a (t)op level menu item
|
1048
|
+
a (s)ub menu
|
1049
|
+
<
|
1050
|
+
Where selecting "a (s)ub menu" will lead to a second menu: >
|
1051
|
+
(n)ested item 1
|
1052
|
+
(n)ested item 2
|
1053
|
+
<
|
1054
|
+
When any of the 3 concrete menu items are selected the function "SomeFunction"
|
1055
|
+
will be called.
|
1056
|
+
|
1057
|
+
------------------------------------------------------------------------------
|
1058
|
+
NERDTreeRender() *NERDTreeRender()*
|
1059
|
+
Re-renders the NERD tree buffer. Useful if you change the state of the
|
1060
|
+
tree and you want to it to be reflected in the UI.
|
1061
|
+
|
1062
|
+
==============================================================================
|
1063
|
+
5. About *NERDTreeAbout*
|
1064
|
+
|
1065
|
+
The author of the NERD tree is a terrible terrible monster called Martyzilla
|
1066
|
+
who gobbles up small children with milk and sugar for breakfast.
|
1067
|
+
|
1068
|
+
He can be reached at martin.grenfell at gmail dot com. He would love to hear
|
1069
|
+
from you, so feel free to send him suggestions and/or comments about this
|
1070
|
+
plugin. Don't be shy --- the worst he can do is slaughter you and stuff you in
|
1071
|
+
the fridge for later ;)
|
1072
|
+
|
1073
|
+
The latest stable versions can be found at
|
1074
|
+
http://www.vim.org/scripts/script.php?script_id=1658
|
1075
|
+
|
1076
|
+
The latest dev versions are on github
|
1077
|
+
http://github.com/scrooloose/nerdtree
|
1078
|
+
|
1079
|
+
|
1080
|
+
==============================================================================
|
1081
|
+
6. Changelog *NERDTreeChangelog*
|
1082
|
+
|
1083
|
+
4.1.0
|
1084
|
+
features:
|
1085
|
+
- NERDTreeFind to reveal the node for the current buffer in the tree,
|
1086
|
+
see |NERDTreeFind|. This effectively merges the FindInNERDTree plugin (by
|
1087
|
+
Doug McInnes) into the script.
|
1088
|
+
- make NERDTreeQuitOnOpen apply to the t/T keymaps too. Thanks to Stefan
|
1089
|
+
Ritter and Rémi Prévost.
|
1090
|
+
- truncate the root node if wider than the tree window. Thanks to Victor
|
1091
|
+
Gonzalez.
|
1092
|
+
|
1093
|
+
bugfixes:
|
1094
|
+
- really fix window state restoring
|
1095
|
+
- fix some win32 path escaping issues. Thanks to Stephan Baumeister, Ricky,
|
1096
|
+
jfilip1024, and Chris Chambers
|
1097
|
+
|
1098
|
+
4.0.0
|
1099
|
+
- add a new programmable menu system (see :help NERDTreeMenu).
|
1100
|
+
- add new APIs to add menus/menu-items to the menu system as well as
|
1101
|
+
custom key mappings to the NERD tree buffer (see :help NERDTreeAPI).
|
1102
|
+
- removed the old API functions
|
1103
|
+
- added a mapping to maximize/restore the size of nerd tree window, thanks
|
1104
|
+
to Guillaume Duranceau for the patch. See :help NERDTree-A for details.
|
1105
|
+
|
1106
|
+
- fix a bug where secondary nerd trees (netrw hijacked trees) and
|
1107
|
+
NERDTreeQuitOnOpen didnt play nicely, thanks to Curtis Harvey.
|
1108
|
+
- fix a bug where the script ignored directories whose name ended in a dot,
|
1109
|
+
thanks to Aggelos Orfanakos for the patch.
|
1110
|
+
- fix a bug when using the x mapping on the tree root, thanks to Bryan
|
1111
|
+
Venteicher for the patch.
|
1112
|
+
- fix a bug where the cursor position/window size of the nerd tree buffer
|
1113
|
+
wasnt being stored on closing the window, thanks to Richard Hart.
|
1114
|
+
- fix a bug where NERDTreeMirror would mirror the wrong tree
|
1115
|
+
|
1116
|
+
3.1.1
|
1117
|
+
- fix a bug where a non-listed no-name buffer was getting created every
|
1118
|
+
time the tree windows was created, thanks to Derek Wyatt and owen1
|
1119
|
+
- make <CR> behave the same as the 'o' mapping
|
1120
|
+
- some helptag fixes in the doc, thanks strull
|
1121
|
+
- fix a bug when using :set nohidden and opening a file where the previous
|
1122
|
+
buf was modified. Thanks iElectric
|
1123
|
+
- other minor fixes
|
1124
|
+
|
1125
|
+
3.1.0
|
1126
|
+
New features:
|
1127
|
+
- add mappings to open files in a vsplit, see :help NERDTree-s and :help
|
1128
|
+
NERDTree-gs
|
1129
|
+
- make the statusline for the nerd tree window default to something
|
1130
|
+
hopefully more useful. See :help 'NERDTreeStatusline'
|
1131
|
+
Bugfixes:
|
1132
|
+
- make the hijack netrw functionality work when vim is started with "vim
|
1133
|
+
<some dir>" (thanks to Alf Mikula for the patch).
|
1134
|
+
- fix a bug where the CWD wasnt being changed for some operations even when
|
1135
|
+
NERDTreeChDirMode==2 (thanks to Lucas S. Buchala)
|
1136
|
+
- add -bar to all the nerd tree :commands so they can chain with other
|
1137
|
+
:commands (thanks to tpope)
|
1138
|
+
- fix bugs when ignorecase was set (thanks to nach)
|
1139
|
+
- fix a bug with the relative path code (thanks to nach)
|
1140
|
+
- fix a bug where doing a :cd would cause :NERDTreeToggle to fail (thanks nach)
|
1141
|
+
|
1142
|
+
|
1143
|
+
3.0.1
|
1144
|
+
Bugfixes:
|
1145
|
+
- fix bugs with :NERDTreeToggle and :NERDTreeMirror when 'hidden
|
1146
|
+
was not set
|
1147
|
+
- fix a bug where :NERDTree <path> would fail if <path> was relative and
|
1148
|
+
didnt start with a ./ or ../ Thanks to James Kanze.
|
1149
|
+
- make the q mapping work with secondary (:e <dir> style) trees,
|
1150
|
+
thanks to jamessan
|
1151
|
+
- fix a bunch of small bugs with secondary trees
|
1152
|
+
|
1153
|
+
More insane refactoring.
|
1154
|
+
|
1155
|
+
3.0.0
|
1156
|
+
- hijack netrw so that doing an :edit <directory> will put a NERD tree in
|
1157
|
+
the window rather than a netrw browser. See :help 'NERDTreeHijackNetrw'
|
1158
|
+
- allow sharing of trees across tabs, see :help :NERDTreeMirror
|
1159
|
+
- remove "top" and "bottom" as valid settings for NERDTreeWinPos
|
1160
|
+
- change the '<tab>' mapping to 'i'
|
1161
|
+
- change the 'H' mapping to 'I'
|
1162
|
+
- lots of refactoring
|
1163
|
+
|
1164
|
+
==============================================================================
|
1165
|
+
7. Credits *NERDTreeCredits*
|
1166
|
+
|
1167
|
+
Thanks to the following people for testing, bug reports, ideas etc. Without
|
1168
|
+
you I probably would have got bored of the hacking the NERD tree and
|
1169
|
+
just downloaded pr0n instead.
|
1170
|
+
|
1171
|
+
Tim Carey-Smith (halorgium)
|
1172
|
+
Vigil
|
1173
|
+
Nick Brettell
|
1174
|
+
Thomas Scott Urban
|
1175
|
+
Terrance Cohen
|
1176
|
+
Yegappan Lakshmanan
|
1177
|
+
Jason Mills
|
1178
|
+
Michael Geddes (frogonwheels)
|
1179
|
+
Yu Jun
|
1180
|
+
Michael Madsen
|
1181
|
+
AOYAMA Shotaro
|
1182
|
+
Zhang Weiwu
|
1183
|
+
Niels Aan de Brugh
|
1184
|
+
Olivier Yiptong
|
1185
|
+
Zhang Shuhan
|
1186
|
+
Cory Echols
|
1187
|
+
Piotr Czachur
|
1188
|
+
Yuan Jiang
|
1189
|
+
Matan Nassau
|
1190
|
+
Maxim Kim
|
1191
|
+
Charlton Wang
|
1192
|
+
Matt Wozniski (godlygeek)
|
1193
|
+
knekk
|
1194
|
+
Sean Chou
|
1195
|
+
Ryan Penn
|
1196
|
+
Simon Peter Nicholls
|
1197
|
+
Michael Foobar
|
1198
|
+
Tomasz Chomiuk
|
1199
|
+
Denis Pokataev
|
1200
|
+
Tim Pope (tpope)
|
1201
|
+
James Kanze
|
1202
|
+
James Vega (jamessan)
|
1203
|
+
Frederic Chanal (nach)
|
1204
|
+
Alf Mikula
|
1205
|
+
Lucas S. Buchala
|
1206
|
+
Curtis Harvey
|
1207
|
+
Guillaume Duranceau
|
1208
|
+
Richard Hart (hates)
|
1209
|
+
Doug McInnes
|
1210
|
+
Stefan Ritter
|
1211
|
+
Rémi Prévost
|
1212
|
+
Victor Gonzalez
|
1213
|
+
Stephan Baumeister
|
1214
|
+
Ricky
|
1215
|
+
jfilip1024
|
1216
|
+
Chris Chambers
|
1217
|
+
|
1218
|
+
==============================================================================
|
1219
|
+
8. License *NERDTreeLicense*
|
1220
|
+
|
1221
|
+
The NERD tree is released under the wtfpl.
|
1222
|
+
See http://sam.zoy.org/wtfpl/COPYING.
|