新客网WWW.XKER.COM:致力做中国最专业的网络学院!
学院: 操作系统 - 网络应用 - 服务器 - 网络安全 - 工具软件 - 办公软件 - Web开发 - 数据库 - 网页设计 - 图形图像 - 媒体动画 - 硬件学堂 - 存储频道 - QQ专区
您的位置:首页 > 网络学院 > 操作系统 > Linux教程 > 正文:Linux下VI编辑器不能保存中文的问题解决

Linux下VI编辑器不能保存中文的问题解决

新客网 XKER.COM 2007-11-05 来源: sixth 收藏本文

Linux下VI编辑器如果出现不能保存中文的问题

 

你可以在当前用户下,建.vimrc文件内容如下:

 

 

set nocompatible " Use Vim defaults (much better!) 
set bs=indent,eol,start " Allow backspacing over everything in insert mode 
set ai " Always set auto-indenting on 
"set backup " Keep a backup file 
set viminfo='20,\"500 " read/write a .viminfo file -- limit regs to 500 lines 
set history=100 " keep 50 lines of command history 
set ruler " Show the cursor position all the time 

colorscheme elflord " Make the colors brighter for transparent terminals 
set ts=4 " Set TAB Stop 
set shiftwidth=4 " Set shift width in programming 
set textwidth=0 " Don't wrap words by default 
set ignorecase " Ignore case in searching 
set smartcase " Search case-sensitively when capitalized letter found in pattern 
set nobackup " Don't keep a backup file 
set showcmd " Show (partial) command in status line 
set showmatch " Show matching brackets 
set incsearch " Incremental Search 
"set autowrite " Automatically save file before :next and : prev 
"set nowrap " Do not wrap text 
"set textwidth=80 " Place automatic text breaks 

???? Enable Chinese encoding support 
set encoding=euc-cn 
if v:lang =~ "^zh_CN" 
set fileencodings=gb2312 
set guifontset=*-r-* " You may change the font to your like 
endif 

" Switch syntax highlighting on, when the terminal has colors 
" Also switch on highlighting the last used search pattern. 
if &t_Co > 2 || has("gui_running") 
syntax on 
set hlsearch 
endif 

"set nohlsearch "If you do not like highlighting search pattern
收藏】 【评论】 【推荐】 【投稿】 【打印】 【关闭
发表评论
要记得去论坛讨论,点击注册新会员匿名评论
评论内容:不能超过250字,需审核后才会公布,请自觉遵守互联网相关政策法规。
阅读排行
随机推荐
实用信息推荐