vi配置文件

来源:互联网 发布:js设置div透明度 编辑:程序博客网 时间:2024/04/27 21:00

    vi配置文件可以设置语法高亮,缩进等。

    在主目录下编辑.vimrc文件,内容如下:

set encoding=utf-8
set fileencoding=chinese
set fileencodings=ucs-bom,utf-8,chinese
set ambiwidth=double
set autoindent
set cindent
set expandtab
set sw=4
set tabstop=4
set shiftwidth=4
set backspace=eol,start,indent
" zhiyu setting
set smartindent
"#################
"general setting
"#################
set clipboard+=unnamed
"set background=dark
set nu
"set mouse=a
set nocp
set ru
"#################
"search and match
"#################
set showmatch
set hlsearch
set incsearch
set is
 
 
" Show full tags when doing search completion
set showfulltag
"### cscope begin ###
if $CSCOPE_DB_KERNEL != ""
    cs add $CSCOPE_DB_KERNEL
elseif $CSCOPE_DB_ANDROID != ""
    cs add $CSCOPE_DB_ANDROID
endif
"hit 'CTRL-/'
nmap <C-/>s :cs find s <C-R>=expand("<cword>")<CR><CR>
nmap <C-/>g :cs find g <C-R>=expand("<cword>")<CR><CR>
nmap <C-/>c :cs find c <C-R>=expand("<cword>")<CR><CR>
nmap <C-/>t :cs find t <C-R>=expand("<cword>")<CR><CR>
nmap <C-/>e :cs find e <C-R>=expand("<cword>")<CR><CR>
nmap <C-/>f :cs find f <C-R>=expand("<cfile>")<CR><CR>
nmap <C-/>i :cs find i ^<C-R>=expand("<cfile>")<CR>$<CR>
nmap <C-/>d :cs find d <C-R>=expand("<cword>")<CR><CR>
"hit 'CTRL-j'
nmap <C-j>s :cs find s <C-R>=expand("<cword>")<CR><CR>
nmap <C-j>g :cs find g <C-R>=expand("<cword>")<CR><CR>
nmap <C-j>c :cs find c <C-R>=expand("<cword>")<CR><CR>
nmap <C-j>t :cs find t <C-R>=expand("<cword>")<CR><CR>
nmap <C-j>e :cs find e <C-R>=expand("<cword>")<CR><CR>
nmap <C-j>f :cs find f <C-R>=expand("<cfile>")<CR><CR>
nmap <C-j>i :cs find i ^<C-R>=expand("<cfile>")<CR>$<CR>
nmap <C-j>d :cs find d <C-R>=expand("<cword>")<CR><CR>
"### cscope end ####
 
"### MISC ###
"Remove the Windows ^M
"noremap <Leader>m :%s//r//g<CR>
noremap <Leader>m :%s/^M//g<CR>
"noremap <C-j>m :%s//r//g <C-R>=expand("<cword>")<CR><CR>
"### colour ###
" try to load a nice colourscheme
"color inkpot
"colorscheme molokai
"colorscheme delek
"colorscheme torte
"colorscheme zhiyu
"colorscheme fog
"colorscheme cleanphp
"colorscheme rastafari
"colorscheme lettuce
"colorscheme jhdark
colorscheme icansee
"colorscheme greens
"### ctags begin ###
if $CTAGS_DB_KERNEL != ""
    set tags=$CTAGS_DB_KERNEL
elseif $CTAGS_DB_ANDROID != ""
    set tags=$CTAGS_DB_ANDROID
endif
"set autochdir
"### ctags end ###
" auto complete
""" command line
set wildmenu
set wildmode=longest:full
""" text
set completeopt=menu,longest,preview
set pumheight=15

原创粉丝点击