Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1282620
  • 博文数量: 213
  • 博客积分: 7590
  • 博客等级: 少将
  • 技术积分: 2185
  • 用 户 组: 普通用户
  • 注册时间: 2008-08-31 17:31
个人简介

热爱开源,热爱linux

文章分类

全部博文(213)

文章存档

2018年(4)

2017年(1)

2015年(1)

2014年(5)

2013年(2)

2012年(2)

2011年(21)

2010年(82)

2009年(72)

2008年(23)

分类: LINUX

2009-10-25 13:11:55

set fileencodings=utf-8,gbk,ucs-bom,cp936
set encoding=utf-8
set nocompatible
set number
filetype on
set history=1000
syntax on
set autoindent
set smartindent
set showmatch
set guioptions-=T
set vb t_vb=
set ruler
set nohls
:set cindent
set tabstop=4
set shiftwidth=4
set incsearch
set cursorline
source $VIMRUNTIME/ftplugin/man.vim
 


下面是我windows下gvim中的_vimrc配制文件,很简单
  1. set nocompatible
  2. source $VIMRUNTIME/vimrc_example.vim
  3. source $VIMRUNTIME/mswin.vim
  4. behave mswin



  5. "设定 windows 下 gvim 启动时最大化
  6. autocmd GUIEnter * simalt ~x
  7. "显示行号
  8. set number
  9. "设置备份,并且设置备份文件目录
  10. set nobackup
  11. "set backupdir=C:\Program Files\Vim\Backup

  12. "高亮显示当前行
  13. set cursorline


  14. set diffexpr=MyDiff()
  15. function MyDiff()
  16.   let opt = '-a --binary '
  17.   if &diffopt =~ 'icase' | let opt = opt . '-i ' | endif
  18.   if &diffopt =~ 'iwhite' | let opt = opt . '-b ' | endif
  19.   let arg1 = v:fname_in
  20.   if arg1 =~ ' ' | let arg1 = '"' . arg1 . '"' | endif
  21.   let arg2 = v:fname_new
  22.   if arg2 =~ ' ' | let arg2 = '"' . arg2 . '"' | endif
  23.   let arg3 = v:fname_out
  24.   if arg3 =~ ' ' | let arg3 = '"' . arg3 . '"' | endif
  25.   let eq = ''
  26.   if $VIMRUNTIME =~ ' '
  27.     if &sh =~ '\
  28.       let cmd = '""' . $VIMRUNTIME . '\diff"'
  29.       let eq = '"'
  30.     else
  31.       let cmd = substitute($VIMRUNTIME, ' ', '" ', '') . '\diff"'
  32.     endif
  33.   else
  34.     let cmd = $VIMRUNTIME . '\diff'
  35.   endif
  36.   silent execute '!' . cmd . ' ' . opt . arg1 . ' ' . arg2 . ' > ' . arg3 . eq
  37. endfunction

  38. "设置文件编码
  39. set fileencoding=utf-8
阅读(1003) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~