Nerdtree has suddenly started acting a little strange. As you can see in the screenshot, directories are all prefixed with ?~V?. subsequently I can't open the directories anymore either, just the files.
Anyone have any idea where to begin here. Is this even a vim problem, or perhaps lower down, in the shell itself?
any ideas are much appreciated
As someone suggested in the comments, it was indeed an encoding issue. I had recently switched to zsh.
Adding the following to your bashrc / zshrc etc.. should fix the problem
export LC_ALL=en_US.utf-8
export LANG="$LC_ALL"
Alternatively you can tell NERDTree not to use the fancy arrow characters, by adding
let g:NERDTreeDirArrows=0
to your vimrc which will allow you to keep your current encoding
A late solution: Tell vim to use utf-8 encoding and everything will be good, even the messy characters that appear on top of function and class folds But I agree with npiv, the + and - are much nicer than the fancy arrows :D
Add this to your .vimrc
set encoding=utf-8
let g:NERDTreeDirArrowExpandable='|'
let g:NERDTreeDirArrowCollapsible='+'
Add the above statements in your vimrc. (I'm using csh. This has fixed for me.)
If this is also not solving, below can be tried.
The characters that are displayed in your screen shot are specified in NERD_tree.vim file. Change them to '|' (NERDTreeDirAllowExpandable) , '+' (NERDTreeDirArrowCollapsible)
. Hope this helps (if not for you, for others whoever can't fix the problem in the ways specified above).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With