From 48a3488fabebab99894b1cf09975459f8dcffe99 Mon Sep 17 00:00:00 2001 From: REmerald <55359236+REmerald@users.noreply.github.com> Date: Tue, 29 Apr 2025 15:31:49 +0300 Subject: [PATCH 1/2] fix some python snippet prefixes, add init snippet Change "#", "##" to "#ss", "#s", so that the cmp plugin puts in higher. Add __init__ method snippet. --- snippets/python/python.json | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/snippets/python/python.json b/snippets/python/python.json index eae0151f..d9d9b88f 100644 --- a/snippets/python/python.json +++ b/snippets/python/python.json @@ -10,12 +10,12 @@ "description": "Ignore specific line diagnostic in pyright (ignore all is unsafe)" }, "Multiline string": { - "prefix": "#", + "prefix": "#ss", "body": ["\"\"\"$0", "\"\"\""], "description": "Snippet to avoid autopair plugin annoyances when typing multiple \"" }, "One-line multiline string": { - "prefix": "##", + "prefix": "#s", "body": "\"\"\"$0\"\"\"", "description": "Snippet to avoid autopair plugin annoyances when typing multiple \"" }, @@ -140,15 +140,20 @@ "description": "Class definition template" }, "Method": { - "prefix": "defs", + "prefix": "defm", "body": ["def ${1:mname}(self$2):", "\t${3:pass}"], "description": "Class method definition" }, "Method w/ return type": { - "prefix": "defst", + "prefix": "defmt", "body": ["def ${1:mname}(self$2) -> ${3:None}:", "\t${4:pass}"], "description": "Class method definition" }, + "Init method": { + "prefix": "defi", + "body": ["def __init__(self$1):", "\t${2:pass}"], + "description": "Class method definition" + }, "property template": { "prefix": "property", "body": [ From d4177ccaef6df8fa14844058ceecffa3512bba04 Mon Sep 17 00:00:00 2001 From: REmerald <55359236+REmerald@users.noreply.github.com> Date: Tue, 29 Apr 2025 22:19:02 +0300 Subject: [PATCH 2/2] Minor change, add `'''` snippets Make #s... prefixes more convenient, add single-quote multiline string snippets. --- snippets/python/python.json | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/snippets/python/python.json b/snippets/python/python.json index d9d9b88f..3b664ceb 100644 --- a/snippets/python/python.json +++ b/snippets/python/python.json @@ -10,14 +10,24 @@ "description": "Ignore specific line diagnostic in pyright (ignore all is unsafe)" }, "Multiline string": { - "prefix": "#ss", + "prefix": "#s", "body": ["\"\"\"$0", "\"\"\""], - "description": "Snippet to avoid autopair plugin annoyances when typing multiple \"" + "description": "Snippet to avoid weird autopair plugin behaviour" }, "One-line multiline string": { - "prefix": "#s", + "prefix": "#ss", "body": "\"\"\"$0\"\"\"", - "description": "Snippet to avoid autopair plugin annoyances when typing multiple \"" + "description": "Snippet to avoid weird autopair plugin behaviour" + }, + "Single-quote multiline string": { + "prefix": "#q", + "body": ["'''$0", "'''"], + "description": "Snippet to avoid weird autopair plugin behaviour" + }, + "One-line single-quote multiline string": { + "prefix": "#qq", + "body": "'''$0'''", + "description": "Snippet to avoid weird autopair plugin behaviour" }, "self": { "prefix": "s",