if v:progname =~? "evim"
finish
endif
set nocompatible
set backspace=indent,eol,start
"if has("vms")
" set nobackup " do not keep a backup file, use versions instead
"else
" set backup " keep a backup file
"endif
set history=1000 " keep 1000 lines of command line history
set ruler " show the cursor position all the time
set showcmd " display incomplete commands
set incsearch " do incremental searching
map Q gq
inoremap u
if has('mouse')
set mouse=a
endif
if &t_Co > 2 || has("gui_running")
syntax on
set hlsearch
endif
if has("autocmd")
filetype plugin indent on
augroup vimrcEx
au!
autocmd FileType text setlocal textwidth=78
autocmd BufReadPost *
\ if line("'\"") > 1 && line("'\"") <= line("$") |
\ exe "normal! g`\"" |
\ endif
augroup END
else
set autoindent " always set autoindenting on
endif " has("autocmd")
if !exists(":DiffOrig")
command DiffOrig vert new | set bt=nofile | r # | 0d_ | diffthis
\ | wincmd p | diffthis
endif
"/my_vimrc
syntax enable
syntax on
set nu
filetype on
set nobackup
set cindent
set smartindent
set tabstop=4
set shiftwidth=4
set showmatch
set vb t_vb= "屏蔽警告音
set nohls
set aw
set showmode
set ts=4
set wm=4
set si
set wrap
colorscheme desert
"gvim有效
"set guioptions-=m "隐藏菜单栏
"set guioptions-=T "隐藏工具栏
"cpp
set cin
set cino=:0g0(sus
"":0表示带:的不会缩进,g0表示类中public等不会缩进
"chinese GBK support
set encoding=utf-8
set fileencodings=ucs-bom,utf-8,cp936,gbk,gb18030,big5,euc-jp,euc-k,latin-1
"php
set ai
"帮助语言设置
set langmenu=zh_CN.UTF-8
set helplang=cn
" 总是显示状态行
"set laststatus=2
"个人信息
function SetTitle()
call append(0,"/*===================================")
call append(1," ".expand("%:t") .strftime(" @ %Y/%m/%d %H:%M"))
call append(2, " code by ×××××××××××")
call append(3," ===================================*/")
endf
"插入个人信息
map :call SetTitle():$o
""新建.c,.h,.cpp文件,自动插入文件头
"autocmd BufNewFile *.cpp,*.[ch] exec ":call SetTitle()"
"K&R代码格式
map :1,$g/^$/dgg=Ggg
"增加注释
map a/**/2ha
ab email /*wzlxx.c@gmail.com*/
"代码折叠
set fdm=syntax
set foldcolumn=2
""自动折叠
"set foldmethod=indent
""手动折叠
set foldmethod=manual
set foldlevel=3
"Tlist
let Tlist_Show_One_File=1
let Tlist_Exit_OnlyWindow=1
autocmd FileType python set omnifunc=pythoncomplete#Complete
autocmd FileType javascript set omnifunc=javascriptcomplete#CompleteJS
autocmd FileType html set omnifunc=htmlcomplete#CompleteTags
autocmd FileType css set omnifunc=csscomplete#CompleteCSS
autocmd FileType xml set omnifunc=xmlcomplete#CompleteTags
autocmd FileType php set omnifunc=phpcomplete#CompletePHP
autocmd FileType c set omnifunc=ccomplete#Complete
autocmd FileType java set omnifunc=javacomplete#Complete
阅读(1128) | 评论(0) | 转发(0) |