Back

vim配置文件

|

贴一下自己的vim配置文件,网上东拼西凑来的,重装备用.这是vim for win的,修改部分配置后可适用于macosx.

`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
winpos 140 123
set lines=40
set columns=200
set showmode
"display line number
set number
set numberwidth=4
"syntax highligh
syntax on
"Take care of indents for Java language
set autoindent
set smartindent
set si
set shiftwidth=4
"Java anonymous classes. Sometimes, you have to use them
set cinoptions+=j1
"show puntuation match
set showmatch
"show real-time search result
set incsearch
set guifont=Monaco:h12:cANSI
set guifontwide=YouYuan:h14:cGB2312
set linespace=4
set shiftwidth=4
set tabstop=4
set ruler
set equalalways
set matchpairs=(:),{:},[:]
colorscheme blackboard
set history=500
set linebreak
set showtabline=2
set noerrorbells
set cursorline
hi cursorline guibg=#222222
hi cursorcolumn guibg=#333333
set imdisable
set nobackup
set nowb
set noswapfile
au GUIEnter * :call libcallnr("vimtweak.dll", "SetAlpha", 230)
set guioptions-=T
set tabstop=
set fileencodings=ucs-bom,utf-8,chinese,latin1
set fileencoding=utf-8
language message zh_CH.utf-8
autocmd! bufwritepost _vimrc source %
set showcmd`
这里有一个翻译很好的vim官方教程.

No comments yet

Leave a comment

About me

I live in Tasmania, an island a little far from the rest of the world and very close to the sea.
Father of two little girls, have two puppies.

Work

Work in IT industry, AI is my working partner.