parent
4f9e981a60
commit
a2b06bbac3
@ -116,6 +116,5 @@ See here: https://github.com/scrooloose/nerdtree/issues/433#issuecomment-9259069
|
|||||||
|
|
||||||
Use these variables in your vimrc. Note that below are default arrow symbols
|
Use these variables in your vimrc. Note that below are default arrow symbols
|
||||||
|
|
||||||
let g:NERDTreeDirArrows = 1
|
|
||||||
let g:NERDTreeDirArrowExpandable = '▸'
|
let g:NERDTreeDirArrowExpandable = '▸'
|
||||||
let g:NERDTreeDirArrowCollapsible = '▾'
|
let g:NERDTreeDirArrowCollapsible = '▾'
|
||||||
|
@ -158,13 +158,6 @@ function! s:UI.getPath(ln)
|
|||||||
return self.nerdtree.root.path
|
return self.nerdtree.root.path
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if !g:NERDTreeDirArrows
|
|
||||||
" in case called from outside the tree
|
|
||||||
if line !~# '^ *[|`'.g:NERDTreeDirArrowExpandable.g:NERDTreeDirArrowCollapsible.' ]' || line =~# '^$'
|
|
||||||
return {}
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
|
|
||||||
if line ==# s:UI.UpDirLine()
|
if line ==# s:UI.UpDirLine()
|
||||||
return self.nerdtree.root.path.getParent()
|
return self.nerdtree.root.path.getParent()
|
||||||
endif
|
endif
|
||||||
@ -311,11 +304,7 @@ endfunction
|
|||||||
|
|
||||||
"FUNCTION: s:UI.MarkupReg() {{{1
|
"FUNCTION: s:UI.MarkupReg() {{{1
|
||||||
function! s:UI.MarkupReg()
|
function! s:UI.MarkupReg()
|
||||||
if g:NERDTreeDirArrows
|
|
||||||
return '^\(['.g:NERDTreeDirArrowExpandable.g:NERDTreeDirArrowCollapsible.'] \| \+['.g:NERDTreeDirArrowExpandable.g:NERDTreeDirArrowCollapsible.'] \| \+\)'
|
return '^\(['.g:NERDTreeDirArrowExpandable.g:NERDTreeDirArrowCollapsible.'] \| \+['.g:NERDTreeDirArrowExpandable.g:NERDTreeDirArrowCollapsible.'] \| \+\)'
|
||||||
endif
|
|
||||||
|
|
||||||
return '^[ `|]*[\-+~]'
|
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
"FUNCTION: s:UI._renderBookmarks {{{1
|
"FUNCTION: s:UI._renderBookmarks {{{1
|
||||||
|
@ -22,43 +22,19 @@ syn match NERDTreeLinkDir #.*/ ->#me=e-3 containedin=NERDTreeDir
|
|||||||
"highlighing for directory nodes and file nodes
|
"highlighing for directory nodes and file nodes
|
||||||
syn match NERDTreeDirSlash #/# containedin=NERDTreeDir
|
syn match NERDTreeDirSlash #/# containedin=NERDTreeDir
|
||||||
|
|
||||||
if g:NERDTreeDirArrows
|
exec 'syn match NERDTreeClosable #'.escape(g:NERDTreeDirArrowCollapsible, '~').'# containedin=NERDTreeDir,NERDTreeFile'
|
||||||
exec 'syn match NERDTreeClosable #'.escape(g:NERDTreeDirArrowCollapsible, '~').'# containedin=NERDTreeDir,NERDTreeFile'
|
exec 'syn match NERDTreeOpenable #'.escape(g:NERDTreeDirArrowExpandable, '~').'# containedin=NERDTreeDir,NERDTreeFile'
|
||||||
exec 'syn match NERDTreeOpenable #'.escape(g:NERDTreeDirArrowExpandable, '~').'# containedin=NERDTreeDir,NERDTreeFile'
|
|
||||||
|
|
||||||
let s:dirArrows = escape(g:NERDTreeDirArrowCollapsible, '~').escape(g:NERDTreeDirArrowExpandable, '~')
|
let s:dirArrows = escape(g:NERDTreeDirArrowCollapsible, '~').escape(g:NERDTreeDirArrowExpandable, '~')
|
||||||
exec 'syn match NERDTreeDir #[^'.s:dirArrows.' ].*/#'
|
exec 'syn match NERDTreeDir #[^'.s:dirArrows.' ].*/#'
|
||||||
syn match NERDTreeExecFile #^ .*\*\($\| \)# contains=NERDTreeRO,NERDTreeBookmark
|
syn match NERDTreeExecFile #^ .*\*\($\| \)# contains=NERDTreeRO,NERDTreeBookmark
|
||||||
exec 'syn match NERDTreeFile #^[^"\.'.s:dirArrows.'] *[^'.s:dirArrows.']*# contains=NERDTreeLink,NERDTreeRO,NERDTreeBookmark,NERDTreeExecFile'
|
exec 'syn match NERDTreeFile #^[^"\.'.s:dirArrows.'] *[^'.s:dirArrows.']*# contains=NERDTreeLink,NERDTreeRO,NERDTreeBookmark,NERDTreeExecFile'
|
||||||
|
|
||||||
"highlighting for readonly files
|
"highlighting for readonly files
|
||||||
syn match NERDTreeRO # *\zs.*\ze \[RO\]# contains=NERDTreeIgnore,NERDTreeBookmark,NERDTreeFile
|
syn match NERDTreeRO # *\zs.*\ze \[RO\]# contains=NERDTreeIgnore,NERDTreeBookmark,NERDTreeFile
|
||||||
|
|
||||||
syn match NERDTreeFlags #^ *\zs\[.\]# containedin=NERDTreeFile,NERDTreeExecFile
|
syn match NERDTreeFlags #^ *\zs\[.\]# containedin=NERDTreeFile,NERDTreeExecFile
|
||||||
syn match NERDTreeFlags #\[.\]# containedin=NERDTreeDir
|
syn match NERDTreeFlags #\[.\]# containedin=NERDTreeDir
|
||||||
else
|
|
||||||
"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
|
|
||||||
|
|
||||||
syn match NERDTreeDir #[^-| `].*/# contains=NERDTreeLink,NERDTreeOpenable,NERDTreeClosable
|
|
||||||
syn match NERDTreeExecFile #[|` ].*\*\($\| \)# contains=NERDTreeLink,NERDTreePart,NERDTreePartFile,NERDTreeBookmark
|
|
||||||
syn match NERDTreeFile #|-.*# contains=NERDTreeLink,NERDTreePart,NERDTreePartFile,NERDTreeBookmark,NERDTreeExecFile
|
|
||||||
syn match NERDTreeFile #`-.*# contains=NERDTreeLink,NERDTreePart,NERDTreePartFile,NERDTreeBookmark,NERDTreeExecFile
|
|
||||||
|
|
||||||
"highlighting for readonly files
|
|
||||||
syn match NERDTreeRO #|-.*\[RO\]#he=e-5 contains=NERDTreeIgnore,NERDTreeBookmark,NERDTreePart,NERDTreePartFile
|
|
||||||
|
|
||||||
syn match NERDTreeFlags #-\[.\]# containedin=NERDTreeFile,NERDTreePartFile
|
|
||||||
syn match NERDTreeFlags #[+~]\zs\[.\]# containedin=NERDTreeDir
|
|
||||||
endif
|
|
||||||
|
|
||||||
syn match NERDTreeCWD #^[</].*$#
|
syn match NERDTreeCWD #^[</].*$#
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user