Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

vim - nerdtree suddenly broke

Tags:

vim

enter image description here

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

like image 920
npiv Avatar asked Mar 29 '12 14:03

npiv


3 Answers

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

like image 123
npiv Avatar answered Oct 08 '22 09:10

npiv


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
like image 45
Mukiza Andrew Avatar answered Oct 08 '22 07:10

Mukiza Andrew


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).

like image 43
Vinay Avatar answered Oct 08 '22 07:10

Vinay