set nocompatible
syntax on
set number
" English characters.
set guifont=Monaco:h10:cANSI
" For double-width characters
"set gfw=微软雅黑/ 12
colo desert
" 设置自动缩进
set ai
" 打开状态栏标尺
set ruler
" 覆盖文件时不备份
set nobackup
" 搜索时高亮显示被找到的文本
set hlsearch
" tab宽度
set tabstop=4
" tab自动缩进宽度
set shiftwidth=4
"设置代码折叠
set fdm=indent
"设置代码折叠宽度为4个字符
set fdc=4
" 通过设置列行数来控制窗口的大小
set co=130
set lines=100
" 设置折行
if (has("gui_running"))
" 图形界面下的设置
set nowrap
set guioptions+=b
else
" 字符界面下的设置
set wrap
endif
set cursorline
" 不设置 'compatible'
set nocp
" 允许使用插件
filetype plugin on
"ctags
set tags=tags
set autochdir
"tablist
"let Tlist_Show_One_File=1
"let Tlist_Exit_OnlyWindow=1
""""""""""""""""""""""""""""""
" Tag list (ctags)
""""""""""""""""""""""""""""""
"if MySys() == E:/Program Files/Vim/zip/ctags58 "设定windows系统中ctags程序的位置
"let Tlist_Ctags_Cmd = 'ctags'
"elseif MySys() == "linux" "设定linux系统中ctags程序的位置
"let Tlist_Ctags_Cmd = '/usr/bin/ctags'
"endif
"let Tlist_Show_One_File = 1 "不同时显示多个文件的tag,只显示当前文件的
"let Tlist_Exit_OnlyWindow = 1 "如果taglist窗口是最后一个窗口,则退出vim
"let Tlist_Use_Right_Window = 1 "在右侧窗口中显示taglist窗口
"wmmanager
let g:winManagerWindowLayout='FileExplorer|TagList'
nmap wm :WMToggle<cr>
"快速头文件、源文件切换
nnoremap <silent> <F12> :A<CR>
"在工程中快速查找
nnoremap <silent> <F3> :Grep<CR>
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