免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 1052 | 回复: 0
打印 上一主题 下一主题

VIM的配置 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2007-04-23 15:46 |只看该作者 |倒序浏览

                1.to download three files from the following web:
http://www.fleiner.com/vim/download.html
java.vim javascript.vim html.vim
2.$mkdir ~/.vim && mkdir ~/.vim/syntax
cp *.vim ~/.vim/syntax/
3.$vi ~/.vimrc
content of the .vimrc
:syntax enable
:syntax on
:so $VIMRUNTIME/syntax/java.vim
:so $VIMRUNTIME/syntax/javascript.vim
:so $VIMRUNTIME/syntax/html.vim
" vim设置文件 ( .vimrc 或 _vimrc )
"-----------------------------------------------------------------------------
" 字符编码相关
"
" 多字节编码设置,必须放在.vimrc顶部
"
if has("multi_byte")
  " When 'fileencodings' starts with 'ucs-bom', don't do this manually
  "set bomb
  set fileencodings=ucs-bom,chinese,taiwan,japan,korea,utf-8,latin1
  " CJK environment detection and corresponding setting
  if v:lang =~ "^zh_CN"
    " Simplified Chinese, on Unix euc-cn, on MS-Windows cp936
    set encoding=chinese
    set termencoding=chinese
    if &fileencoding == ''
      set fileencoding=chinese
    endif
  elseif v:lang =~ "^zh_TW"
    " Traditional Chinese, on Unix euc-tw, on MS-Windows cp950
    set encoding=taiwan
    set termencoding=taiwan
    if &fileencoding == ''
      set fileencoding=taiwan
    endif
  elseif v:lang =~ "^ja_JP"
    " Japanese, on Unix euc-jp, on MS-Windows cp932
    set encoding=japan
    set termencoding=japan
    if &fileencoding == ''
      set fileencoding=japan
    endif
  elseif v:lang =~ "^ko"
    " Korean on Unix euc-kr, on MS-Windows cp949
    set encoding=korea
    set termencoding=korea
    if &fileencoding == ''
      set fileencoding=korea
    endif
  endif
   " Detect UTF-8 locale, and override CJK setting if needed
  if v:lang =~ "utf8$" || v:lang =~ "UTF-8$"
    set encoding=utf-8
  endif
else
  echoerr 'Sorry, this version of (g)Vim was not compiled with "multi_byte"'
endif
" 不明宽度字符的宽度设置
if exists("&ambiwidth")
    set ambiwidth=double
endif
" 自动认识换行符
set fileformats=unix,dos,mac
"-----------------------------------------------------------------------------
" 编辑相关
"
" 自动缩进
set autoindent
"-----------------------------------------------------------------------------
" 检索相关
"
"不分大小写
set ignorecase
"大小写敏感
set smartcase
"找到最后一项后返回第一项
set wrapscan
"关闭部分匹配模式
set noincsearch
"-----------------------------------------------------------------------------
" 显示相关
"
"打开语法彩显
syntax on
"设置配色方案
colorscheme evening
"不显示行号
set nonumber
"tab左侧显示提示符
set listchars=tab:\ \
set list
"tab的宽度设置
set tabstop=4
set shiftwidth=4
"状态栏里显示输入的命令
set showcmd
"输入括号时显示匹配括号
set showmatch
"搜索结果高亮显示
set hlsearch
"一直显示状态栏
set laststatus=2
"状态栏里显示文字编码和换行符等信息
set statusline=% :edit
map  :bp
map  :bn
map  :set nu
map  :set nonu
map  :set hlsearch
map  :set nohlsearch
map  :shell
               
               
               
               
               

本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u/2064/showart_284388.html
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP