Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

move NERDTree plugin under pathogen bundle sub-directory

  • Loading branch information...
commit 8e3167f8e175b368dfd206a6a39090473eacfe12 1 parent 4009468
Austin Matzko authored
34 doc/NERD_tree.txt → bundle/vim-nerdtree/doc/NERD_tree.txt
View
@@ -642,12 +642,6 @@ NERD tree. These options should be set in your vimrc.
|'NERDTreeWinSize'| Sets the window size when the NERD tree is
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*
@@ -927,30 +921,6 @@ Default: 31.
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*
@@ -1110,9 +1080,6 @@ The latest dev versions are on github
==============================================================================
6. Changelog *NERDTreeChangelog*
-4.x.x
- - Fix a bug with :NERDTreeFind and symlinks. Thanks to Vitaly Bogdanov.
-
4.1.0
features:
- NERDTreeFind to reveal the node for the current buffer in the tree,
@@ -1247,7 +1214,6 @@ just downloaded pr0n instead.
Ricky
jfilip1024
Chris Chambers
- Vitaly Bogdanov
==============================================================================
8. License *NERDTreeLicense*
0  nerdtree_plugin/exec_menuitem.vim → ...le/vim-nerdtree/nerdtree_plugin/exec_menuitem.vim
View
File renamed without changes
6 nerdtree_plugin/fs_menu.vim → bundle/vim-nerdtree/nerdtree_plugin/fs_menu.vim
View
@@ -16,8 +16,8 @@ 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'})
+call NERDTreeAddMenuItem({'text': '(m)ove the curent node', 'shortcut': 'm', 'callback': 'NERDTreeMoveNode'})
+call NERDTreeAddMenuItem({'text': '(d)elete the curent node', 'shortcut': 'd', 'callback': 'NERDTreeDeleteNode'})
if g:NERDTreePath.CopyingSupported()
call NERDTreeAddMenuItem({'text': '(c)copy the current node', 'shortcut': 'c', 'callback': 'NERDTreeCopyNode'})
endif
@@ -57,7 +57,7 @@ function! NERDTreeAddNode()
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())
+ \ "", curDirNode.path.str({'format': 'Glob'}) . g:NERDTreePath.Slash())
if newNodeName ==# ''
call s:echo("Node Creation Aborted.")
300 plugin/NERD_tree.vim → bundle/vim-nerdtree/plugin/NERD_tree.vim
View
@@ -39,7 +39,7 @@ set cpo&vim
"1 if the var is set, 0 otherwise
function! s:initVariable(var, value)
if !exists(a:var)
- exec 'let ' . a:var . ' = ' . "'" . substitute(a:value, "'", "''", "g") . "'"
+ exec 'let ' . a:var . ' = ' . "'" . a:value . "'"
return 1
endif
return 0
@@ -51,7 +51,6 @@ call s:initVariable("g:NERDTreeAutoCenter", 1)
call s:initVariable("g:NERDTreeAutoCenterThreshold", 3)
call s:initVariable("g:NERDTreeCaseSensitiveSort", 0)
call s:initVariable("g:NERDTreeChDirMode", 0)
-call s:initVariable("g:NERDTreeMinimalUI", 0)
if !exists("g:NERDTreeIgnore")
let g:NERDTreeIgnore = ['\~$']
endif
@@ -66,7 +65,6 @@ call s:initVariable("g:NERDTreeShowFiles", 1)
call s:initVariable("g:NERDTreeShowHidden", 0)
call s:initVariable("g:NERDTreeShowLineNumbers", 0)
call s:initVariable("g:NERDTreeSortDirs", 1)
-call s:initVariable("g:NERDTreeDirArrows", 0)
if !exists("g:NERDTreeSortOrder")
let g:NERDTreeSortOrder = ['\/$', '*', '\.swp$', '\.bak$', '\~$']
@@ -144,12 +142,12 @@ call s:initVariable("g:NERDTreeMapUpdirKeepOpen", "U")
if s:running_windows
let s:escape_chars = " `\|\"#%&,?()\*^<>"
else
- let s:escape_chars = " \\`\|\"#%&,?()\*^<>[]"
+ let s:escape_chars = " \\`\|\"#%&,?()\*^<>"
endif
let s:NERDTreeBufName = 'NERD_tree_'
let s:tree_wid = 2
-let s:tree_markup_reg = '^[ `|]*[\-+~▾▸ ]\+'
+let s:tree_markup_reg = '^[ `|]*[\-+~]'
let s:tree_up_dir_line = '.. (up a dir)'
"the number to add to the nerd tree buffer name to make the buf name unique
@@ -196,7 +194,6 @@ function! s:Bookmark.activate()
if self.validate()
let n = s:TreeFileNode.New(self.path)
call n.open()
- call s:closeTreeIfQuitOnOpen()
endif
endif
endfunction
@@ -375,7 +372,7 @@ endfunction
" FUNCTION: Bookmark.New(name, path) {{{3
" Create a new bookmark object with the given name and path object
function! s:Bookmark.New(name, path)
- if a:name =~# ' '
+ if a:name =~ ' '
throw "NERDTree.IllegalBookmarkNameError: illegal name:" . a:name
endif
@@ -392,7 +389,7 @@ function! s:Bookmark.openInNewTab(options)
tabnew
call s:initNerdTree(self.name)
else
- exec "tabedit " . self.path.str({'format': 'Edit'})
+ exec "tabedit " . bookmark.path.str({'format': 'Edit'})
endif
if has_key(a:options, 'stayInCurrentTab')
@@ -809,23 +806,15 @@ endfunction
"FUNCTION: TreeFileNode.bookmark(name) {{{3
"bookmark this node with a:name
function! s:TreeFileNode.bookmark(name)
-
- "if a bookmark exists with the same name and the node is cached then save
- "it so we can update its display string
- let oldMarkedNode = {}
try
let oldMarkedNode = s:Bookmark.GetNodeForName(a:name, 1)
+ call oldMarkedNode.path.cacheDisplayString()
catch /^NERDTree.BookmarkNotFoundError/
- catch /^NERDTree.BookmarkedNodeNotFoundError/
endtry
call s:Bookmark.AddBookmark(a:name, self.path)
call self.path.cacheDisplayString()
call s:Bookmark.Write()
-
- if !empty(oldMarkedNode)
- call oldMarkedNode.path.cacheDisplayString()
- endif
endfunction
"FUNCTION: TreeFileNode.cacheParent() {{{3
"initializes self.parent if it isnt already
@@ -991,7 +980,7 @@ function! s:TreeFileNode.getLineNum()
"the path components we have matched so far
let pathcomponents = [substitute(b:NERDTreeRoot.path.str({'format': 'UI'}), '/ *$', '', '')]
"the index of the component we are searching for
- let curPathComponent = 0
+ let curPathComponent = 1
let fullpath = self.path.str({'format': 'UI'})
@@ -1039,7 +1028,7 @@ endfunction
"gets the line number of the root node
function! s:TreeFileNode.GetRootLineNum()
let rootLine = 1
- while getline(rootLine) !~# '^\(/\|<\)'
+ while getline(rootLine) !~ '^\(/\|<\)'
let rootLine = rootLine + 1
endwhile
return rootLine
@@ -1315,50 +1304,33 @@ function! s:TreeFileNode._renderToString(depth, drawText, vertMap, isLastChild)
"get all the leading spaces and vertical tree parts for this line
if a:depth > 1
for j in a:vertMap[0:-2]
- if g:NERDTreeDirArrows
- let treeParts = treeParts . ' '
+ if j ==# 1
+ let treeParts = treeParts . '| '
else
- if j ==# 1
- let treeParts = treeParts . '| '
- else
- let treeParts = treeParts . ' '
- endif
+ let treeParts = treeParts . ' '
endif
endfor
endif
"get the last vertical tree part for this line which will be different
"if this node is the last child of its parent
- if !g:NERDTreeDirArrows
- if a:isLastChild
- let treeParts = treeParts . '`'
- else
- let treeParts = treeParts . '|'
- endif
+ if a:isLastChild
+ let treeParts = treeParts . '`'
+ else
+ let treeParts = treeParts . '|'
endif
+
"smack the appropriate dir/file symbol on the line before the file/dir
"name itself
if self.path.isDirectory
if self.isOpen
- if g:NERDTreeDirArrows
- let treeParts = treeParts . '▾ '
- else
- let treeParts = treeParts . '~'
- endif
+ let treeParts = treeParts . '~'
else
- if g:NERDTreeDirArrows
- let treeParts = treeParts . '▸ '
- else
- let treeParts = treeParts . '+'
- endif
+ let treeParts = treeParts . '+'
endif
else
- if g:NERDTreeDirArrows
- let treeParts = treeParts . ' '
- else
- let treeParts = treeParts . '-'
- endif
+ let treeParts = treeParts . '-'
endif
let line = treeParts . self.displayString()
@@ -1621,7 +1593,7 @@ function! s:TreeDirNode._initChildren(silent)
"filter out the .. and . directories
"Note: we must match .. AND ../ cos sometimes the globpath returns
"../ for path with strange chars (eg $)
- if i !~# '\/\.\.\/\?$' && i !~# '\/\.\/\?$'
+ if i !~ '\/\.\.\/\?$' && i !~ '\/\.\/\?$'
"put the next file in a new node and attach it
try
@@ -1758,7 +1730,7 @@ function! s:TreeDirNode.refresh()
"filter out the .. and . directories
"Note: we must match .. AND ../ cos sometimes the globpath returns
"../ for path with strange chars (eg $)
- if i !~# '\/\.\.\/\?$' && i !~# '\/\.\/\?$'
+ if i !~ '\/\.\.\/\?$' && i !~ '\/\.\/\?$'
try
"create a new path and see if it exists in this nodes children
@@ -1880,9 +1852,9 @@ let s:Path = {}
function! s:Path.AbsolutePathFor(str)
let prependCWD = 0
if s:running_windows
- let prependCWD = a:str !~# '^.:\(\\\|\/\)'
+ let prependCWD = a:str !~ '^.:\(\\\|\/\)'
else
- let prependCWD = a:str !~# '^/'
+ let prependCWD = a:str !~ '^/'
endif
let toReturn = a:str
@@ -1999,7 +1971,7 @@ function! s:Path.Create(fullpath)
try
"if it ends with a slash, assume its a dir create it
- if a:fullpath =~# '\(\\\|\/\)$'
+ if a:fullpath =~ '\(\\\|\/\)$'
"whack the trailing slash off the end if it exists
let fullpath = substitute(a:fullpath, '\(\\\|\/\)$', '', '')
@@ -2029,7 +2001,7 @@ function! s:Path.copy(dest)
let dest = s:Path.WinToUnixPath(a:dest)
- let cmd = g:NERDTreeCopyCmd . " " . escape(self.str(), s:escape_chars) . " " . escape(dest, s:escape_chars)
+ let cmd = g:NERDTreeCopyCmd . " " . self.str() . " " . dest
let success = system(cmd)
if success != 0
throw "NERDTree.CopyError: Could not copy ''". self.str() ."'' to: '" . a:dest . "'"
@@ -2172,7 +2144,7 @@ endfunction
function! s:Path.getSortOrderIndex()
let i = 0
while i < len(g:NERDTreeSortOrder)
- if self.getLastPathComponent(1) =~# g:NERDTreeSortOrder[i]
+ if self.getLastPathComponent(1) =~ g:NERDTreeSortOrder[i]
return i
endif
let i = i + 1
@@ -2188,14 +2160,14 @@ function! s:Path.ignore()
"filter out the user specified paths to ignore
if b:NERDTreeIgnoreEnabled
for i in g:NERDTreeIgnore
- if lastPathComponent =~# i
+ if lastPathComponent =~ i
return 1
endif
endfor
endif
"dont show hidden files unless instructed to
- if b:NERDTreeShowHidden ==# 0 && lastPathComponent =~# '^\.'
+ if b:NERDTreeShowHidden ==# 0 && lastPathComponent =~ '^\.'
return 1
endif
@@ -2285,7 +2257,7 @@ function! s:Path.readInfoFromDisk(fullpath)
let self.isExecutable = 0
if !self.isDirectory
- let self.isExecutable = getfperm(a:fullpath) =~# 'x'
+ let self.isExecutable = getfperm(a:fullpath) =~ 'x'
endif
"grab the last part of the path (minus the trailing slash)
@@ -2304,7 +2276,7 @@ function! s:Path.readInfoFromDisk(fullpath)
"we always wanna treat MS windows shortcuts as files for
"simplicity
- if hardPath !~# '\.lnk$'
+ if hardPath !~ '\.lnk$'
let self.symLinkDest = self.symLinkDest . '/'
endif
@@ -2536,7 +2508,7 @@ endfunction
" FUNCTION: s:completeBookmarks(A,L,P) {{{2
" completion function for the bookmark commands
function! s:completeBookmarks(A,L,P)
- return filter(s:Bookmark.BookmarkNames(), 'v:val =~# "^' . a:A . '"')
+ return filter(s:Bookmark.BookmarkNames(), 'v:val =~ "^' . a:A . '"')
endfunction
" FUNCTION: s:exec(cmd) {{{2
" same as :exec cmd but eventignore=all is set for the duration
@@ -2549,7 +2521,7 @@ endfunction
" FUNCTION: s:findAndRevealPath() {{{2
function! s:findAndRevealPath()
try
- let p = s:Path.New(expand("%:p"))
+ let p = s:Path.New(expand("%"))
catch /^NERDTree.InvalidArgumentsError/
call s:echo("no file for the current buffer")
return
@@ -2583,7 +2555,7 @@ function! s:initNerdTree(name)
let dir = a:name ==# '' ? getcwd() : a:name
"hack to get an absolute path if a relative path is given
- if dir =~# '^\.'
+ if dir =~ '^\.'
let dir = getcwd() . s:Path.Slash() . dir
endif
let dir = resolve(dir)
@@ -2664,9 +2636,6 @@ function! s:initNerdTreeInPlace(dir)
setlocal nu
else
setlocal nonu
- if v:version >= 703
- setlocal nornu
- endif
endif
iabc <buffer>
@@ -2843,17 +2812,9 @@ function! s:closeTree()
endif
if winnr("$") != 1
- if winnr() == s:getTreeWinNum()
- wincmd p
- let bufnr = bufnr("")
- wincmd p
- else
- let bufnr = bufnr("")
- endif
-
call s:exec(s:getTreeWinNum() . " wincmd w")
close
- call s:exec(bufwinnr(bufnr) . " wincmd w")
+ call s:exec("wincmd p")
else
close
endif
@@ -2903,9 +2864,6 @@ function! s:createTreeWin()
setlocal nu
else
setlocal nonu
- if v:version >= 703
- setlocal nornu
- endif
endif
iabc <buffer>
@@ -3021,12 +2979,12 @@ function! s:dumpHelp()
let @h=@h."\" :OpenBookmark <name>\n"
let @h=@h."\" :ClearBookmarks [<names>]\n"
let @h=@h."\" :ClearAllBookmarks\n"
- silent! put h
- elseif g:NERDTreeMinimalUI == 0
+ else
let @h="\" Press ". g:NERDTreeMapHelp ." for help\n"
- silent! put h
endif
+ silent! put h
+
let @h = old_h
endfunction
"FUNCTION: s:echo {{{2
@@ -3092,11 +3050,9 @@ function! s:getPath(ln)
return b:NERDTreeRoot.path
endif
- if !g:NERDTreeDirArrows
- " in case called from outside the tree
- if line !~# '^ *[|`▸▾ ]' || line =~# '^$'
- return {}
- endif
+ " in case called from outside the tree
+ if line !~ '^ *[|`]' || line =~ '^$'
+ return {}
endif
if line ==# s:tree_up_dir_line
@@ -3109,7 +3065,7 @@ function! s:getPath(ln)
let curFile = s:stripMarkupFromLine(line, 0)
let wasdir = 0
- if curFile =~# '/$'
+ if curFile =~ '/$'
let wasdir = 1
let curFile = substitute(curFile, '/\?$', '/', "")
endif
@@ -3126,7 +3082,7 @@ function! s:getPath(ln)
let dir = b:NERDTreeRoot.path.str({'format': 'UI'}) . dir
break
endif
- if curLineStripped =~# '/$'
+ if curLineStripped =~ '/$'
let lpindent = s:indentLevelFor(curLine)
if lpindent < indent
let indent = indent - 1
@@ -3152,13 +3108,7 @@ function! s:getTreeWinNum()
endfunction
"FUNCTION: s:indentLevelFor(line) {{{2
function! s:indentLevelFor(line)
- let level = match(a:line, '[^ \-+~▸▾`|]') / s:tree_wid
- " check if line includes arrows
- if match(a:line, '[▸▾]') > -1
- " decrement level as arrow uses 3 ascii chars
- let level = level - 1
- endif
- return level
+ return match(a:line, '[^ \-+~`|]') / s:tree_wid
endfunction
"FUNCTION: s:isTreeOpen() {{{2
function! s:isTreeOpen()
@@ -3248,20 +3198,16 @@ function! s:putCursorOnBookmarkTable()
throw "NERDTree.IllegalOperationError: cant find bookmark table, bookmarks arent active"
endif
- if g:NERDTreeMinimalUI
- return cursor(1, 2)
- endif
-
let rootNodeLine = s:TreeFileNode.GetRootLineNum()
let line = 1
- while getline(line) !~# '^>-\+Bookmarks-\+$'
+ while getline(line) !~ '^>-\+Bookmarks-\+$'
let line = line + 1
if line >= rootNodeLine
throw "NERDTree.BookmarkTableNotFoundError: didnt find the bookmarks table"
endif
endwhile
- call cursor(line, 2)
+ call cursor(line, 0)
endfunction
"FUNCTION: s:putCursorInTreeWin(){{{2
@@ -3277,10 +3223,8 @@ endfunction
"FUNCTION: s:renderBookmarks {{{2
function! s:renderBookmarks()
- if g:NERDTreeMinimalUI == 0
- call setline(line(".")+1, ">----------Bookmarks----------")
- call cursor(line(".")+1, col("."))
- endif
+ call setline(line(".")+1, ">----------Bookmarks----------")
+ call cursor(line(".")+1, col("."))
for i in s:Bookmark.Bookmarks()
call setline(line(".")+1, i.str())
@@ -3307,20 +3251,16 @@ function! s:renderView()
call s:dumpHelp()
"delete the blank line before the help and add one after it
- if g:NERDTreeMinimalUI == 0
- call setline(line(".")+1, "")
- call cursor(line(".")+1, col("."))
- endif
+ call setline(line(".")+1, "")
+ call cursor(line(".")+1, col("."))
if b:NERDTreeShowBookmarks
call s:renderBookmarks()
endif
"add the 'up a dir' line
- if !g:NERDTreeMinimalUI
- call setline(line(".")+1, s:tree_up_dir_line)
- call cursor(line(".")+1, col("."))
- endif
+ call setline(line(".")+1, s:tree_up_dir_line)
+ call cursor(line(".")+1, col("."))
"draw the header line
let header = b:NERDTreeRoot.path.str({'format': 'UI', 'truncateTo': winwidth(0)})
@@ -3408,91 +3348,91 @@ function! s:setupStatusline()
endfunction
"FUNCTION: s:setupSyntaxHighlighting() {{{2
function! s:setupSyntaxHighlighting()
- "NERDTreeFlags are syntax items that should be invisible, but give clues as to
+ "treeFlags are syntax items that should be invisible, but give clues as to
"how things should be highlighted
- syn match NERDTreeFlag #\~#
- syn match NERDTreeFlag #\[RO\]#
+ syn match treeFlag #\~#
+ syn match treeFlag #\[RO\]#
"highlighting for the .. (up dir) line at the top of the tree
- execute "syn match NERDTreeUp #\\V". s:tree_up_dir_line ."#"
+ execute "syn match treeUp #". 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
+ syn match treeClosable #\~\<#
+ syn match treeClosable #\~\.#
+ syn match treeOpenable #+\<#
+ syn match treeOpenable #+\.#he=e-1
"highlighting for the tree structural parts
- syn match NERDTreePart #|#
- syn match NERDTreePart #`#
- syn match NERDTreePartFile #[|`]-#hs=s+1 contains=NERDTreePart
+ syn match treePart #|#
+ syn match treePart #`#
+ syn match treePartFile #[|`]-#hs=s+1 contains=treePart
"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
+ syn match treeHelpKey #" \{1,2\}[^ ]*:#hs=s+2,he=e-1
+ syn match treeHelpKey #" \{1,2\}[^ ]*,#hs=s+2,he=e-1
+ syn match treeHelpTitle #" .*\~#hs=s+2,he=e-1 contains=treeFlag
+ syn match treeToggleOn #".*(on)#hs=e-2,he=e-1 contains=treeHelpKey
+ syn match treeToggleOff #".*(off)#hs=e-3,he=e-1 contains=treeHelpKey
+ syn match treeHelpCommand #" :.\{-}\>#hs=s+3
+ syn match treeHelp #^".*# contains=treeHelpKey,treeHelpTitle,treeFlag,treeToggleOff,treeToggleOn,treeHelpCommand
"highlighting for readonly files
- syn match NERDTreeRO #.*\[RO\]#hs=s+2 contains=NERDTreeFlag,NERDTreeBookmark,NERDTreePart,NERDTreePartFile
+ syn match treeRO #.*\[RO\]#hs=s+2 contains=treeFlag,treeBookmark,treePart,treePartFile
"highlighting for sym links
- syn match NERDTreeLink #[^-| `].* -> # contains=NERDTreeBookmark,NERDTreeOpenable,NERDTreeClosable,NERDTreeDirSlash
+ syn match treeLink #[^-| `].* -> # contains=treeBookmark,treeOpenable,treeClosable,treeDirSlash
"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 #^[</].*$#
+ syn match treeDirSlash #/#
+ syn match treeDir #[^-| `].*/# contains=treeLink,treeDirSlash,treeOpenable,treeClosable
+ syn match treeExecFile #[|`]-.*\*\($\| \)# contains=treeLink,treePart,treeRO,treePartFile,treeBookmark
+ syn match treeFile #|-.*# contains=treeLink,treePart,treeRO,treePartFile,treeBookmark,treeExecFile
+ syn match treeFile #`-.*# contains=treeLink,treePart,treeRO,treePartFile,treeBookmark,treeExecFile
+ syn match treeCWD #^/.*$#
"highlighting for bookmarks
- syn match NERDTreeBookmark # {.*}#hs=s+1
+ syn match treeBookmark # {.*}#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
+ syn match treeBookmarksLeader #^>#
+ syn match treeBookmarksHeader #^>-\+Bookmarks-\+$# contains=treeBookmarksLeader
+ syn match treeBookmarkName #^>.\{-} #he=e-1 contains=treeBookmarksLeader
+ syn match treeBookmark #^>.*$# contains=treeBookmarksLeader,treeBookmarkName,treeBookmarksHeader
if 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
+ hi def link treePart Special
+ hi def link treePartFile Type
+ hi def link treeFile Normal
+ hi def link treeExecFile Title
+ hi def link treeDirSlash Identifier
+ hi def link treeClosable 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 treePart Normal
+ hi def link treePartFile Normal
+ hi def link treeFile Normal
+ hi def link treeClosable Title
+ endif
+
+ hi def link treeBookmarksHeader statement
+ hi def link treeBookmarksLeader ignore
+ hi def link treeBookmarkName Identifier
+ hi def link treeBookmark normal
+
+ hi def link treeHelp String
+ hi def link treeHelpKey Identifier
+ hi def link treeHelpCommand Identifier
+ hi def link treeHelpTitle Macro
+ hi def link treeToggleOn Question
+ hi def link treeToggleOff WarningMsg
+
+ hi def link treeDir Directory
+ hi def link treeUp Directory
+ hi def link treeCWD Statement
+ hi def link treeLink Macro
+ hi def link treeOpenable Title
+ hi def link treeFlag ignore
+ hi def link treeRO WarningMsg
+ hi def link treeBookmark Statement
hi def link NERDTreeCurrentNode Search
endfunction
@@ -3519,7 +3459,7 @@ function! s:stripMarkupFromLine(line, removeLeadingSpaces)
let line = substitute (line, '*\ze\($\| \)', "","")
let wasdir = 0
- if line =~# '/$'
+ if line =~ '/$'
let wasdir = 1
endif
let line = substitute (line,' -> .*',"","") " remove link to
@@ -3672,17 +3612,19 @@ function! s:checkForActivate()
let currentNode = s:TreeFileNode.GetSelected()
if currentNode != {}
let startToCur = strpart(getline(line(".")), 0, col("."))
+ let char = strpart(startToCur, strlen(startToCur)-1, 1)
+ "if they clicked a dir, check if they clicked on the + or ~ sign
+ "beside it
if currentNode.path.isDirectory
- if startToCur =~# s:tree_markup_reg . '$' && startToCur =~# '[+~▾▸]$'
+ if startToCur =~ s:tree_markup_reg . '$' && char =~ '[+~]'
call s:activateNode(0)
return
endif
endif
if (g:NERDTreeMouseMode ==# 2 && currentNode.path.isDirectory) || g:NERDTreeMouseMode ==# 3
- let char = strpart(startToCur, strlen(startToCur)-1, 1)
- if char !~# s:tree_markup_reg
+ if char !~ s:tree_markup_reg && startToCur !~ '\/$'
call s:activateNode(0)
return
endif
@@ -4082,7 +4024,7 @@ endfunction
"re-rendered
function! s:upDir(keepState)
let cwd = b:NERDTreeRoot.path.str({'format': 'UI'})
- if cwd ==# "/" || cwd =~# '^[^/]..$'
+ if cwd ==# "/" || cwd =~ '^[^/]..$'
call s:echo("already at top dir")
else
if !a:keepState
Please sign in to comment.
Something went wrong with that request. Please try again.