24

I installed NERDTree via Pathogen on Mac OSX 10.6.8.

When I vim a dir, I cannot enter into sub dirs with enter key. Furthermore, the dirs look like this:

?~V? doc/

What's going on?

1
  • 1
    It looks like Vim is unable to display the arrow or + sign. Vim in the terminal (I think) or MacVim? Vim version? If Vim in the terminal what does $ echo $TERM in the terminal says and do you use Terminal.app or iTerm?
    – romainl
    Commented Jan 6, 2012 at 7:53

7 Answers 7

34

Putting this in my .vimrc solved the problem: let g:NERDTreeDirArrows=0

The creator gave me the fix: https://github.com/scrooloose/nerdtree/issues/108

1
  • 1
    Thanks. Definitely use the reference link here as it helped solve my problem. I had to set encoding=utf-8 in the top of .vimrc file and everything worked
    – Rusty1
    Commented Nov 15, 2016 at 9:29
18

On Mountain Lion 10.8.2

This worked for me

export LC_CTYPE=en_US.UTF-8
export LC_ALL=en_US.UTF-8
2
  • 1
    Thanks. This had to be added to the .bashrc file which is in C:Users\<your user name> directory. Commented Feb 2, 2016 at 15:56
  • Worked for me on FreeBSD 10.3 Commented Apr 8, 2016 at 2:25
12

I followed jernkuan's answer but didn't work. What worked for me was typing :set encoding=utf-8 inside vim But I lose this when I exit out of vim. I have to do this everytime I am on vim

3
  • 8
    You can add set encoding=utf-8 to your .vimrc to enable this by default! Any command that you enter in vim you can add to your .vimrc. Your solution was the only one that worked for me!
    – haff
    Commented May 10, 2016 at 19:00
  • 1
    I like this solution the best since it isolates the changes to vim.
    – studgeek
    Commented Jul 5, 2016 at 18:24
  • 1
    This should be marked as the answer. combined with haff's comment Commented Jun 27, 2017 at 16:34
9

If you'd still like to try to get the arrow characters to work, here is my answer from Why does my nerd tree have these odd characters. I run Arch Linux, so your mileage may vary.

I had this exact same problem and was able to fix it by uncommenting UTF-8 and leaving ISO-8879-1 commented out in /etc/locale.gen. Then I ran locale-gen and restarted. Also added 'export LANG=en_US.UTF-8' to my .bashrc. Here are the results of my locale settings once it started working:

[lysistrata@(none) ~]$ locale -a
C
en_US.utf8
POSIX
[lysistrata@(none) ~]$
1
  • 1
    The LANG environment variable is the key. Commented Oct 4, 2013 at 4:30
2

I'm using RedHat 6.1 and vim 7.3 and had to recompile vim with multibyte support.

$ cd ~/src && wget ftp://ftp.vim.org/pub/vim/unix/vim-7.3.tar.bz2
$ tar xjf vim-7.3.tar.bz2 && cd vim-7.3
$ ./configure --enable-multibyte
$ make
$ sudo make install

Then verify that multibyte support has been enabled.

$ vim --version | grep byte
-arabic +autocmd -balloon_eval -browse +builtin_terms +byte_offset +cindent 
+mouse_xterm +multi_byte +multi_lang -mzscheme +netbeans_intg -osfiletype
1

Check locale on your system, if output is something like this one LANG=C then do the following steps:

  1. sudo echo "LANG=en_US.UTF-8" >> /etc/locale.conf
  2. sudo locale-gen and sudo reboot

check your locale again. Hope this can solve your problem.

1

On my fedora 27, I just put set encoding=utf-8 into mine ~/.vimrc file, and it starts working properly.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.