不要编译安装
问题不在于是否是root用户, 而是因为安全问题sudo和su后可能会重新设置环境变量,  保证全部设为UTF-8(GBK都去死)
vim参考配置:
set fileencodings=ucs-bom,utf8,chinese,taiwan,japan,korea
set termencoding=utf-8
encoding留空,不要去设置

2012/4/16 Never Give Up <dengn...@gmail.com>

>  LANG=zh_CN.UTF-8
> 是有的,可能我的问题没有描述清楚,如果用普通用户权限直接vim打开文件,中文是不能显示的(而且我在vimrc文件中已经加了set
> termencoding=utf-8,但是在vim中运行:set
> termencoding?会出现E519),如果把终端的设为gb*,然后退出文件在打开就可以正确显示了,或者在取得root用户的权限后在su
> user返回为普通用户打开文件,还是可以正确显示中文的。(设置的vim的theme都是正确的,不管是普通用户打开还是从root切换来的普通用户)
>
> 在 2012年4月16日 下午4:39,依云 <lilyd...@gmail.com>写道:
>
> > 你用的是外链图片吧。邮件的 HTML 部分被邮件列表程序干掉了,所以看不到。你
> > 的 locale 不对吧,执行下 locale 命令,输出中是不是没有 UTF-8 或者类似支
> > 持中文显示的编码?如果没有的话,export LANG=zh_CN.UTF-8(或者其它语言,
> > 你的系统应该已经支持了)。
> >
> > On Mon, Apr 16, 2012 at 04:21:59PM +0800, Never Give Up wrote:
> > > 额,不好意思,我的这上面是可以正确显示图的,不知道为什么您那里不能显示,那麻烦您看下这个帖子可以吗?我发了一个帖子在论坛上的。谢谢~
> > > 链接:
> > >
> >
> http://topic.csdn.net/u/20120416/12/418d6124-0904-4b11-9c77-4863e870971d.html?10972
> > >
> > > 在 2012年4月16日 下午4:11,依云 <lilyd...@gmail.com>写道:
> > >
> > > > On Mon, Apr 16, 2012 at 03:36:39PM +0800, Never Give Up wrote:
> > > > > HI,all:
> > > > >
> > > >
> >
> 我在主文件夹下建立了vim的一个配置文件,~/.vimrc,其中加了gbk解决中文乱码问题,设置了theme。自己编译安装的vim7.3,也放在/home/dengnice/vim73文件夹下
> > > > > 但是出现了一个比较奇怪的问题:
> > > > > 问题描述:
> > > > > 1.在普通权限下,还是会显示乱码。如图:
> > > > >
> > > > > 2.在root权限下,可以显示,但不是我所设置的theme
> > > > > 如图:
> > > > >
> > > > > 3.使用命令su dengnice后,才恢复了我在vimrc中配置的各项东西
> > > >
> > > > 1. 图在哪儿?
> > > > 2. 你是怎么设置的?
> > > > 3. 编译时指定了 prefix 没?你之前的用户是什么?
> >
> > --
> > Best regards,
> > lilydjwg
> >
> > Linux Vim Python 我的博客:
> > http://lilydjwg.is-programmer.com/
> > --
> > A: Because it obfuscates the reading.
> > Q: Why is top posting so bad?
> >
> > --
> > ubuntu-zh mailing list
> > ubuntu-zh@lists.ubuntu.com
> > https://lists.ubuntu.com/mailman/listinfo/ubuntu-zh
> >
>
>
>
> --
> Best Regards
> ——————
> Deng
> -------------- 下一部分 --------------
> 一个HTML附件被移除...
> URL: <
> https://lists.ubuntu.com/archives/ubuntu-zh/attachments/20120416/79b97681/attachment.html
> >
> --
> ubuntu-zh mailing list
> ubuntu-zh@lists.ubuntu.com
> https://lists.ubuntu.com/mailman/listinfo/ubuntu-zh
>
-------------- 下一部分 --------------
一个HTML附件被移除...
URL: 
<https://lists.ubuntu.com/archives/ubuntu-zh/attachments/20120416/67589da7/attachment.html>
-- 
ubuntu-zh mailing list
ubuntu-zh@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-zh

回复