Undefined variable: g:NERDTreeDirArrowCollapsible
I am using the latest version of nerdtree with Pathogen
folder structure is like this:
.vim/autoload/pathogen.vim
.vim/bundle/nerdtree
The errors appear when I vim a directory, or toggle my quick button to bring out nerdtree via F10
map <F10> :NERDTreeToggle<CR>
Entire error message is:
Error detected while processing /home/username/.vim/bundle/nerdtree/syntax/nerdtree.vim:
line 26:
E121: Undefined variable: g:NERDTreeDirArrowCollapsible
E116: Invalid arguments for function escape(g:NERDTreeDirArrowCollapsible, '~').'# containedin=NERDTreeDir,NERDTreeFil
e'
E15: Invalid expression: 'syn match NERDTreeClosable #'.escape(g:NERDTreeDirArrowCollapsible, '~').'# containedin=NERD
TreeDir,NERDTreeFile'
As per README
add to your .vimrc
let g:NERDTreeDirArrows = 1
let g:NERDTreeDirArrowExpandable = '▸'
let g:NERDTreeDirArrowCollapsible = '▾'
Problem solved! Thanks!
Why this don't have a default value?
When I made a key binding via nmap <F5> :NERDTreeToggle<CR> and then press F5, It occurs a promble as following:
处理 /root/.vim/bundle/nerdtree/syntax/nerdtree.vim 时发生错误:
第 3 行:
E121: 未定义的变量: g:NERDTreeGlyphReadOnly
E15: 无效的表达式: 'syn match NERDTreeIgnore #\['.g:NERDTreeGlyphReadOnly.'\]#'
第 34 行:
E121: 未定义的变量: g:NERDTreeGlyphReadOnly
E15: 无效的表达式: 'syn match NERDTreeRO # *\zs.*\ze \['.g:NERDTreeGlyphReadOnly.'\]# contains=NERDTreeIgnore,NERDTreeBookmark,NERDTreeFi
le'
My OS is Ubuntu 16.04 LTS Vim Version:
8.0.599
And after press Enter,I could see the nerdtree list.
When I made a key binding via
nmap <F5> :NERDTreeToggle<CR>and then press F5, It occurs a promble as following:处理 /root/.vim/bundle/nerdtree/syntax/nerdtree.vim 时发生错误: 第 3 行: E121: 未定义的变量: g:NERDTreeGlyphReadOnly E15: 无效的表达式: 'syn match NERDTreeIgnore #\['.g:NERDTreeGlyphReadOnly.'\]#' 第 34 行: E121: 未定义的变量: g:NERDTreeGlyphReadOnly E15: 无效的表达式: 'syn match NERDTreeRO # *\zs.*\ze \['.g:NERDTreeGlyphReadOnly.'\]# contains=NERDTreeIgnore,NERDTreeBookmark,NERDTreeFi le'My OS is Ubuntu 16.04 LTS Vim Version:
8.0.599
And after press Enter,I could see the nerdtree list.
add to your .vimrc:
let g:NERDTreeGlyphReadOnly = "RO"