您尚未登录。

#1 2014-06-04 08:11:31

dxcqcv
会员
注册时间: 2012-12-28
帖子: 242

gvim能显示中文,但vim和terminal不行

都能调出fcitx,gvim 里能正常显示出来中文,但在vim和terminal里输入后光标正常向后移动,但字符没显示,这是为什么

我的vimrc

" All system-wide defaults are set in $VIMRUNTIME/archlinux.vim (usually just
" /usr/share/vim/vimfiles/archlinux.vim) and sourced by the call to :runtime
" you can find below.  If you wish to change any of those settings, you should
" do it in this file (/etc/vimrc), since archlinux.vim will be overwritten
" everytime an upgrade of the vim packages is performed.  It is recommended to
" make changes after sourcing archlinux.vim since it alters the value of the
" 'compatible' option.

" This line should not be removed as it ensures that various options are
" properly set to work with the Vim-related packages.
runtime! archlinux.vim

" If you prefer the old-style vim functionalty, add 'runtime! vimrc_example.vim'
" Or better yet, read /usr/share/vim/vim74/vimrc_example.vim or the vim manual
" and configure vim to your own liking!

"php
autocmd FileType php setlocal makeprg=zca\ %<.php
autocmd FileType php setlocal errorformat=%f(line\ %l):\ %m
" .vimrc
" See: http://vimdoc.sourceforge.net/htmldoc/options.html for details

" For vim display multi-byte character support (CJK support, for example):
set fileencodings=ucs-bom,utf-8,cp936,big5,euc-jp,euc-kr,gb18030,latin1

" For output (web browser, for example)
set encoding=utf-8

" Independent folder for backup
if has("win32")
    let $VIMFILES = $VIM.'/vimfiles'
else
	let $VIMFILES = $HOME.'/.vim'
endif

" to use Backspace
set backspace=2

" runtime path manipulation
"set nocp
execute pathogen#infect()

" to cross
set whichwrap+=<,>,h,l 

" to use clipboard from win to vim by shift+insert
" and from vim to win by "+y
map <c-c> "+y
map <c-v> "+p

"##### auto fcitx  ###########
let g:input_toggle = 1
function! Fcitx2en()
   let s:input_status = system("fcitx-remote")
   if s:input_status == 2
      let g:input_toggle = 1
      let l:a = system("fcitx-remote -c")
   endif
endfunction

function! Fcitx2zh()
   let s:input_status = system("fcitx-remote")
   if s:input_status != 2 && g:input_toggle == 1
      let l:a = system("fcitx-remote -o")
      let g:input_toggle = 0
   endif
endfunction

set ttimeoutlen=150
"退出插入模式
autocmd InsertLeave * call Fcitx2en()
"进入插入模式
autocmd InsertEnter * call Fcitx2zh()
"##### auto fcitx end ######

" Visual{

" set font (Uses Monaco on Windows and Inconsolata everywhere else)
if has("gui_running")
    if has("gui_gtk2")
        set guifont=Inconsolata\ 16
    elseif has("gui_win32")
        set guifont=Monaco:h11:cANSI
    endif
endif

" show line number
set number

" highlight syntax
syntax on

" tab weight
set tabstop=4

" auto indent
set autoindent

" Number of spaces to use for each step of (auto)indent
set shiftwidth=4

" Use the appropriate number of spaces to insert a <Tab>.
set expandtab

" jump to the matching one
set showmatch

" highlight all its matches
set hlsearch

" show immediately where the so far typed pattern matches
set incsearch

" ignore case
set ignorecase

" override the 'ignorecase' option if the search pattern contains upper case characters
set smartcase

" to use colors that look good on a dark background
set background=dark

" color theme
colorscheme darkblue

" full screen
"au GUIEnter * simalt ~x

" }

最近编辑记录 dxcqcv (2014-06-04 08:18:20)


learning Arch linux

离线

#2 2014-06-04 15:07:44

依云
会员
所在地: a.k.a. 百合仙子
注册时间: 2011-08-21
帖子: 8,953
个人网站

Re: gvim能显示中文,但vim和terminal不行

什么终端,是不是设置的字体不支持中文?

离线

#3 2014-06-04 16:53:29

dxcqcv
会员
注册时间: 2012-12-28
帖子: 242

Re: gvim能显示中文,但vim和terminal不行

百合仙子 说:

什么终端,是不是设置的字体不支持中文?

终端问题,xterm,我照着wiki设置.Xresources配置成Dejavu后可以显示了,但没gvim里的字好看,然后我改成和vimrc里一样的字体,无效,奇怪

Xresources里的字体不能换成wqy-zenhei的吗

! terminal colors

! tangoesque scheme
*background: #111111
*foreground: #babdb6

! for size
XTerm*font: 12*24

! for utf-8
XTerm*locale: true

! for chinese
xterm*faceName: wqy-zenhei
!DejaVu Sans Mono:style=Book:antialias=false
xterm*faceNameDoublesize: wqy-zenhei
!WenQuanYi Bitmap Song
xterm*faceSize: 16 

learning Arch linux

离线

#4 2014-06-04 17:36:30

依云
会员
所在地: a.k.a. 百合仙子
注册时间: 2011-08-21
帖子: 8,953
个人网站

Re: gvim能显示中文,但vim和terminal不行

我的设置是这样的:

xterm*faceName: DejaVu Sans Mono:antialias=True:pixelsize=12
xterm*faceNameDoublesize: 文泉驿等宽正黑:antialias=True:pixelsize=12
xterm*xftAntialias: true

离线

#5 2014-06-04 17:41:08

dxcqcv
会员
注册时间: 2012-12-28
帖子: 242

Re: gvim能显示中文,但vim和terminal不行

百合仙子 说:

我的设置是这样的:

xterm*faceName: DejaVu Sans Mono:antialias=True:pixelsize=12
xterm*faceNameDoublesize: 文泉驿等宽正黑:antialias=True:pixelsize=12
xterm*xftAntialias: true

差不多啊,我比较喜欢wqy-zenhei这个字体,但我在xresources里调用不出来,这是为什么呢


learning Arch linux

离线

#6 2014-06-04 18:02:25

dxcqcv
会员
注册时间: 2012-12-28
帖子: 242

Re: gvim能显示中文,但vim和terminal不行

百合仙子 说:

我的设置是这样的:

xterm*faceName: DejaVu Sans Mono:antialias=True:pixelsize=12
xterm*faceNameDoublesize: 文泉驿等宽正黑:antialias=True:pixelsize=12
xterm*xftAntialias: true

哦,知道了,上面的DejVu Sans Mono不能变


learning Arch linux

离线

#7 2014-06-04 18:29:25

dxcqcv
会员
注册时间: 2012-12-28
帖子: 242

Re: gvim能显示中文,但vim和terminal不行

百合仙子 说:

我的设置是这样的:

xterm*faceName: DejaVu Sans Mono:antialias=True:pixelsize=12
xterm*faceNameDoublesize: 文泉驿等宽正黑:antialias=True:pixelsize=12
xterm*xftAntialias: true

learning Arch linux

离线

#8 2014-06-05 05:54:14

dxcqcv
会员
注册时间: 2012-12-28
帖子: 242

Re: gvim能显示中文,但vim和terminal不行

百合仙子 说:

我的设置是这样的:

xterm*faceName: DejaVu Sans Mono:antialias=True:pixelsize=12
xterm*faceNameDoublesize: 文泉驿等宽正黑:antialias=True:pixelsize=12
xterm*xftAntialias: true

第一行不能改,知道了,谢谢


learning Arch linux

离线

页脚