Skip to content

Instantly share code, notes, and snippets.

@kingsamchen
Created March 3, 2013 08:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kingsamchen/5075316 to your computer and use it in GitHub Desktop.
Save kingsamchen/5075316 to your computer and use it in GitHub Desktop.
My _vimrc
if(has("win32") || has("win95") || has("win64") || has("win16"))
let g:vimrc_iswindows=1
let g:iswindows=1
else
let g:vimrc_iswindows=0
let g:iswindows=0
endif
autocmd BufEnter * lcd %:p:h
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 fileencodings=utf-8,cp936,big5,euc-jp,euc-kr,latin1,ucs-bom
set encoding=utf-8
set fileencodings=utf-8,gbk,ucs-bom
set ambiwidth=double
syntax on
colo desert
set guifont=Source_Code_Pro:h16:cANSI
filetype plugin indent on
set foldcolumn=3
set nu
set nowrap
set smartindent
set smarttab
set tabstop=4
set shiftwidth=4
set showmatch
set completeopt=menu,longest
let g:pydiction_location='D:\Vim\vimfiles\plugin\pydiction\complete-dict'
let g:Tlist_Ctags_Cmd='D:\Vim\vim73\ctags\ctags'
autocmd FileType python setlocal et sta sw=4 sts=4
set nobackup
set bsdir=buffer
set autochdir
let do_syntax_sel_menu=1|runtime! synmenu.vim|aunmenu &Syntax.&Show\ filetypes\ in\ menu
set tags=tags;
au FileType cpp,c set tags+=D:\Vim\vim73\ctags\tags\cpptags
au FileType cpp,c set tags+=D:\Vim\vim73\ctags\tags\ctags
set autochdir
command MakeTags !ctags -R --c++-kinds=+px --fields=+ialS --extra=+q
set directory=.,$TEMP
"TagList
let Tlist_Show_One_File=1
let Tlist_Exit_OnlyWindow=1
"WinManager
let g:winManagerWindowLayout='FileExplorer|TagList'
command WM WMToggle
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment