论坛首页 海阔天空论坛

我的gvim配置文件

浏览 4137 次
精华帖 (0) :: 良好帖 (0) :: 灌水帖 (5) :: 隐藏帖 (0)
作者 正文
   发表时间:2011-03-22   最后修改:2011-03-22

 

 

 

一直在寻找完美的编辑器. 寻找了好久,终于被我发现--编辑器之神 vi. 不过,现在国内用这个的人还不是特别多. 我是刚刚学着使用,一边学习一边总结.

 

"winpos 235 235
"set lines=25 columns=108 
set fileencodings=utf-8,ucs-bom,gb18030,gbk,gb2312,cp936

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 =~ '\<cmd'
      let cmd = '""' . $VIMRUNTIME . '\diff"'
      let eq = '"'
    else
      let cmd = substitute($VIMRUNTIME, ' ', '" ', '') . '\diff"'
    endif
  else
    let cmd = $VIMRUNTIME . '\diff'
  endif
  silent execute '!' . cmd . ' ' . opt . arg1 . ' ' . arg2 . ' > ' . arg3 . eq
endfunction

set nu
set nobackup
colo murphy
set autoindent
set tabstop=4
set shiftwidth=4
set ai
:nmap <F2> :e d:\TXT\task.txt
:nmap <F3> :e d:\TXT\MDM901.txt
:nmap <F4> :e d:\TXT\vim.txt
:map tp :tabprev 
:map tn :tabnew 
:map tc :tabclose
"Toggle Menu and Toolbar
set guioptions-=m
set guioptions-=T
map <silent> <F12> :if &guioptions =~# 'T' <Bar>
        \set guioptions-=T <Bar>
        \set guioptions-=m <bar>
    \else <Bar>
        \set guioptions+=T <Bar>
        \set guioptions+=m <Bar>
    \endif<CR>

"真的很smart, 搜索时全小写相当于不区分大小写,只要有一个大写字母出现,则区分大小写
"simple idea, great achievement!
set ignorecase smartcase

au GUIEnter * simalt ~x  "启动gVIM时最大化
"au FileType xml exe ":silent 1,$!xmllint \"%\" --format --recover"  "XML格式化
set guioptions+=b  "水平滚动条
   发表时间:2011-03-30  
同楼主,鄙人最近也在使用gVim
0 请登录后投票
   发表时间:2011-03-31  
有什么好的插件也拿出来分享一下
0 请登录后投票
论坛首页 海阔天空版

跳转论坛:
Global site tag (gtag.js) - Google Analytics