mirror of
https://github.com/amix/vimrc
synced 2025-06-16 01:25:00 +08:00
Updated plugins and added vim-markdown
This commit is contained in:
@ -1,6 +1,9 @@
|
||||
snippet #!
|
||||
#!/usr/bin/env python
|
||||
# -*- coding: utf-8 -*-
|
||||
snippet #!2
|
||||
#!/usr/bin/env python2
|
||||
# -*- coding: utf-8 -*-
|
||||
snippet #!3
|
||||
#!/usr/bin/env python3
|
||||
# -*- coding: utf-8 -*-
|
||||
@ -211,6 +214,20 @@ snippet getopt
|
||||
${0}
|
||||
elif option in ("-v", "--verbose"):
|
||||
verbose = argument
|
||||
# argparse
|
||||
snippet addp
|
||||
parser = ${VISUAL:argparse.}ArgumentParser()
|
||||
snippet addsp
|
||||
${0:sub_parser} = parser.add_subparsers().add_parser("${1:name}")
|
||||
snippet addarg
|
||||
parser.add_argument("${0:short_arg}", "${1:long_arg}", default=${2:None}, help="${3:Help text}")
|
||||
snippet addnarg
|
||||
parser.add_argument("${0:arg}", nargs="${1:*}", default"${2:None}, help="${3:Help text}")
|
||||
snippet addaarg
|
||||
parser.add_argument("${0:arg}", "${1:long_arg}", action="${2:store_true}", default=${3:False}, help="${4:Help text}")
|
||||
snippet pargs
|
||||
"${VISUAL:return }"parser.parse_args()
|
||||
|
||||
# logging
|
||||
# glog = get log
|
||||
snippet glog
|
||||
@ -261,3 +278,166 @@ snippet dcp dict comprehension
|
||||
|
||||
snippet scp set comprehension
|
||||
{${1} for ${2} in ${3:${VISUAL}}}${0}
|
||||
|
||||
snippet contain "methods for emulating a container type" b
|
||||
def __len__(self):
|
||||
${1:pass}
|
||||
|
||||
def __getitem__(self, key):
|
||||
${2:pass}
|
||||
|
||||
def __setitem__(self, key, value):
|
||||
${3:pass}
|
||||
|
||||
def __delitem__(self, key):
|
||||
${4:pass}
|
||||
|
||||
def __iter__(self):
|
||||
${5:pass}
|
||||
|
||||
def __reversed__(self):
|
||||
${6:pass}
|
||||
|
||||
def __contains__(self, item):
|
||||
${7:pass}
|
||||
|
||||
snippet context "context manager methods" b
|
||||
def __enter__(self):
|
||||
${1:pass}
|
||||
|
||||
def __exit__(self, exc_type, exc_value, traceback):
|
||||
${2:pass}
|
||||
|
||||
snippet attr "methods for customizing attribute access" b
|
||||
def __getattr__(self, name):
|
||||
${1:pass}
|
||||
|
||||
def __setattr__(self, name, value):
|
||||
${2:pass}
|
||||
|
||||
def __delattr__(self, name):
|
||||
${3:pass}
|
||||
|
||||
snippet desc "methods implementing descriptors" b
|
||||
def __get__(self, instance, owner):
|
||||
${1:pass}
|
||||
|
||||
def __set__(self, instance, value):
|
||||
${2:pass}
|
||||
|
||||
def __delete__(self, instance):
|
||||
${3:pass}
|
||||
|
||||
snippet cmp "methods implementing rich comparison"
|
||||
def __eq__(self, other):
|
||||
${1:pass}
|
||||
|
||||
def __ne__(self, other):
|
||||
${2:pass}
|
||||
|
||||
def __lt__(self, other):
|
||||
${3:pass}
|
||||
|
||||
def __le__(self, other):
|
||||
${4:pass}
|
||||
|
||||
def __gt__(self, other):
|
||||
${5:pass}
|
||||
|
||||
def __ge__(self, other):
|
||||
${6:pass}
|
||||
|
||||
def __cmp__(self, other):
|
||||
${7:pass}
|
||||
|
||||
snippet repr "methods implementing string representation"
|
||||
def __repr__(self):
|
||||
${1:pass}
|
||||
|
||||
def __str__(self):
|
||||
${2:pass}
|
||||
|
||||
def __unicode__(self):
|
||||
${3:pass}
|
||||
|
||||
# note: reflected operands and augmented arithmeitc assignements have been
|
||||
# intentionally ommited to reduce verbosity.
|
||||
snippet numeric "methods for emulating a numeric type" b
|
||||
def __add__(self, other):
|
||||
${1:pass}
|
||||
|
||||
def __sub__(self, other):
|
||||
${2:pass}
|
||||
|
||||
def __mul__(self, other):
|
||||
${3:pass}
|
||||
|
||||
def __div__(self, other):
|
||||
${4:pass}
|
||||
|
||||
def __truediv__(self, other):
|
||||
${5:pass}
|
||||
|
||||
def __floordiv__(self, other):
|
||||
${6:pass}
|
||||
|
||||
def __mod__(self, other):
|
||||
${7:pass}
|
||||
|
||||
def __divmod__(self, other):
|
||||
${8:pass}
|
||||
|
||||
def __pow__(self, other):
|
||||
${9:pass}
|
||||
|
||||
def __lshift__(self, other):
|
||||
${10:pass}
|
||||
|
||||
def __rshift__(self, other):
|
||||
${11:pass}
|
||||
|
||||
def __and__(self, other):
|
||||
${12:pass}
|
||||
|
||||
def __xor__(self, other):
|
||||
${13:pass}
|
||||
|
||||
def __or__(self, other):
|
||||
${14:pass}
|
||||
|
||||
def __neg__(self):
|
||||
${15:pass}
|
||||
|
||||
def __pos__(self):
|
||||
${16:pass}
|
||||
|
||||
def __abs__(self):
|
||||
${17:pass}
|
||||
|
||||
def __invert__(self):
|
||||
${18:pass}
|
||||
|
||||
def __complex__(self):
|
||||
${19:pass}
|
||||
|
||||
def __int__(self):
|
||||
${20:pass}
|
||||
|
||||
def __long__(self):
|
||||
${21:pass}
|
||||
|
||||
def __float__(self):
|
||||
${22:pass}
|
||||
|
||||
def __oct__(self):
|
||||
${22:pass}
|
||||
|
||||
def __hex__(self):
|
||||
${23:pass}
|
||||
|
||||
def __index__(self):
|
||||
${24:pass}
|
||||
|
||||
def __coerce__(self, other):
|
||||
${25:pass}
|
||||
|
||||
|
Reference in New Issue
Block a user