vim .vimrc

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了vim .vimrc相关的知识,希望对你有一定的参考价值。


set tabstop=4
set number
set cul 
set cuc 
hi CursorColumn ctermfg=3 ctermbg=2
function InsertPythonComment()
    exe normal.1.G
    let line = getline(.)
    if line =~ ^#!.*$ || line =~ ^#.*coding:.*$
        return
    endif
    normal O
    call setline(., #!/usr/bin/env python)
    normal o
    call setline(., # -*- coding:utf-8 -*-)
    normal o
    call setline(.,  )
    normal o
    call setline(., # Author : .g:python_author)
    normal o
    call setline(., # E-mail : .g:python_email)                                                                                                                                                     
    normal o
    call setline(., # Date   : .strftime("%y/%m/%d %H:%M:%S"))
    normal o
    call setline(., # Desc   : )
    normal o
    call setline(.,  )
    normal o
    call cursor(7, 17) 
endfunction
function InsertCommentWhenOpen()
    if a:lastline == 1 && !getline(.)
        call InsertPythonComment()
    end 
endfunc
au FileType python :%call InsertCommentWhenOpen()
au FileType python map <F4> :call InsertPythonComment()<cr>
        
let g:python_author = zhibo.wang
let g:python_email  = [email protected]

 

以上是关于vim .vimrc的主要内容,如果未能解决你的问题,请参考以下文章