1
0
mirror of https://github.com/amix/vimrc synced 2025-06-16 01:25:00 +08:00

Updated plugins

This commit is contained in:
Amir
2022-08-08 15:45:56 +02:00
parent b41536726f
commit 765adb9da3
216 changed files with 4784 additions and 2112 deletions

View File

@ -12,6 +12,7 @@ snippet uni
${0:representation}
snippet from
from ${1:package} import ${0:module}
# Module Docstring
snippet docs
"""
@ -29,18 +30,22 @@ snippet sk "skip unittests" b
snippet wh
while ${1:condition}:
${0:${VISUAL}}
# dowh - does the same as do...while in other languages
snippet dowh
while True:
${1}
if ${0:condition}:
break
snippet with
with ${1:expr} as ${2:var}:
${0:${VISUAL}}
snippet awith
async with ${1:expr} as ${2:var}:
${0:${VISUAL}}
# New Class
snippet cl
class ${1:ClassName}(${2:object}):
@ -52,11 +57,24 @@ snippet cl
snippet cla
class ${1:class_name}:
"""${0:description}"""
snippet clai
class ${1:class_name}:
"""${2:description}"""
def __init__(self, ${3:args}):
${0}
# Data class
snippet dcl dataclass
@dataclass
class ${1:ClassName}:
"""${2:description}"""
${3:var_1}: ${4:int}
${5:var_2}: ${6:float} = ${7:0}
def ${8:total}(self): -> $6:
return ${0:self.$3 * self.$5}
# New Function
snippet def
def ${1:fname}(${2:`indent('.') ? 'self' : ''`}):
@ -72,6 +90,7 @@ snippet adef
snippet adeff
async def ${1:fname}(${2:`indent('.') ? 'self' : ''`}):
${0}
# New Method
snippet defi
def __init__(self, ${1:args}):
@ -88,11 +107,11 @@ snippet property
@property
def ${1:foo}(self) -> ${2:type}:
"""${3:doc}"""
return self._${1:foo}
return self._$1
@${1:foo}.setter
def ${1:foo}(self, value: ${2:type}):
self._${1:foo} = value
@$1.setter
def $1(self, value: $2):
self._$1 = value
# Ifs
snippet if
@ -104,10 +123,28 @@ snippet el
snippet ei
elif ${1:condition}:
${0:${VISUAL}}
# Match
snippet match Structural pattern matching
match ${1:expression}:
case ${2:pattern_1}:
${3:pass}
case ${4:pattern_2}:
${5:pass}
# Match with wildcard
snippet matchw Pattern matching with wildcard
match ${1:expression}:
case ${2:pattern_1}:
${3:pass}
case _:
${0:pass}
# For
snippet for
for ${1:item} in ${2:items}:
${0}
# Encodes
snippet cutf8
# -*- coding: utf-8 -*-
@ -115,15 +152,18 @@ snippet clatin1
# -*- coding: latin-1 -*-
snippet cascii
# -*- coding: ascii -*-
# Lambda
snippet ld
${1:var} = lambda ${2:vars} : ${0:action}
snippet ret
return ${0}
snippet .
self.
snippet sa self.attribute = attribute
self.${1:attribute} = $1
snippet try Try/Except
try:
${1:${VISUAL}}
@ -152,6 +192,7 @@ snippet tryef Try/Except/Else/Finally
${5}
finally:
${0}
# if __name__ == '__main__':
snippet ifmain
if __name__ == '__main__':
@ -159,6 +200,10 @@ snippet ifmain
# __magic__
snippet _
__${1:init}__
# debugger breakpoint
snippet br
breakpoint()
# python debugger (pdb)
snippet pdb
__import__('pdb').set_trace()
@ -192,9 +237,11 @@ snippet nosetrace
__import__('nose').tools.set_trace()
snippet pprint
__import__('pprint').pprint(${1})
snippet "
"""${0:doc}
"""
# assertions
snippet a=
self.assertEqual(${0}, ${1})
@ -215,6 +262,7 @@ snippet tgwt
# then: ${3}
snippet fut
from __future__ import ${0}
#getopt
snippet getopt
try:
@ -232,6 +280,7 @@ snippet getopt
${0}
elif option in ("-v", "--verbose"):
verbose = argument
# argparse
snippet addp
parser = ${VISUAL:argparse.}ArgumentParser()
@ -275,7 +324,7 @@ snippet epydoc
"""
snippet dol
def ${1:__init__}(self, *args, **kwargs):
super(${0:ClassName}, self).$1(*args, **kwargs)
super(${0:ClassName}, self).$1(*args, **kwargs)
snippet kwg
self.${1:var_name} = kwargs.get('$1', ${2:None})
snippet lkwg