snippet ##
# -*- coding: utf-8 -*-
"""
${1:`Filename('$1.py', 'foo.py')`}
~~~~~~~~~~~~~~
${2:A brief description goes here.}
:copyright: (c) 2012 by leon.
:license: MIT, see LICENSE for more details.
"""
def _main(argv):
${3}
if __name__ == '__main__':
import sys
_main(sys.argv)
|
Copyright (C) <${year}> <COPYRIGHT HOLDERS>
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
"将一下代码copy到 用户目录下 新建文件为 .vimrc
"保存即可生效; 如果想所有用户生效 请修改 /etc/vimrc (建议先cp一份)
set nocompatible "not compatible with vi
set number
"set paste
set ruler
set autoindent "please place the autoindent after paste
set tabstop=4
set shiftwidth=4
set softtabstop=4
set expandtab "replace tab with space
set smarttab
set list
set listchars=tab:>-,trail:-
if exists('+colorcolumn')
set colorcolumn=80
else
au BufWinEnter * let w:m2=matchadd('ErrorMsg', '\%>80v.\+', -1)
endif
set cursorline "highlight current line
set scrolloff=6
set autochdir
set foldenable
set foldmethod=indent
set fml=7
set foldnestmax=1
set hlsearch
set incsearch
set encoding=utf-8
set fileencoding=utf-8
syntax on
filetype plugin on
map <F12> :!python %
" for pyflakes's conflict with ubuntu terminal
highlight SpellBad cterm=italic ctermbg=14
set updatetime=500
" highlight current word
autocmd CursorHold * silent! exe printf('match incsearch /\<%s\>/', expand('<cword>'))
autocmd CursorHold * silent! foldopen
if has("autocmd")
au BufReadPost * if line("'\"") > 1 && line("'\"") <= line("$") | exe "normal! g'\"" | endif
|