mirror of
https://github.com/preservim/nerdtree.git
synced 2025-11-08 11:23:48 -05:00
Compare commits
498 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
205367ab3f | ||
|
|
4bd0def6fb | ||
|
|
4411344f7c | ||
|
|
7ff9def95b | ||
|
|
b3b394c329 | ||
|
|
4dd1bc9ef6 | ||
|
|
1b4dfc8745 | ||
|
|
0747198ee3 | ||
|
|
23d1746bbf | ||
|
|
aa28ae7863 | ||
|
|
02f1d828d9 | ||
|
|
b528910e7a | ||
|
|
dcccd0e532 | ||
|
|
af833e3006 | ||
|
|
82c93a6448 | ||
|
|
49b88757b0 | ||
|
|
30f6bcc30c | ||
|
|
796a40b5d7 | ||
|
|
1c568a4916 | ||
|
|
12f692f436 | ||
|
|
9b5851c36c | ||
|
|
077e330b64 | ||
|
|
86364c2150 | ||
|
|
2dd198c6c4 | ||
|
|
c08d7e9f19 | ||
|
|
5bd641834d | ||
|
|
2fbd578a77 | ||
|
|
04aa45fcd8 | ||
|
|
71d6c1d3c6 | ||
|
|
063e4d0870 | ||
|
|
70ba0d60ec | ||
|
|
1cd50482d2 | ||
|
|
bf73470723 | ||
|
|
2e072fe0e2 | ||
|
|
7f5a8c3aac | ||
|
|
f621df68ae | ||
|
|
6a6ffe2ad6 | ||
|
|
1dd345c56d | ||
|
|
bc0c64ef82 | ||
|
|
702a88956b | ||
|
|
fad6f06ace | ||
|
|
e697444f29 | ||
|
|
d595605ff1 | ||
|
|
b9e970d934 | ||
|
|
999ba49857 | ||
|
|
21bd141866 | ||
|
|
e88f436302 | ||
|
|
2d17132f48 | ||
|
|
8accb0978e | ||
|
|
867de91643 | ||
|
|
1de3c22a44 | ||
|
|
eac32148a4 | ||
|
|
37bfae0d2f | ||
|
|
2504666a72 | ||
|
|
9e415dcc6d | ||
|
|
e4efdb3bd4 | ||
|
|
721ad3ecc2 | ||
|
|
8618929e9a | ||
|
|
b3df8fb1e6 | ||
|
|
492f491056 | ||
|
|
7650cdc662 | ||
|
|
a72cb80337 | ||
|
|
e1abd4d373 | ||
|
|
37859888b5 | ||
|
|
88aaba22b5 | ||
|
|
a997ab3341 | ||
|
|
153041ac93 | ||
|
|
68cb5fc2eb | ||
|
|
ee7aafb135 | ||
|
|
b047d7f312 | ||
|
|
1537d42706 | ||
|
|
4b566f153f | ||
|
|
f34986d30f | ||
|
|
a713a86f06 | ||
|
|
08bc9870bc | ||
|
|
94e085f1a2 | ||
|
|
241f2e9dfe | ||
|
|
c864c6e463 | ||
|
|
bc55f3dda8 | ||
|
|
39a3a78729 | ||
|
|
31f65b97b1 | ||
|
|
3837ea85e0 | ||
|
|
fedd5f1162 | ||
|
|
dc108f555e | ||
|
|
93a0a422b4 | ||
|
|
e899bed4d7 | ||
|
|
87fbc2e5e4 | ||
|
|
cf61ad3285 | ||
|
|
f772cfdefb | ||
|
|
a1e7bc0b01 | ||
|
|
e5c79fc5c1 | ||
|
|
a3b05e8e38 | ||
|
|
89cfedd39b | ||
|
|
1be18ed53c | ||
|
|
e2265ec3b3 | ||
|
|
5ba3b3a5a8 | ||
|
|
6a513e4340 | ||
|
|
1ea2a0c29b | ||
|
|
3a163fca64 | ||
|
|
36e4402550 | ||
|
|
effb5d4de0 | ||
|
|
a854feeb1e | ||
|
|
cbb0a8698f | ||
|
|
d21b00c767 | ||
|
|
5311777308 | ||
|
|
7a5685af57 | ||
|
|
38e2bcaf85 | ||
|
|
0dda0ce5d7 | ||
|
|
8fc72fd352 | ||
|
|
dc3f1b5edf | ||
|
|
dd38ab8f43 | ||
|
|
7051977808 | ||
|
|
d9f315d63e | ||
|
|
5e9635dfa4 | ||
|
|
f2a9e9a360 | ||
|
|
1080246af9 | ||
|
|
fcb4ec0303 | ||
|
|
8211554efa | ||
|
|
464699215c | ||
|
|
10bb62a728 | ||
|
|
46710bfb25 | ||
|
|
fcb54eee12 | ||
|
|
a686be5c31 | ||
|
|
bd5e5d71b5 | ||
|
|
711c8e3328 | ||
|
|
ec1f7e3e6e | ||
|
|
8535a906be | ||
|
|
eef8a7b280 | ||
|
|
891f0ed3a2 | ||
|
|
e93bf0632b | ||
|
|
31c0ec6d63 | ||
|
|
fc3cb76695 | ||
|
|
389f33ea81 | ||
|
|
abc0cc4c40 | ||
|
|
1654ef820b | ||
|
|
df3485ec64 | ||
|
|
59257d7a3a | ||
|
|
a052a0db65 | ||
|
|
65dd1137da | ||
|
|
236d20946c | ||
|
|
a796715ac1 | ||
|
|
abfd4fef76 | ||
|
|
95acf7dd25 | ||
|
|
02b3cec827 | ||
|
|
c3a2f88b63 | ||
|
|
bc2a628a10 | ||
|
|
6518d1eb4c | ||
|
|
a2ead3545e | ||
|
|
a163f327eb | ||
|
|
e9d6a7209c | ||
|
|
f0290b08dd | ||
|
|
51637ec6d4 | ||
|
|
4d77c3ae45 | ||
|
|
a7f9abe827 | ||
|
|
41029aef24 | ||
|
|
c75a022a23 | ||
|
|
1acf6321a5 | ||
|
|
e164980d84 | ||
|
|
71ebe27a8d | ||
|
|
e7ebee3084 | ||
|
|
1239f78baf | ||
|
|
5f4c005771 | ||
|
|
9e0a0b6a43 | ||
|
|
5c85d28285 | ||
|
|
f65bc62fac | ||
|
|
9b12953343 | ||
|
|
84f9793231 | ||
|
|
1f46ecf4b8 | ||
|
|
eef90bf320 | ||
|
|
3796a8799a | ||
|
|
c726655d23 | ||
|
|
bdfac3e25c | ||
|
|
faf1459ce5 | ||
|
|
02751f4d11 | ||
|
|
992c9f24eb | ||
|
|
8164fa09d3 | ||
|
|
5e50601788 | ||
|
|
23e79de2c2 | ||
|
|
4accc8a79c | ||
|
|
7522cbf4f0 | ||
|
|
3a25a594ca | ||
|
|
40374e5056 | ||
|
|
4e4fb179e7 | ||
|
|
0f2effb049 | ||
|
|
63ee15ca6e | ||
|
|
f8a105d972 | ||
|
|
f2707106bd | ||
|
|
1586cfdb03 | ||
|
|
ca8b1d2b34 | ||
|
|
100d8d2a47 | ||
|
|
efe03d6988 | ||
|
|
7b59186dfe | ||
|
|
e9f403ac44 | ||
|
|
2038f38026 | ||
|
|
6e9a5d4cea | ||
|
|
495e906169 | ||
|
|
2e6cedcad7 | ||
|
|
d76f936698 | ||
|
|
0e9feaede3 | ||
|
|
cd55e2d522 | ||
|
|
3d2bf2d9ac | ||
|
|
2f4d1b93e8 | ||
|
|
f06d99f7b5 | ||
|
|
1b13fb05ea | ||
|
|
f90da509e1 | ||
|
|
c8afb6d92d | ||
|
|
b0950d1593 | ||
|
|
9f569c61f9 | ||
|
|
7874b3c60e | ||
|
|
99afbe9ec8 | ||
|
|
78aa2fa1db | ||
|
|
111e309507 | ||
|
|
7a86663128 | ||
|
|
6f24013463 | ||
|
|
d508c231b5 | ||
|
|
8f7e2bb98a | ||
|
|
39fc42d1cf | ||
|
|
7f6603ea4a | ||
|
|
3b1289ba40 | ||
|
|
6464cff113 | ||
|
|
4f5599e275 | ||
|
|
f98a3f9eab | ||
|
|
c9c67b5b67 | ||
|
|
3803db5555 | ||
|
|
a33849ef9b | ||
|
|
b09e0fbfa4 | ||
|
|
402fea6902 | ||
|
|
589036f5c9 | ||
|
|
d3b2258acb | ||
|
|
6103a308af | ||
|
|
8d20ae913a | ||
|
|
9fc7fb8d51 | ||
|
|
6da7f317a3 | ||
|
|
d0d755ff87 | ||
|
|
56b5446eaf | ||
|
|
88020835d6 | ||
|
|
d4b78be306 | ||
|
|
5ff836ed26 | ||
|
|
6b4dca7361 | ||
|
|
7ac998fafc | ||
|
|
888934a3be | ||
|
|
fb5ee9fbc2 | ||
|
|
b2c56e94c9 | ||
|
|
3e5faf9c56 | ||
|
|
b0297c5c91 | ||
|
|
9aba1c17f6 | ||
|
|
0fc5d3f656 | ||
|
|
729abf8e9b | ||
|
|
96215c5da6 | ||
|
|
f4c455bc2f | ||
|
|
22904e41de | ||
|
|
d49c742daf | ||
|
|
a59a2f6177 | ||
|
|
2f399b9ba4 | ||
|
|
4b61723952 | ||
|
|
00ab690758 | ||
|
|
d4b4d69469 | ||
|
|
283559bd97 | ||
|
|
38442b06d4 | ||
|
|
ae0d744357 | ||
|
|
094074d8c6 | ||
|
|
9b192b4be4 | ||
|
|
5fcdd03f12 | ||
|
|
d89dbd354a | ||
|
|
ed273e108d | ||
|
|
03dec4cde4 | ||
|
|
171c3825fa | ||
|
|
be2e602efa | ||
|
|
2ca4573b01 | ||
|
|
cdc005f46a | ||
|
|
19d5aaa513 | ||
|
|
83966b7563 | ||
|
|
b2b2bdfccd | ||
|
|
cf8c54689b | ||
|
|
a8cd995624 | ||
|
|
82a6064803 | ||
|
|
f8b51d01b7 | ||
|
|
3cbb73a63c | ||
|
|
d24a421efd | ||
|
|
6cf4e9a763 | ||
|
|
2e26da9666 | ||
|
|
e102abe98f | ||
|
|
4c1362aff8 | ||
|
|
1a4cf45f03 | ||
|
|
374df70218 | ||
|
|
a57b867ee6 | ||
|
|
927aebfa8b | ||
|
|
4f0a39159a | ||
|
|
76d2ecbb17 | ||
|
|
73322e88d2 | ||
|
|
0620b91efa | ||
|
|
ea4d4ff80d | ||
|
|
45c33fe0f6 | ||
|
|
fe249e20b9 | ||
|
|
e819e13a5d | ||
|
|
5c95fbda65 | ||
|
|
3e217115bc | ||
|
|
5d564fdbcf | ||
|
|
8184b964bc | ||
|
|
0daeebc0eb | ||
|
|
5939fdb140 | ||
|
|
9dd850b672 | ||
|
|
21601d9c3d | ||
|
|
332a1baedd | ||
|
|
e8aadb77b8 | ||
|
|
31c1faea32 | ||
|
|
818a53003e | ||
|
|
78419f858c | ||
|
|
b1d10a12fa | ||
|
|
f404cdd54b | ||
|
|
c463234452 | ||
|
|
b1020ad9c8 | ||
|
|
0ad0d195e5 | ||
|
|
43bf05c42e | ||
|
|
236df49362 | ||
|
|
bccd73c8f5 | ||
|
|
fd487dfa5c | ||
|
|
3cb3227d56 | ||
|
|
f183d60b13 | ||
|
|
8c8cd29142 | ||
|
|
83e8c144ed | ||
|
|
06c7c53127 | ||
|
|
ec682b1f9b | ||
|
|
7a15d9879f | ||
|
|
dea37444bc | ||
|
|
f5a20e5379 | ||
|
|
a0573c51b1 | ||
|
|
d0cb14c7ce | ||
|
|
f2b2327c24 | ||
|
|
9d5a940be3 | ||
|
|
38d91b66b0 | ||
|
|
65ebd30334 | ||
|
|
1998cef2b4 | ||
|
|
030cff2eda | ||
|
|
02facac20a | ||
|
|
7789ccb90a | ||
|
|
d497c9ae9c | ||
|
|
cdf1e8d6e9 | ||
|
|
5f4a002787 | ||
|
|
c34968d282 | ||
|
|
f76f983182 | ||
|
|
312ce93bb4 | ||
|
|
06776557cf | ||
|
|
d831cbf17b | ||
|
|
aad2259522 | ||
|
|
e1bd98fc7c | ||
|
|
7ca9b07b68 | ||
|
|
1532bf1922 | ||
|
|
ac544460e4 | ||
|
|
d2989eb3e0 | ||
|
|
73be034d5e | ||
|
|
b5d6736f76 | ||
|
|
1c38ffd30b | ||
|
|
8e4b3565f8 | ||
|
|
31445645f7 | ||
|
|
fc053917d8 | ||
|
|
201df0a782 | ||
|
|
b59a7cd979 | ||
|
|
8f7aed712b | ||
|
|
3e946b1b4f | ||
|
|
2a16431b2d | ||
|
|
6815622d2c | ||
|
|
5c32c2a226 | ||
|
|
b363396a93 | ||
|
|
87382097df | ||
|
|
e6d2f12bf6 | ||
|
|
43ee096cee | ||
|
|
2b1eecebb2 | ||
|
|
c0d83f95a8 | ||
|
|
01ded5d150 | ||
|
|
5884cf3774 | ||
|
|
d15818bafa | ||
|
|
f74ec0661d | ||
|
|
d68dcd252e | ||
|
|
30bfb6e6b7 | ||
|
|
bfa5de8c55 | ||
|
|
6a665a588f | ||
|
|
55ff76171a | ||
|
|
a701bb71c4 | ||
|
|
6343639193 | ||
|
|
5ce5c62611 | ||
|
|
3ebff6ae54 | ||
|
|
d9a03f4600 | ||
|
|
59b132f0f7 | ||
|
|
d56bf992d2 | ||
|
|
efa7941c54 | ||
|
|
808850a464 | ||
|
|
24ad44b46f | ||
|
|
737ad58740 | ||
|
|
a856622f0c | ||
|
|
ce79c243a3 | ||
|
|
e1b369f34e | ||
|
|
0a73777381 | ||
|
|
176b551af0 | ||
|
|
95ee07c9d3 | ||
|
|
b58ccce913 | ||
|
|
b60bcb6cb2 | ||
|
|
f7e8c453ea | ||
|
|
58ccd230fa | ||
|
|
866df769b5 | ||
|
|
bd3b03fd79 | ||
|
|
9030ff0312 | ||
|
|
5172efc976 | ||
|
|
b252a1250a | ||
|
|
dae5c93fec | ||
|
|
004b4fc9dd | ||
|
|
7614f745ae | ||
|
|
585b5f1579 | ||
|
|
bc41c51f93 | ||
|
|
0888f6c011 | ||
|
|
df8f132d6e | ||
|
|
d7a319c3a6 | ||
|
|
5a45ea08c4 | ||
|
|
ec7e013150 | ||
|
|
5b35d0bb31 | ||
|
|
40ccf3cd45 | ||
|
|
1b17f945a3 | ||
|
|
421431b5df | ||
|
|
26983f1921 | ||
|
|
1571274aec | ||
|
|
a111af5361 | ||
|
|
64514e3ceb | ||
|
|
bcc690a141 | ||
|
|
397dee5cb1 | ||
|
|
dbb0677749 | ||
|
|
0fed73d83a | ||
|
|
3a437b402a | ||
|
|
1d9564db54 | ||
|
|
c63e183acf | ||
|
|
6334e99192 | ||
|
|
776aeef26f | ||
|
|
1d6516b96d | ||
|
|
995f7faec3 | ||
|
|
140deac284 | ||
|
|
6e24eed04a | ||
|
|
82c1fece9f | ||
|
|
371379a860 | ||
|
|
0a91f3511e | ||
|
|
192424429d | ||
|
|
3092355648 | ||
|
|
ae50662943 | ||
|
|
8529b6f0e3 | ||
|
|
d718f1098c | ||
|
|
0501fc825c | ||
|
|
05ce3ab896 | ||
|
|
642c2b76fc | ||
|
|
6b7760e6e4 | ||
|
|
5cafc7018d | ||
|
|
332756282a | ||
|
|
bcc1180510 | ||
|
|
2ecd6ebd63 | ||
|
|
5a4ef66db2 | ||
|
|
a537e1535c | ||
|
|
44e8534f1f | ||
|
|
c108a19881 | ||
|
|
5685fa7af4 | ||
|
|
990706b725 | ||
|
|
6e60ecfee1 | ||
|
|
219d16f61a | ||
|
|
5fd7441dbe | ||
|
|
a5f86e1a8f | ||
|
|
782e60efc9 | ||
|
|
7b26dac959 | ||
|
|
600f2cac14 | ||
|
|
fb3c4f9212 | ||
|
|
24c1f6beab | ||
|
|
3e507620fe | ||
|
|
a520080cc3 | ||
|
|
b747086137 | ||
|
|
7a1dbcbdb0 | ||
|
|
ce9fece626 | ||
|
|
90fd47bd00 | ||
|
|
80e0bca4dc | ||
|
|
04ea2eb0f7 | ||
|
|
25aaaaae42 | ||
|
|
8a32f5851f | ||
|
|
6018625170 | ||
|
|
c36aaf55f8 | ||
|
|
6e7960ba94 | ||
|
|
f1a9bd3c89 | ||
|
|
191dcc4068 | ||
|
|
0d62ffd5db | ||
|
|
510f890ee1 | ||
|
|
06db1cdf2c | ||
|
|
0eaaf6842c | ||
|
|
2ed6524b9d | ||
|
|
fb7f66dc47 | ||
|
|
dcf9e956a7 | ||
|
|
8aafa66eac | ||
|
|
f2ce7390b8 | ||
|
|
7275d89a35 | ||
|
|
e6479c36f3 | ||
|
|
da76bafaef | ||
|
|
ec76876a74 | ||
|
|
ef1a466342 | ||
|
|
56dd5f05ab | ||
|
|
92a006f51c | ||
|
|
7d1cc4ecec |
1
.gitignore
vendored
1
.gitignore
vendored
@@ -1,2 +1,3 @@
|
||||
*~
|
||||
*.swp
|
||||
tags
|
||||
|
||||
89
README.markdown
Normal file
89
README.markdown
Normal file
@@ -0,0 +1,89 @@
|
||||
The NERD Tree
|
||||
=============
|
||||
|
||||
Intro
|
||||
-----
|
||||
|
||||
The NERD tree allows you to explore your filesystem and to open files and
|
||||
directories. It presents the filesystem to you in the form of a tree which you
|
||||
manipulate with the keyboard and/or mouse. It also allows you to perform
|
||||
simple filesystem operations.
|
||||
|
||||
The following features and functionality are provided by the NERD tree:
|
||||
|
||||
* Files and directories are displayed in a hierarchical tree structure
|
||||
* Different highlighting is provided for the following types of nodes:
|
||||
* files
|
||||
* directories
|
||||
* sym-links
|
||||
* windows .lnk files
|
||||
* read-only files
|
||||
* executable files
|
||||
* Many (customisable) mappings are provided to manipulate the tree:
|
||||
* Mappings to open/close/explore directory nodes
|
||||
* Mappings to open files in new/existing windows/tabs
|
||||
* Mappings to change the current root of the tree
|
||||
* Mappings to navigate around the tree
|
||||
* ...
|
||||
* Directories and files can be bookmarked.
|
||||
* Most NERD tree navigation can also be done with the mouse
|
||||
* Filtering of tree content (can be toggled at runtime)
|
||||
* custom file filters to prevent e.g. vim backup files being displayed
|
||||
* optional displaying of hidden files (. files)
|
||||
* files can be "turned off" so that only directories are displayed
|
||||
* 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
|
||||
has several advantages:
|
||||
* All filesystem information is cached and is only re-read on demand
|
||||
* If you revisit a part of the tree that you left earlier in your
|
||||
session, the directory nodes will be opened/closed as you left them
|
||||
* The script remembers the cursor position and window position in the NERD
|
||||
tree so you can toggle it off (or just close the tree window) and then
|
||||
reopen it (with NERDTreeToggle) the NERD tree window will appear exactly
|
||||
as you left it
|
||||
* You can have a separate NERD tree for each tab, share trees across tabs,
|
||||
or a mix of both.
|
||||
* 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
|
||||
|
||||
Installation
|
||||
------------
|
||||
|
||||
[pathogen.vim](https://github.com/tpope/vim-pathogen) is the recommended way to install nerdtree.
|
||||
|
||||
cd ~/.vim/bundle
|
||||
git clone https://github.com/scrooloose/nerdtree.git
|
||||
|
||||
Then reload vim, run `:helptags`, and check out `:help NERD_tree.txt`.
|
||||
|
||||
|
||||
Faq
|
||||
---
|
||||
|
||||
Q. Can I have the nerdtree on every tab automatically?
|
||||
|
||||
A. Nope. If this is something you want then chances are you aren't using tabs
|
||||
and buffers as they were intended to be used. Read this
|
||||
http://stackoverflow.com/questions/102384/using-vims-tabs-like-buffers
|
||||
|
||||
If you are interested in this behavour then consider [vim-nerdtree-tabs](https://github.com/jistr/vim-nerdtree-tabs)
|
||||
|
||||
Changelog
|
||||
---------
|
||||
|
||||
4.2.0 (2011-12-28)
|
||||
|
||||
* Add NERDTreeDirArrows option to make the UI use pretty arrow chars instead of the old +~| chars to define the tree structure (sickill)
|
||||
* shift the syntax highlighting out into its own syntax file (gnap) * add some mac specific options to the filesystem menu - for macvim only (andersonfreitas)
|
||||
* Add NERDTreeMinimalUI option to remove some non functional parts of the nerdtree ui (camthompson)
|
||||
* tweak the behaviour of :NERDTreeFind - see :help :NERDTreeFind for the new behaviour (benjamingeiger)
|
||||
* if no name is given to :Bookmark, make it default to the name of the target file/dir (minyoung)
|
||||
* use 'file' completion when doing copying, create, and move operations (EvanDotPro)
|
||||
* lots of misc bug fixes (paddyoloughlin, sdewald, camthompson, Vitaly Bogdanov, AndrewRadev, mathias, scottstvnsn, kml, wycats, me RAWR!)
|
||||
|
||||
1136
doc/NERD_tree.txt
1136
doc/NERD_tree.txt
File diff suppressed because it is too large
Load Diff
41
nerdtree_plugin/exec_menuitem.vim
Normal file
41
nerdtree_plugin/exec_menuitem.vim
Normal file
@@ -0,0 +1,41 @@
|
||||
" ============================================================================
|
||||
" File: exec_menuitem.vim
|
||||
" Description: plugin for NERD Tree that provides an execute file menu item
|
||||
" Maintainer: Martin Grenfell <martin.grenfell at gmail dot com>
|
||||
" Last Change: 22 July, 2009
|
||||
" License: This program is free software. It comes without any warranty,
|
||||
" to the extent permitted by applicable law. You can redistribute
|
||||
" it and/or modify it under the terms of the Do What The Fuck You
|
||||
" Want To Public License, Version 2, as published by Sam Hocevar.
|
||||
" See http://sam.zoy.org/wtfpl/COPYING for more details.
|
||||
"
|
||||
" ============================================================================
|
||||
if exists("g:loaded_nerdtree_exec_menuitem")
|
||||
finish
|
||||
endif
|
||||
let g:loaded_nerdtree_exec_menuitem = 1
|
||||
|
||||
call NERDTreeAddMenuItem({
|
||||
\ 'text': '(!)Execute file',
|
||||
\ 'shortcut': '!',
|
||||
\ 'callback': 'NERDTreeExecFile',
|
||||
\ 'isActiveCallback': 'NERDTreeExecFileActive' })
|
||||
|
||||
function! NERDTreeExecFileActive()
|
||||
let node = g:NERDTreeFileNode.GetSelected()
|
||||
return !node.path.isDirectory && node.path.isExecutable
|
||||
endfunction
|
||||
|
||||
function! NERDTreeExecFile()
|
||||
let treenode = g:NERDTreeFileNode.GetSelected()
|
||||
echo "==========================================================\n"
|
||||
echo "Complete the command to execute (add arguments etc):\n"
|
||||
let cmd = treenode.path.str({'escape': 1})
|
||||
let cmd = input(':!', cmd . ' ')
|
||||
|
||||
if cmd != ''
|
||||
exec ':!' . cmd
|
||||
else
|
||||
echo "Aborted"
|
||||
endif
|
||||
endfunction
|
||||
224
nerdtree_plugin/fs_menu.vim
Normal file
224
nerdtree_plugin/fs_menu.vim
Normal file
@@ -0,0 +1,224 @@
|
||||
" ============================================================================
|
||||
" File: fs_menu.vim
|
||||
" Description: plugin for the NERD Tree that provides a file system menu
|
||||
" Maintainer: Martin Grenfell <martin.grenfell at gmail dot com>
|
||||
" Last Change: 17 July, 2009
|
||||
" License: This program is free software. It comes without any warranty,
|
||||
" to the extent permitted by applicable law. You can redistribute
|
||||
" it and/or modify it under the terms of the Do What The Fuck You
|
||||
" Want To Public License, Version 2, as published by Sam Hocevar.
|
||||
" See http://sam.zoy.org/wtfpl/COPYING for more details.
|
||||
"
|
||||
" ============================================================================
|
||||
if exists("g:loaded_nerdtree_fs_menu")
|
||||
finish
|
||||
endif
|
||||
let g:loaded_nerdtree_fs_menu = 1
|
||||
|
||||
call NERDTreeAddMenuItem({'text': '(a)dd a childnode', 'shortcut': 'a', 'callback': 'NERDTreeAddNode'})
|
||||
call NERDTreeAddMenuItem({'text': '(m)ove the current node', 'shortcut': 'm', 'callback': 'NERDTreeMoveNode'})
|
||||
call NERDTreeAddMenuItem({'text': '(d)elete the current node', 'shortcut': 'd', 'callback': 'NERDTreeDeleteNode'})
|
||||
|
||||
if has("gui_mac") || has("gui_macvim")
|
||||
call NERDTreeAddMenuItem({'text': '(r)eveal in Finder the current node', 'shortcut': 'r', 'callback': 'NERDTreeRevealInFinder'})
|
||||
call NERDTreeAddMenuItem({'text': '(o)pen the current node with system editor', 'shortcut': 'o', 'callback': 'NERDTreeExecuteFile'})
|
||||
call NERDTreeAddMenuItem({'text': '(q)uicklook the current node', 'shortcut': 'q', 'callback': 'NERDTreeQuickLook'})
|
||||
endif
|
||||
|
||||
if g:NERDTreePath.CopyingSupported()
|
||||
call NERDTreeAddMenuItem({'text': '(c)copy the current node', 'shortcut': 'c', 'callback': 'NERDTreeCopyNode'})
|
||||
endif
|
||||
|
||||
"FUNCTION: s:echo(msg){{{1
|
||||
function! s:echo(msg)
|
||||
redraw
|
||||
echomsg "NERDTree: " . a:msg
|
||||
endfunction
|
||||
|
||||
"FUNCTION: s:echoWarning(msg){{{1
|
||||
function! s:echoWarning(msg)
|
||||
echohl warningmsg
|
||||
call s:echo(a:msg)
|
||||
echohl normal
|
||||
endfunction
|
||||
|
||||
"FUNCTION: s:promptToDelBuffer(bufnum, msg){{{1
|
||||
"prints out the given msg and, if the user responds by pushing 'y' then the
|
||||
"buffer with the given bufnum is deleted
|
||||
"
|
||||
"Args:
|
||||
"bufnum: the buffer that may be deleted
|
||||
"msg: a message that will be echoed to the user asking them if they wish to
|
||||
" del the buffer
|
||||
function! s:promptToDelBuffer(bufnum, msg)
|
||||
echo a:msg
|
||||
if nr2char(getchar()) ==# 'y'
|
||||
exec "silent bdelete! " . a:bufnum
|
||||
endif
|
||||
endfunction
|
||||
|
||||
"FUNCTION: NERDTreeAddNode(){{{1
|
||||
function! NERDTreeAddNode()
|
||||
let curDirNode = g:NERDTreeDirNode.GetSelected()
|
||||
|
||||
let newNodeName = input("Add a childnode\n".
|
||||
\ "==========================================================\n".
|
||||
\ "Enter the dir/file name to be created. Dirs end with a '/'\n" .
|
||||
\ "", curDirNode.path.str() . g:NERDTreePath.Slash(), "file")
|
||||
|
||||
if newNodeName ==# ''
|
||||
call s:echo("Node Creation Aborted.")
|
||||
return
|
||||
endif
|
||||
|
||||
try
|
||||
let newPath = g:NERDTreePath.Create(newNodeName)
|
||||
let parentNode = b:NERDTreeRoot.findNode(newPath.getParent())
|
||||
|
||||
let newTreeNode = g:NERDTreeFileNode.New(newPath)
|
||||
if parentNode.isOpen || !empty(parentNode.children)
|
||||
call parentNode.addChild(newTreeNode, 1)
|
||||
call NERDTreeRender()
|
||||
call newTreeNode.putCursorHere(1, 0)
|
||||
endif
|
||||
catch /^NERDTree/
|
||||
call s:echoWarning("Node Not Created.")
|
||||
endtry
|
||||
endfunction
|
||||
|
||||
"FUNCTION: NERDTreeMoveNode(){{{1
|
||||
function! NERDTreeMoveNode()
|
||||
let curNode = g:NERDTreeFileNode.GetSelected()
|
||||
let newNodePath = input("Rename the current node\n" .
|
||||
\ "==========================================================\n" .
|
||||
\ "Enter the new path for the node: \n" .
|
||||
\ "", curNode.path.str(), "file")
|
||||
|
||||
if newNodePath ==# ''
|
||||
call s:echo("Node Renaming Aborted.")
|
||||
return
|
||||
endif
|
||||
|
||||
try
|
||||
let bufnum = bufnr(curNode.path.str())
|
||||
|
||||
call curNode.rename(newNodePath)
|
||||
call NERDTreeRender()
|
||||
|
||||
"if the node is open in a buffer, ask the user if they want to
|
||||
"close that buffer
|
||||
if bufnum != -1
|
||||
let prompt = "\nNode renamed.\n\nThe old file is open in buffer ". bufnum . (bufwinnr(bufnum) ==# -1 ? " (hidden)" : "") .". Delete this buffer? (yN)"
|
||||
call s:promptToDelBuffer(bufnum, prompt)
|
||||
endif
|
||||
|
||||
call curNode.putCursorHere(1, 0)
|
||||
|
||||
redraw
|
||||
catch /^NERDTree/
|
||||
call s:echoWarning("Node Not Renamed.")
|
||||
endtry
|
||||
endfunction
|
||||
|
||||
" FUNCTION: NERDTreeDeleteNode() {{{1
|
||||
function! NERDTreeDeleteNode()
|
||||
let currentNode = g:NERDTreeFileNode.GetSelected()
|
||||
let confirmed = 0
|
||||
|
||||
if currentNode.path.isDirectory
|
||||
let choice =input("Delete the current node\n" .
|
||||
\ "==========================================================\n" .
|
||||
\ "STOP! To delete this entire directory, type 'yes'\n" .
|
||||
\ "" . currentNode.path.str() . ": ")
|
||||
let confirmed = choice ==# 'yes'
|
||||
else
|
||||
echo "Delete the current node\n" .
|
||||
\ "==========================================================\n".
|
||||
\ "Are you sure you wish to delete the node:\n" .
|
||||
\ "" . currentNode.path.str() . " (yN):"
|
||||
let choice = nr2char(getchar())
|
||||
let confirmed = choice ==# 'y'
|
||||
endif
|
||||
|
||||
|
||||
if confirmed
|
||||
try
|
||||
call currentNode.delete()
|
||||
call NERDTreeRender()
|
||||
|
||||
"if the node is open in a buffer, ask the user if they want to
|
||||
"close that buffer
|
||||
let bufnum = bufnr(currentNode.path.str())
|
||||
if buflisted(bufnum)
|
||||
let prompt = "\nNode deleted.\n\nThe file is open in buffer ". bufnum . (bufwinnr(bufnum) ==# -1 ? " (hidden)" : "") .". Delete this buffer? (yN)"
|
||||
call s:promptToDelBuffer(bufnum, prompt)
|
||||
endif
|
||||
|
||||
redraw
|
||||
catch /^NERDTree/
|
||||
call s:echoWarning("Could not remove node")
|
||||
endtry
|
||||
else
|
||||
call s:echo("delete aborted")
|
||||
endif
|
||||
|
||||
endfunction
|
||||
|
||||
" FUNCTION: NERDTreeCopyNode() {{{1
|
||||
function! NERDTreeCopyNode()
|
||||
let currentNode = g:NERDTreeFileNode.GetSelected()
|
||||
let newNodePath = input("Copy the current node\n" .
|
||||
\ "==========================================================\n" .
|
||||
\ "Enter the new path to copy the node to: \n" .
|
||||
\ "", currentNode.path.str(), "file")
|
||||
|
||||
if newNodePath != ""
|
||||
"strip trailing slash
|
||||
let newNodePath = substitute(newNodePath, '\/$', '', '')
|
||||
|
||||
let confirmed = 1
|
||||
if currentNode.path.copyingWillOverwrite(newNodePath)
|
||||
call s:echo("Warning: copying may overwrite files! Continue? (yN)")
|
||||
let choice = nr2char(getchar())
|
||||
let confirmed = choice ==# 'y'
|
||||
endif
|
||||
|
||||
if confirmed
|
||||
try
|
||||
let newNode = currentNode.copy(newNodePath)
|
||||
if !empty(newNode)
|
||||
call NERDTreeRender()
|
||||
call newNode.putCursorHere(0, 0)
|
||||
endif
|
||||
catch /^NERDTree/
|
||||
call s:echoWarning("Could not copy node")
|
||||
endtry
|
||||
endif
|
||||
else
|
||||
call s:echo("Copy aborted.")
|
||||
endif
|
||||
redraw
|
||||
endfunction
|
||||
|
||||
function! NERDTreeQuickLook()
|
||||
let treenode = g:NERDTreeFileNode.GetSelected()
|
||||
if treenode != {}
|
||||
call system("qlmanage -p 2>/dev/null '" . treenode.path.str() . "'")
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! NERDTreeRevealInFinder()
|
||||
let treenode = g:NERDTreeFileNode.GetSelected()
|
||||
if treenode != {}
|
||||
let x = system("open -R '" . treenode.path.str() . "'")
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! NERDTreeExecuteFile()
|
||||
let treenode = g:NERDTreeFileNode.GetSelected()
|
||||
if treenode != {}
|
||||
let x = system("open '" . treenode.path.str() . "'")
|
||||
endif
|
||||
endfunction
|
||||
|
||||
" vim: set sw=4 sts=4 et fdm=marker:
|
||||
4600
plugin/NERD_tree.vim
4600
plugin/NERD_tree.vim
File diff suppressed because it is too large
Load Diff
88
syntax/nerdtree.vim
Normal file
88
syntax/nerdtree.vim
Normal file
@@ -0,0 +1,88 @@
|
||||
let s:tree_up_dir_line = '.. (up a dir)'
|
||||
"NERDTreeFlags are syntax items that should be invisible, but give clues as to
|
||||
"how things should be highlighted
|
||||
syn match NERDTreeFlag #\~#
|
||||
syn match NERDTreeFlag #\[RO\]#
|
||||
|
||||
"highlighting for the .. (up dir) line at the top of the tree
|
||||
execute "syn match NERDTreeUp #\\V". s:tree_up_dir_line ."#"
|
||||
|
||||
"highlighting for the ~/+ symbols for the directory nodes
|
||||
syn match NERDTreeClosable #\~\<#
|
||||
syn match NERDTreeClosable #\~\.#
|
||||
syn match NERDTreeOpenable #+\<#
|
||||
syn match NERDTreeOpenable #+\.#he=e-1
|
||||
|
||||
"highlighting for the tree structural parts
|
||||
syn match NERDTreePart #|#
|
||||
syn match NERDTreePart #`#
|
||||
syn match NERDTreePartFile #[|`]-#hs=s+1 contains=NERDTreePart
|
||||
|
||||
"quickhelp syntax elements
|
||||
syn match NERDTreeHelpKey #" \{1,2\}[^ ]*:#hs=s+2,he=e-1
|
||||
syn match NERDTreeHelpKey #" \{1,2\}[^ ]*,#hs=s+2,he=e-1
|
||||
syn match NERDTreeHelpTitle #" .*\~#hs=s+2,he=e-1 contains=NERDTreeFlag
|
||||
syn match NERDTreeToggleOn #".*(on)#hs=e-2,he=e-1 contains=NERDTreeHelpKey
|
||||
syn match NERDTreeToggleOff #".*(off)#hs=e-3,he=e-1 contains=NERDTreeHelpKey
|
||||
syn match NERDTreeHelpCommand #" :.\{-}\>#hs=s+3
|
||||
syn match NERDTreeHelp #^".*# contains=NERDTreeHelpKey,NERDTreeHelpTitle,NERDTreeFlag,NERDTreeToggleOff,NERDTreeToggleOn,NERDTreeHelpCommand
|
||||
|
||||
"highlighting for readonly files
|
||||
syn match NERDTreeRO #.*\[RO\]#hs=s+2 contains=NERDTreeFlag,NERDTreeBookmark,NERDTreePart,NERDTreePartFile
|
||||
|
||||
"highlighting for sym links
|
||||
syn match NERDTreeLink #[^-| `].* -> # contains=NERDTreeBookmark,NERDTreeOpenable,NERDTreeClosable,NERDTreeDirSlash
|
||||
|
||||
"highlighing for directory nodes and file nodes
|
||||
syn match NERDTreeDirSlash #/#
|
||||
syn match NERDTreeDir #[^-| `].*/# contains=NERDTreeLink,NERDTreeDirSlash,NERDTreeOpenable,NERDTreeClosable
|
||||
syn match NERDTreeExecFile #[|` ].*\*\($\| \)# contains=NERDTreeLink,NERDTreePart,NERDTreeRO,NERDTreePartFile,NERDTreeBookmark
|
||||
syn match NERDTreeFile #|-.*# contains=NERDTreeLink,NERDTreePart,NERDTreeRO,NERDTreePartFile,NERDTreeBookmark,NERDTreeExecFile
|
||||
syn match NERDTreeFile #`-.*# contains=NERDTreeLink,NERDTreePart,NERDTreeRO,NERDTreePartFile,NERDTreeBookmark,NERDTreeExecFile
|
||||
syn match NERDTreeCWD #^[</].*$#
|
||||
|
||||
"highlighting for bookmarks
|
||||
syn match NERDTreeBookmark # {.*}#hs=s+1
|
||||
|
||||
"highlighting for the bookmarks table
|
||||
syn match NERDTreeBookmarksLeader #^>#
|
||||
syn match NERDTreeBookmarksHeader #^>-\+Bookmarks-\+$# contains=NERDTreeBookmarksLeader
|
||||
syn match NERDTreeBookmarkName #^>.\{-} #he=e-1 contains=NERDTreeBookmarksLeader
|
||||
syn match NERDTreeBookmark #^>.*$# contains=NERDTreeBookmarksLeader,NERDTreeBookmarkName,NERDTreeBookmarksHeader
|
||||
|
||||
if exists("g:NERDChristmasTree") && g:NERDChristmasTree
|
||||
hi def link NERDTreePart Special
|
||||
hi def link NERDTreePartFile Type
|
||||
hi def link NERDTreeFile Normal
|
||||
hi def link NERDTreeExecFile Title
|
||||
hi def link NERDTreeDirSlash Identifier
|
||||
hi def link NERDTreeClosable Type
|
||||
else
|
||||
hi def link NERDTreePart Normal
|
||||
hi def link NERDTreePartFile Normal
|
||||
hi def link NERDTreeFile Normal
|
||||
hi def link NERDTreeClosable Title
|
||||
endif
|
||||
|
||||
hi def link NERDTreeBookmarksHeader statement
|
||||
hi def link NERDTreeBookmarksLeader ignore
|
||||
hi def link NERDTreeBookmarkName Identifier
|
||||
hi def link NERDTreeBookmark normal
|
||||
|
||||
hi def link NERDTreeHelp String
|
||||
hi def link NERDTreeHelpKey Identifier
|
||||
hi def link NERDTreeHelpCommand Identifier
|
||||
hi def link NERDTreeHelpTitle Macro
|
||||
hi def link NERDTreeToggleOn Question
|
||||
hi def link NERDTreeToggleOff WarningMsg
|
||||
|
||||
hi def link NERDTreeDir Directory
|
||||
hi def link NERDTreeUp Directory
|
||||
hi def link NERDTreeCWD Statement
|
||||
hi def link NERDTreeLink Macro
|
||||
hi def link NERDTreeOpenable Title
|
||||
hi def link NERDTreeFlag ignore
|
||||
hi def link NERDTreeRO WarningMsg
|
||||
hi def link NERDTreeBookmark Statement
|
||||
|
||||
hi def link NERDTreeCurrentNode Search
|
||||
Reference in New Issue
Block a user