35

I'm trying to get the following into my .vimrc

" Use the same symbols as TextMate for tabstops and EOLs
set listchars=tab:▸\ ,eol:¬

Those lines are from here are worked perfectly in vim 7.2 I recently compiled and installed vim 7.3 and now those characters aren't understood by vim. Also: Ctrl+V then U in insert doesn't let me insert any characters, it just seems to ignore that.

Any ideas?

This is what I see: set listchars=tab:�~V�\ ,eol:¬

3
  • 2
    Are you using a Unicode capable terminal or gvim? Sep 22, 2010 at 15:05
  • 1
    Yes I am. I am using screen, but I can paste those characters into it just fine.
    – Sandro
    Sep 22, 2010 at 16:36
  • Though Vim supports unicode, both MS and Linux systems don't have unicode support, I mean their terminals and consoles. Hence, I have installed vrapper in eclipse. Now, I am able to type in Unicode. :)
    – SibiCoder
    May 27, 2016 at 15:47

9 Answers 9

39

You need to compile vim with multi-byte support.

The easiest way to do this is to run

./configure --with-features=big
make

This will build vim with the correct support.

You can verify that it was compiled correctly with

:version

in vim or by running

vim --version

and looking for +multi_byte. If it says -multi_byte it will not work.

3
  • I had been kicking myself for the past couple days, trying to get vim-powerline symbols to work with fancy characters. This finally fixed it. Thanks!
    – Liam
    Feb 13, 2012 at 18:14
  • I installed arch linux the other day and my arrow symbols and tmux borders were messed up. This fixed vim, I think locale fixed the rest Jun 7, 2012 at 12:54
  • 2
    for those still struggling: you also have to make sure your terminal is also set to use unicode : )
    – Yeow_Meng
    Sep 19, 2013 at 1:09
30

I have the following in my .vimrc

scriptencoding utf-8
set encoding=utf-8

and that in my .gvimrc

set listchars=trail:·,precedes:«,extends:»,eol:↲,tab:▸\ 

and works fine(notice there is a space after the ▸\ ).

2
  • interesting, on linux i don't have to set anything. on vim win32 with +multi_byte i started to have to add it after i changed something in my vimrc... now, putting those two lines will not raise an error, but the trail chars render as a question mark or something else... if i leave ONLY set encoding=utf-8 then it works as before
    – gcb
    Apr 23, 2014 at 18:48
  • Remember to set list to enable listchars.
    – jacwah
    Aug 1, 2017 at 10:40
7

I had the same issue with the vim that ships with OS X Lion although it was compiled with multi_byte.

The issue was the encoding used by vim. I added set encoding=utf-8 in my ~/.vimrc and the issue was solved.

Ref: Terminal Vim redraw issues in OS X Lion

1
  • Perfect. I share a vimrc between Mac and Windows using Dropbox. Worked perfectly fine with MacVim but Gvim on Windows was giving me errors upon startup.
    – mrak
    Sep 4, 2012 at 0:08
5

Make sure you're using a compatible font. My problem was that inconsolata-g does not support the utf-8 characters in my document.

also, this was all I needed in my gvimrc:

set enc=utf-8
set fileencoding=utf-8
set fileencodings=ucs-bom,utf8,prc
set guifont=Monaco:h14
set guifontwide=NSimsun:h14
4

I had this issue while being in a screen session. It's gone with setting the following in my .bashrc:

export LANG=en_US.UTF-8
2

Don't forget, if you're running vim in a terminal, make sure the terminal itself is using utf-8 as well.

2

When all else failed, telling vim to save with UTF-8 encoding seemed to work (for now at least):

:write ++enc=utf-8
1

Do you need a

scriptencoding utf-8

or whatever encoding your .vimrc is actually in?

6
  • 2
    Also, check the values of encoding, termencoding, fileencoding options. Ensure that when you are editing .vimrc all of them are set to utf-8.
    – ib.
    Sep 22, 2010 at 7:31
  • I've added it and it still doesn't work. How do I check the value of those other options?
    – Sandro
    Sep 22, 2010 at 16:41
  • 1
    You can see the value of any option by adding a ? after the set command. ie :set encoding?
    – Tassos
    Sep 22, 2010 at 19:55
  • Woah weird! Apparently the "encoding" option is not supported. I typed ":set encoding?" and that's the error that I got.
    – Sandro
    Sep 23, 2010 at 2:03
  • 2
    You must have a version of vim compiled with +multi_byte. The vim version must be B (Big), H (Huge) or a manually compiled with the +multi_byte flag. Check your build flags via :version Sep 23, 2010 at 3:47
1

The accepted answer didn't work for me. Working off of the downloaded source on a Mac running Lion, I went into the src directory and ran:

make clean
export CONF_OPT_MULTIBYTE='--enable-multibyte'
make reconfig

Running: ./vim --version to check for +muti_byte then:

make install

Via: http://vim.1045645.n5.nabble.com/compiling-vim7-1-huge-version-gets-build-with-normal-version-td1162314.html

Your Answer

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

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