开发者

Vim doesn't support unicode?

开发者 https://www.devze.com 2023-01-17 06:17 出处:网络
I\'m trying to get the following into my .vimrc \" Use the same symbols as TextMate for tabstops and EOLs

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

" Use the same symbols as TextMate for tabstops and EOLs
set listch开发者_JAVA技巧ars=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:¬


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.


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


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


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


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


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


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

:write ++enc=utf-8


Do you need a

scriptencoding utf-8

or whatever encoding your .vimrc is actually in?


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

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号