zoukankan      html  css  js  c++  java
  • 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()
    
            
    let g:python_author = 'zhibo.wang'
    let g:python_email  = 'gm.zhibo.wang@gmail.com'
  • 相关阅读:
    协程
    多进程
    多线程
    模块进阶
    内建函数
    内建属性
    属性property
    私有化
    深拷贝、浅拷贝
    ==、is
  • 原文地址:https://www.cnblogs.com/dockers/p/7513036.html
Copyright © 2011-2022 走看看