比尔盖子 博客

Tag: vim

Fedora Linux下GVim无菜单、乱码的解决方法

有时,Linux系统安装完GVim后,你会发现它在UTF8中文环境下,无菜单和乱码。原来,GVim是根据系统LANG变量来检测语言并使用相应语言文件的。但是,对于中文,GVim只能识别zh_CN.utf-8,而不能识别不带“-”的zh_CN.utf8(晕)!

解决的方法很简单,到GVim的文件目录的lang目录下,比如/usr/share/vim/vim73/lang,然后做一个软链接(符号链接):

ln -s menu_zh_cn.utf-8.vim menu_zh_cn.utf8.vim

再打开GVim,你就会发现菜单正常了!

我的~vimrc

set nocompatible
source $VIMRUNTIME/vimrc_example.vim
source $VIMRUNTIME/mswin.vim
behave mswin

set diffexpr=MyDiff()
function MyDiff()
  let opt = '-a --binary '
  if &diffopt =~ 'icase' | let opt = opt . '-i ' | endif
  if &diffopt =~ 'iwhite' | let opt = opt . '-b ' | endif
  let arg1 = v:fname_in
  if arg1 =~ ' ' | let arg1 = '"' . arg1 . '"' | endif
  let arg2 = v:fname_new
  if arg2 =~ ' ' | let arg2 = '"' . arg2 . '"' | endif
  let arg3 = v:fname_out
  if arg3 =~ ' ' | let arg3 = '"' . arg3 . '"' | endif
  let eq = ''
  if $VIMRUNTIME =~ ' '
    if &sh =~ '\ ' . arg3 . eq
endfunction

"" exec "!e: && cd  E:\\PortableApps\\flake8-1.3 && C:\\Python27\\python.exe E:\\PortableApps\\flake8-1.3\\setup.py build"
"" exec "!e: && cd  E:\\PortableApps\\flake8-1.3 && C:\\Python27\\python.exe E:\\PortableApps\\flake8-1.3\\setup.py install"
set autoindent " same level indent
set smartindent " next level indent
set expandtab
set tabstop=4
set shiftwidth=4
set softtabstop=4
set tags=tags;
set autochdir 

call pathogen#infect()
filetype plugin on
filetype plugin indent on
autocmd FileType python setlocal et sta sw=4 sts=4
let Tlist_Ctags_Cmd = 'E:\PortableApps\ctags58\ctags'
let g:pydiction_location = 'E:\PortableApps\gVimPortable\App\vim\vim73\ftplugin\pydiction\complete-dict'
set encoding=utf-8
set langmenu=zh_CN.UTF-8
language message zh_CN.UTF-8

let Tlist_Inc_Winwidth=0
let Tlist_Use_Right_Window=1
let Tlist_File_Fold_Auto_Close=1

func! Run()
        exec "w! temp.py"
        if &filetype == "python"
			exec '!C:\Python27\Python E:\PortableApps\stu\temp.py'
        endif
endfunc

map  :call Run()

set mouse=a
set nu

func! Run16en()
        exec "%!xxd"
endfunc

func! Run16de()
        exec "%!xxd -r"
endfunc

map  :call Run16en()
map  :call Run16de()

set guifont=Courier_new:h11
"解决菜单乱码
source $VIMRUNTIME/delmenu.vim
source $VIMRUNTIME/menu.vim
"解决consle输出乱码
language messages zh_CN.utf-8

Copyright © 2019 比尔盖子 博客

Theme by Anders NorenUp ↑