mirror of
https://github.com/preservim/nerdtree.git
synced 2025-11-08 19:33:50 -05:00
Compare commits
76 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 |
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!)
|
||||||
|
|
||||||
75
Rakefile
75
Rakefile
@@ -1,75 +0,0 @@
|
|||||||
# written by travis jeffery <travisjeffery@gmail.com>
|
|
||||||
# contributions by scrooloose <github:scrooloose>
|
|
||||||
|
|
||||||
require 'rake'
|
|
||||||
require 'find'
|
|
||||||
require 'pathname'
|
|
||||||
|
|
||||||
IGNORE = [/\.gitignore$/, /Rakefile$/]
|
|
||||||
|
|
||||||
files = `git ls-files`.split("\n")
|
|
||||||
files.reject! { |f| IGNORE.any? { |re| f.match(re) } }
|
|
||||||
|
|
||||||
desc 'Zip up the project files'
|
|
||||||
task :zip do
|
|
||||||
zip_name = File.basename(File.dirname(__FILE__))
|
|
||||||
zip_name.gsub!(/ /, '_')
|
|
||||||
zip_name = "#{zip_name}.zip"
|
|
||||||
|
|
||||||
if File.exist?(zip_name)
|
|
||||||
abort("Zip file #{zip_name} already exists. Remove it first.")
|
|
||||||
end
|
|
||||||
|
|
||||||
puts "Creating zip file: #{zip_name}"
|
|
||||||
system("zip #{zip_name} #{files.join(" ")}")
|
|
||||||
end
|
|
||||||
|
|
||||||
desc 'Install plugin and documentation'
|
|
||||||
task :install do
|
|
||||||
vimfiles = if ENV['VIMFILES']
|
|
||||||
ENV['VIMFILES']
|
|
||||||
elsif RUBY_PLATFORM =~ /(win|w)32$/
|
|
||||||
File.expand_path("~/vimfiles")
|
|
||||||
else
|
|
||||||
File.expand_path("~/.vim")
|
|
||||||
end
|
|
||||||
files.each do |file|
|
|
||||||
target_file = File.join(vimfiles, file)
|
|
||||||
FileUtils.mkdir_p File.dirname(target_file)
|
|
||||||
FileUtils.cp file, target_file
|
|
||||||
|
|
||||||
puts "Installed #{file} to #{target_file}"
|
|
||||||
end
|
|
||||||
|
|
||||||
end
|
|
||||||
|
|
||||||
desc 'Pulls from origin'
|
|
||||||
task :pull do
|
|
||||||
puts "Updating local repo..."
|
|
||||||
system("cd " << Dir.new(File.dirname(__FILE__)).path << " && git pull")
|
|
||||||
end
|
|
||||||
|
|
||||||
desc 'Calls pull task and then install task'
|
|
||||||
task :update => ['pull', 'install'] do
|
|
||||||
puts "Update of vim script complete."
|
|
||||||
end
|
|
||||||
|
|
||||||
desc 'Uninstall plugin and documentation'
|
|
||||||
task :uninstall do
|
|
||||||
vimfiles = if ENV['VIMFILES']
|
|
||||||
ENV['VIMFILES']
|
|
||||||
elsif RUBY_PLATFORM =~ /(win|w)32$/
|
|
||||||
File.expand_path("~/vimfiles")
|
|
||||||
else
|
|
||||||
File.expand_path("~/.vim")
|
|
||||||
end
|
|
||||||
files.each do |file|
|
|
||||||
target_file = File.join(vimfiles, file)
|
|
||||||
FileUtils.rm target_file
|
|
||||||
|
|
||||||
puts "Uninstalled #{target_file}"
|
|
||||||
end
|
|
||||||
|
|
||||||
end
|
|
||||||
|
|
||||||
task :default => ['update']
|
|
||||||
@@ -128,6 +128,15 @@ The following features and functionality are provided by the NERD tree:
|
|||||||
:NERDTreeClose *:NERDTreeClose*
|
:NERDTreeClose *:NERDTreeClose*
|
||||||
Close the NERD tree in this tab.
|
Close the NERD tree in this tab.
|
||||||
|
|
||||||
|
:NERDTreeFind *:NERDTreeFind*
|
||||||
|
Find the current file in the tree.
|
||||||
|
|
||||||
|
If not tree exists and the current file is under vim's CWD, then init a
|
||||||
|
tree at the CWD and reveal the file. Otherwise init a tree in the current
|
||||||
|
file's directory.
|
||||||
|
|
||||||
|
In any case, the current file is revealed and the cursor is placed on it.
|
||||||
|
|
||||||
------------------------------------------------------------------------------
|
------------------------------------------------------------------------------
|
||||||
2.2. Bookmarks *NERDTreeBookmarks*
|
2.2. Bookmarks *NERDTreeBookmarks*
|
||||||
|
|
||||||
@@ -150,6 +159,8 @@ Note that the following commands are only available in the NERD tree buffer.
|
|||||||
:Bookmark <name>
|
:Bookmark <name>
|
||||||
Bookmark the current node as <name>. If there is already a <name>
|
Bookmark the current node as <name>. If there is already a <name>
|
||||||
bookmark, it is overwritten. <name> must not contain spaces.
|
bookmark, it is overwritten. <name> must not contain spaces.
|
||||||
|
If <name> is not provided, it defaults to the file or directory name.
|
||||||
|
For directories, a trailing slash is present.
|
||||||
|
|
||||||
:BookmarkToRoot <bookmark>
|
:BookmarkToRoot <bookmark>
|
||||||
Make the directory corresponding to <bookmark> the new root. If a treenode
|
Make the directory corresponding to <bookmark> the new root. If a treenode
|
||||||
@@ -637,6 +648,12 @@ NERD tree. These options should be set in your vimrc.
|
|||||||
|'NERDTreeWinSize'| Sets the window size when the NERD tree is
|
|'NERDTreeWinSize'| Sets the window size when the NERD tree is
|
||||||
opened.
|
opened.
|
||||||
|
|
||||||
|
|'NERDTreeMinimalUI'| Disables display of the 'Bookmarks' label and
|
||||||
|
'Press ? for help' text.
|
||||||
|
|
||||||
|
|'NERDTreeDirArrows'| Tells the NERD tree to use arrows instead of
|
||||||
|
+ ~ chars when displaying directories.
|
||||||
|
|
||||||
------------------------------------------------------------------------------
|
------------------------------------------------------------------------------
|
||||||
3.2. Customisation details *NERDTreeOptionDetails*
|
3.2. Customisation details *NERDTreeOptionDetails*
|
||||||
|
|
||||||
@@ -803,7 +820,7 @@ Values: 0 or 1.
|
|||||||
Default: 0
|
Default: 0
|
||||||
|
|
||||||
If set to 1, the NERD tree window will close after opening a file with the
|
If set to 1, the NERD tree window will close after opening a file with the
|
||||||
|NERDTree-o| or |NERDTree-i| mappings.
|
|NERDTree-o|, |NERDTree-i|, |NERDTree-t| and |NERDTree-T| mappings.
|
||||||
|
|
||||||
------------------------------------------------------------------------------
|
------------------------------------------------------------------------------
|
||||||
*'NERDTreeShowBookmarks'*
|
*'NERDTreeShowBookmarks'*
|
||||||
@@ -916,6 +933,30 @@ Default: 31.
|
|||||||
|
|
||||||
This option is used to change the size of the NERD tree when it is loaded.
|
This option is used to change the size of the NERD tree when it is loaded.
|
||||||
|
|
||||||
|
------------------------------------------------------------------------------
|
||||||
|
*'NERDTreeMinimalUI'*
|
||||||
|
Values: 0 or 1
|
||||||
|
Default: 0
|
||||||
|
|
||||||
|
This options disables the 'Bookmarks' label 'Press ? for help' text. Use one
|
||||||
|
of the following lines to set this option: >
|
||||||
|
let NERDTreeMinimalUI=0
|
||||||
|
let NERDTreeMinimalUI=1
|
||||||
|
<
|
||||||
|
|
||||||
|
------------------------------------------------------------------------------
|
||||||
|
*'NERDTreeDirArrows'*
|
||||||
|
Values: 0 or 1
|
||||||
|
Default: 0.
|
||||||
|
|
||||||
|
This option is used to change the default look of directory nodes displayed in
|
||||||
|
the tree. When set to 0 it shows old-school bars (|), + and ~ chars. If set to
|
||||||
|
1 it shows right and down arrows. Use one of the follow lines to set this
|
||||||
|
option: >
|
||||||
|
let NERDTreeDirArrows=0
|
||||||
|
let NERDTreeDirArrows=1
|
||||||
|
<
|
||||||
|
|
||||||
==============================================================================
|
==============================================================================
|
||||||
4. The NERD tree API *NERDTreeAPI*
|
4. The NERD tree API *NERDTreeAPI*
|
||||||
|
|
||||||
@@ -1075,6 +1116,38 @@ The latest dev versions are on github
|
|||||||
==============================================================================
|
==============================================================================
|
||||||
6. Changelog *NERDTreeChangelog*
|
6. Changelog *NERDTreeChangelog*
|
||||||
|
|
||||||
|
4.2.0
|
||||||
|
- Add NERDTreeDirArrows option to make the UI use pretty arrow chars
|
||||||
|
instead of the old +~| chars to define the tree structure (sickill)
|
||||||
|
- shift the syntax highlighting out into its own syntax file (gnap)
|
||||||
|
- add some mac specific options to the filesystem menu - for macvim
|
||||||
|
only (andersonfreitas)
|
||||||
|
- Add NERDTreeMinimalUI option to remove some non functional parts of the
|
||||||
|
nerdtree ui (camthompson)
|
||||||
|
- tweak the behaviour of :NERDTreeFind - see :help :NERDTreeFind for the
|
||||||
|
new behaviour (benjamingeiger)
|
||||||
|
- if no name is given to :Bookmark, make it default to the name of the
|
||||||
|
target file/dir (minyoung)
|
||||||
|
- use 'file' completion when doing copying, create, and move
|
||||||
|
operations (EvanDotPro)
|
||||||
|
- lots of misc bug fixes (paddyoloughlin, sdewald, camthompson, Vitaly
|
||||||
|
Bogdanov, AndrewRadev, mathias, scottstvnsn, kml, wycats, me RAWR!)
|
||||||
|
|
||||||
|
4.1.0
|
||||||
|
features:
|
||||||
|
- NERDTreeFind to reveal the node for the current buffer in the tree,
|
||||||
|
see |NERDTreeFind|. This effectively merges the FindInNERDTree plugin (by
|
||||||
|
Doug McInnes) into the script.
|
||||||
|
- make NERDTreeQuitOnOpen apply to the t/T keymaps too. Thanks to Stefan
|
||||||
|
Ritter and Rémi Prévost.
|
||||||
|
- truncate the root node if wider than the tree window. Thanks to Victor
|
||||||
|
Gonzalez.
|
||||||
|
|
||||||
|
bugfixes:
|
||||||
|
- really fix window state restoring
|
||||||
|
- fix some win32 path escaping issues. Thanks to Stephan Baumeister, Ricky,
|
||||||
|
jfilip1024, and Chris Chambers
|
||||||
|
|
||||||
4.0.0
|
4.0.0
|
||||||
- add a new programmable menu system (see :help NERDTreeMenu).
|
- add a new programmable menu system (see :help NERDTreeMenu).
|
||||||
- add new APIs to add menus/menu-items to the menu system as well as
|
- add new APIs to add menus/menu-items to the menu system as well as
|
||||||
@@ -1186,6 +1259,30 @@ just downloaded pr0n instead.
|
|||||||
Curtis Harvey
|
Curtis Harvey
|
||||||
Guillaume Duranceau
|
Guillaume Duranceau
|
||||||
Richard Hart (hates)
|
Richard Hart (hates)
|
||||||
|
Doug McInnes
|
||||||
|
Stefan Ritter
|
||||||
|
Rémi Prévost
|
||||||
|
Victor Gonzalez
|
||||||
|
Stephan Baumeister
|
||||||
|
Ricky
|
||||||
|
jfilip1024
|
||||||
|
Chris Chambers
|
||||||
|
Vitaly Bogdanov
|
||||||
|
Patrick O'Loughlin (paddyoloughlin)
|
||||||
|
Cam Thompson (camthompson)
|
||||||
|
Marcin Kulik (sickill)
|
||||||
|
Steve DeWald (sdewald)
|
||||||
|
Ivan Necas (iNecas)
|
||||||
|
George Ang (gnap)
|
||||||
|
Evan Coury (EvanDotPro)
|
||||||
|
Andrew Radev (AndrewRadev)
|
||||||
|
Matt Gauger (mathias)
|
||||||
|
Scott Stevenson (scottstvnsn)
|
||||||
|
Anderson Freitas (andersonfreitas)
|
||||||
|
Kamil K. Lemański (kml)
|
||||||
|
Yehuda Katz (wycats)
|
||||||
|
Min-Young Wu (minyoung)
|
||||||
|
Benjamin Geiger (benjamingeiger)
|
||||||
|
|
||||||
==============================================================================
|
==============================================================================
|
||||||
8. License *NERDTreeLicense*
|
8. License *NERDTreeLicense*
|
||||||
|
|||||||
@@ -16,8 +16,15 @@ endif
|
|||||||
let g:loaded_nerdtree_fs_menu = 1
|
let g:loaded_nerdtree_fs_menu = 1
|
||||||
|
|
||||||
call NERDTreeAddMenuItem({'text': '(a)dd a childnode', 'shortcut': 'a', 'callback': 'NERDTreeAddNode'})
|
call NERDTreeAddMenuItem({'text': '(a)dd a childnode', 'shortcut': 'a', 'callback': 'NERDTreeAddNode'})
|
||||||
call NERDTreeAddMenuItem({'text': '(m)ove the curent node', 'shortcut': 'm', 'callback': 'NERDTreeMoveNode'})
|
call NERDTreeAddMenuItem({'text': '(m)ove the current node', 'shortcut': 'm', 'callback': 'NERDTreeMoveNode'})
|
||||||
call NERDTreeAddMenuItem({'text': '(d)elete the curent node', 'shortcut': 'd', 'callback': 'NERDTreeDeleteNode'})
|
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()
|
if g:NERDTreePath.CopyingSupported()
|
||||||
call NERDTreeAddMenuItem({'text': '(c)copy the current node', 'shortcut': 'c', 'callback': 'NERDTreeCopyNode'})
|
call NERDTreeAddMenuItem({'text': '(c)copy the current node', 'shortcut': 'c', 'callback': 'NERDTreeCopyNode'})
|
||||||
endif
|
endif
|
||||||
@@ -57,7 +64,7 @@ function! NERDTreeAddNode()
|
|||||||
let newNodeName = input("Add a childnode\n".
|
let newNodeName = input("Add a childnode\n".
|
||||||
\ "==========================================================\n".
|
\ "==========================================================\n".
|
||||||
\ "Enter the dir/file name to be created. Dirs end with a '/'\n" .
|
\ "Enter the dir/file name to be created. Dirs end with a '/'\n" .
|
||||||
\ "", curDirNode.path.str({'format': 'Glob'}) . g:NERDTreePath.Slash())
|
\ "", curDirNode.path.str() . g:NERDTreePath.Slash(), "file")
|
||||||
|
|
||||||
if newNodeName ==# ''
|
if newNodeName ==# ''
|
||||||
call s:echo("Node Creation Aborted.")
|
call s:echo("Node Creation Aborted.")
|
||||||
@@ -85,7 +92,7 @@ function! NERDTreeMoveNode()
|
|||||||
let newNodePath = input("Rename the current node\n" .
|
let newNodePath = input("Rename the current node\n" .
|
||||||
\ "==========================================================\n" .
|
\ "==========================================================\n" .
|
||||||
\ "Enter the new path for the node: \n" .
|
\ "Enter the new path for the node: \n" .
|
||||||
\ "", curNode.path.str())
|
\ "", curNode.path.str(), "file")
|
||||||
|
|
||||||
if newNodePath ==# ''
|
if newNodePath ==# ''
|
||||||
call s:echo("Node Renaming Aborted.")
|
call s:echo("Node Renaming Aborted.")
|
||||||
@@ -163,7 +170,7 @@ function! NERDTreeCopyNode()
|
|||||||
let newNodePath = input("Copy the current node\n" .
|
let newNodePath = input("Copy the current node\n" .
|
||||||
\ "==========================================================\n" .
|
\ "==========================================================\n" .
|
||||||
\ "Enter the new path to copy the node to: \n" .
|
\ "Enter the new path to copy the node to: \n" .
|
||||||
\ "", currentNode.path.str())
|
\ "", currentNode.path.str(), "file")
|
||||||
|
|
||||||
if newNodePath != ""
|
if newNodePath != ""
|
||||||
"strip trailing slash
|
"strip trailing slash
|
||||||
@@ -179,8 +186,10 @@ function! NERDTreeCopyNode()
|
|||||||
if confirmed
|
if confirmed
|
||||||
try
|
try
|
||||||
let newNode = currentNode.copy(newNodePath)
|
let newNode = currentNode.copy(newNodePath)
|
||||||
call NERDTreeRender()
|
if !empty(newNode)
|
||||||
call newNode.putCursorHere(0, 0)
|
call NERDTreeRender()
|
||||||
|
call newNode.putCursorHere(0, 0)
|
||||||
|
endif
|
||||||
catch /^NERDTree/
|
catch /^NERDTree/
|
||||||
call s:echoWarning("Could not copy node")
|
call s:echoWarning("Could not copy node")
|
||||||
endtry
|
endtry
|
||||||
@@ -191,4 +200,25 @@ function! NERDTreeCopyNode()
|
|||||||
redraw
|
redraw
|
||||||
endfunction
|
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:
|
" vim: set sw=4 sts=4 et fdm=marker:
|
||||||
|
|||||||
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