nerdtree

A tree explorer plugin for vim.
Index Commits Files Refs
commit 7954eac0063d1d0d91046b2d2f889fe4ea160a13
parent 2ec9b3dd9d6b8d11f2a3c12924f88588a846517d
Author: Martin Grenfell <martin.grenfell@gmail.com>
Date:   Tue, 26 Apr 2016 08:58:18 +0100

Merge pull request #556 from acarlson1029/readonly-glyph

Allow user-defined read-only indicator.
Diffstat:
Mlib/nerdtree/path.vim | 2+-
Mlib/nerdtree/ui.vim | 2+-
Mplugin/NERD_tree.vim | 2++
Msyntax/nerdtree.vim | 4++--
4 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/lib/nerdtree/path.vim b/lib/nerdtree/path.vim
@@ -61,7 +61,7 @@ function! s:Path.cacheDisplayString() abort
     endif
 
     if self.isReadOnly
-        let self.cachedDisplayString .=  ' [RO]'
+        let self.cachedDisplayString .=  ' ['.g:NERDTreeGlyphReadOnly.']'
     endif
 endfunction
 
diff --git a/lib/nerdtree/ui.vim b/lib/nerdtree/ui.vim
@@ -375,7 +375,7 @@ function! s:UI._stripMarkup(line, removeLeadingSpaces)
     let line = substitute (line, g:NERDTreeUI.MarkupReg(),"","")
 
     "strip off any read only flag
-    let line = substitute (line, ' \[RO\]', "","")
+    exec 'let line = substitute (line, " \['.g:NERDTreeGlyphReadOnly.'\]", "","")'
 
     "strip off any bookmark flags
     let line = substitute (line, ' {[^}]*}', "","")
diff --git a/plugin/NERD_tree.vim b/plugin/NERD_tree.vim
@@ -84,6 +84,8 @@ else
     endif
 endif
 
+call s:initVariable("g:NERDTreeGlyphReadOnly", "RO")
+
 if !exists('g:NERDTreeStatusline')
 
     "the exists() crap here is a hack to stop vim spazzing out when
diff --git a/syntax/nerdtree.vim b/syntax/nerdtree.vim
@@ -1,6 +1,6 @@
 let s:tree_up_dir_line = '.. (up a dir)'
 syn match NERDTreeIgnore #\~#
-syn match NERDTreeIgnore #\[RO\]#
+exec 'syn match NERDTreeIgnore #\['.g:NERDTreeGlyphReadOnly.'\]#'
 
 "highlighting for the .. (up dir) line at the top of the tree
 execute "syn match NERDTreeUp #\\V". s:tree_up_dir_line ."#"
@@ -31,7 +31,7 @@ syn match NERDTreeExecFile  #^ .*\*\($\| \)# contains=NERDTreeRO,NERDTreeBookmar
 exec 'syn match NERDTreeFile  #^[^"\.'.s:dirArrows.'] *[^'.s:dirArrows.']*# contains=NERDTreeLink,NERDTreeRO,NERDTreeBookmark,NERDTreeExecFile'
 
 "highlighting for readonly files
-syn match NERDTreeRO # *\zs.*\ze \[RO\]# contains=NERDTreeIgnore,NERDTreeBookmark,NERDTreeFile
+exec 'syn match NERDTreeRO # *\zs.*\ze \['.g:NERDTreeGlyphReadOnly.'\]# contains=NERDTreeIgnore,NERDTreeBookmark,NERDTreeFile'
 
 syn match NERDTreeFlags #^ *\zs\[.\]# containedin=NERDTreeFile,NERDTreeExecFile
 syn match NERDTreeFlags #\[.\]# containedin=NERDTreeDir