vimrc

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | Submodules

commit 9a349a1c2560ee5816f53585b1515945e715c17a
parent 6a68b4da16666ce300ea3c1559eb878bcc2dfcb7
Author: Pablo Cárdenas <pablo.cardenas@imca.edu.pe>
Date:   Wed, 15 Feb 2023 22:52:50 -0500

Added python snippets

Diffstat:
MUltiSnips/python.snippets | 14++++++--------
1 file changed, 6 insertions(+), 8 deletions(-)

diff --git a/UltiSnips/python.snippets b/UltiSnips/python.snippets @@ -198,15 +198,13 @@ endsnippet snippet dcl "dataclass" b -@dataclass -class ${1:MyClass}: - """${2:Docstring for $1.} +@dataclass`!p snip.rv = "(" if t[1] or t[2] else ""`${1/(.+)/(?1:frozen=)/}${1:True}`!p snip.rv = ', ' if t[1] and t[2] else ""`${2/(.+)/(?1:order=)/}${2:True}`!p snip.rv = ")" if t[1] or t[2] else ""` +class ${3:MyClass}: + """${4:Docstring for $3.} """ - ${3:var_1}: ${4:int} - ${5:var_2}: ${6:float} = ${7:0} - - def ${8:total}(self): -> $6: - return ${0:self.$3 * self.$5} + var_1: int + var_2: float + var_3: str endsnippet snippet namedtuple "namedtuple" b