免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 914 | 回复: 0
打印 上一主题 下一主题

我的vim配置文件 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2008-02-29 09:59 |只看该作者 |倒序浏览

               
               
                " Last Change: 2008-02-29 09:54:46
set tag=tags;../tags;../../tags;../../../tags;../../../../../tags;../../../../../../tags;../../../../../../../../tags;
set tabstop=4 "when you click TAB,indent 4 character
set softtabstop=4
set shiftwidth=4
set history=200
"Del the bell when you use vim error
set vb t_vb=
set foldmethod=syntax "open fold
set autoindent
set expandtab "use  replace
set background=dark "this let comment line more light
set showmatch " let '(','{','[' can auto match by ')','}',']'
set showcmd
set showmode
set nu "show line number at front
set incsearch "when you serach, searching characters which you have entered
set ruler      
set laststatus=2 "show status in bottom
set bs=2 "this fix backspace cannot use in vim70
set hlsearch
iab #b /***********************Zeroman add here for test************************
iab #e ************************Zeroman add here for test************************/
iab #o /***********************Zeroman add here for test************************/
iab #d #include "/debug/gcc4_debug.h"
set mouse=a
set dir=/tmp/vim
set backupdir=/tmp/vim/bak
set nobackup
syntax on   
set nocp
              
if version>=600
    filetype plugin indent on
endif
if version >= 603
    set helplang=cn
endif
"set path =.,/usr/include,./include,./../include,./../../include,./../../../include,./../../../../include,,
set path =.,/usr/local/arm/arm-uclibc/include/,./include,./../include,./../../include,./../../../include,./../../../../include,,
"set encoding=utf-8 " set default encoding as UTF-8
"set fileencodings=ucs-bom,utf-8,cp936,latin1 " fileconding detection order
"set termencoding=utf-8 " support Chinese display in rxvt-unicode
map  :w
"map  ShowFunc
map  :TlistToggle
map  :call Do_lint()
map  i/*   */3hi
map , :
nmap B :call Do_make()
nmap C :cclose
nmap c :close
imap j OB
imap h OD
imap k OA
imap l OC
imap w ebdei
map z 0i//:noh
map x :s/\/\///g
:noh
"auto load cscope.out
if has("cscope")
    set csprg=/usr/bin/cscope
    set csto=0
    set cst
    set nocsverb
    let n = 1
    let s1 = "cscope.out"
    let csout = "cscope add "
    while n = csout . s1
            execute csout
            unlet csout
            unlet n
            unlet s1
            break
        endif
        let s1 = "../" . s1
        let n = n + 1
    endw
    set csverb
endif
nmap s :cscope find s =expand("")CR>
nmap g :cscope find g =expand("")CR>
nmap d :cscope find d =expand("")CR> =expand("%")CR>
nmap c :cscope find c =expand("")CR>
nmap t :cscope find t =expand("")CR>
nmap e :cscope find e =expand("")CR>
nmap f :cscope find f =expand("")CR>
nmap i :cscope find i ^=expand("")CR>$
function Do_make()
   let target = "make "
   execute target
   execute "copen"
endfunction
function! Timestamp(comment)
    if (a:comment == '')
        return
    endif
    let pattern = '\('.a:comment.' Last Change:\s\+\)\d\{4}-\d\{2}-\d\{2} \d\{2}:\d\{2}:\d\{2}'
    let row = search('\%^\_.\{-}\(^\zs' . pattern . '\)', 'n')
    let now = strftime('%Y-%m-%d %H:%M:%S', localtime())
    if row != 0
        let new_row_str =substitute(getline(row), '^' . pattern , '\1', '') . now
        call setline(row, new_row_str)
    else
        normal m'
        silent! :1
        normal O
        let new_row_str = a:comment . " Last Change: " . now
        call setline(1, new_row_str)
        normal ''
    endif
endfunction
"au BufWritePre *vimrc,*.vim       call Timestamp('"')
au BufWritePre .exrc           call Timestamp('


本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u/10864/showart_486619.html
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP