Skip to content

Commit

Permalink
add some snippet (#469)
Browse files Browse the repository at this point in the history
  • Loading branch information
xiliuya authored May 7, 2024
1 parent ed04a0b commit 6fafad1
Show file tree
Hide file tree
Showing 16 changed files with 105 additions and 0 deletions.
7 changes: 7 additions & 0 deletions snippets/gdscript-mode/class
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# -*- mode: snippet -*-
# name: class
# key: cls
# group: object oriented
# --
class ${1:class}:
$0
6 changes: 6 additions & 0 deletions snippets/gdscript-mode/class_name
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# -*- mode: snippet -*-
# name: class_name
# key: clsn
# group: object oriented
# --
class_name ${1:Item} = ${2:"res://icons/item.png"}
6 changes: 6 additions & 0 deletions snippets/gdscript-mode/const
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# -*- mode: snippet -*-
# name: const
# key: const
# group: definitions
# --
const ${1:name} = $0
6 changes: 6 additions & 0 deletions snippets/gdscript-mode/enum
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# -*- mode: snippet -*-
# name: enum
# key: enum
# group: definitions
# --
enum $1 {$2}
7 changes: 7 additions & 0 deletions snippets/gdscript-mode/for
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# -*- mode: snippet -*-
# name: for ... in ... : ...
# key: for
# group : control structure
# --
for ${var} in ${collection}:
${0:pass}
7 changes: 7 additions & 0 deletions snippets/gdscript-mode/func
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# -*- mode: snippet -*-
# name: func
# key: f
# group: definitions
# --
func ${1:func_name} (${2:param}):
${0:pass}
7 changes: 7 additions & 0 deletions snippets/gdscript-mode/if
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# -*- mode: snippet -*-
# name: if
# key: if
# group : control structure
# --
if ${1:condition}:
${0:pass}
9 changes: 9 additions & 0 deletions snippets/gdscript-mode/ife
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# -*- mode: snippet -*-
# name: ife
# key: ife
# group : control structure
# --
if ${1:condition}:
${2:pass}
else:
${3:pass}
8 changes: 8 additions & 0 deletions snippets/gdscript-mode/match
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# -*- mode: snippet -*-
# name: match
# key: match
# group: control structure
# --
match ${1:expression}:
${2:pattern}:
${3:pass}
6 changes: 6 additions & 0 deletions snippets/gdscript-mode/onready
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# -*- mode: snippet -*-
# name: onready
# key: onr
# group: definitions
# --
onready var ${1:name} = $0
5 changes: 5 additions & 0 deletions snippets/gdscript-mode/print
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# -*- mode: snippet -*-
# name: print
# key: p
# --
print($0)
5 changes: 5 additions & 0 deletions snippets/gdscript-mode/return
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# -*- mode: snippet -*-
# name: return
# key: r
# --
return $0
6 changes: 6 additions & 0 deletions snippets/gdscript-mode/setget
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# -*- mode: snippet -*-
# name: setget
# key: vsg
# group: definitions
# --
var ${1:variable} = ${2:value} setget ${3:setterfunc}, ${4:getterfunc}
7 changes: 7 additions & 0 deletions snippets/gdscript-mode/static_func
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# -*- mode: snippet -*-
# name: static_func
# key: sf
# group: definitions
# --
static func ${1:func_name} (${2:param}):
${0:pass}
6 changes: 6 additions & 0 deletions snippets/gdscript-mode/var
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# -*- mode: snippet -*-
# name: var
# key: var
# group: definitions
# --
var ${1:name} = $0
7 changes: 7 additions & 0 deletions snippets/gdscript-mode/while
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# -*- mode: snippet -*-
# name: while
# key: wh
# group: control structure
# --
while ${1:True}:
${0:pass}

0 comments on commit 6fafad1

Please sign in to comment.