Skip to content

Commit ae5194a

Browse files
authored
Updated Snippets (#7)
* Updated Snippets * Added Kotlin snippets * Updated and Added some snippets
1 parent 33bee86 commit ae5194a

File tree

9 files changed

+106
-165
lines changed

9 files changed

+106
-165
lines changed

dist/snippets/c_cpp.snippets

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ snippet mu
7676
## Class
7777
# class
7878
snippet cl
79-
class ${1:`Filename('$1', 'name')`}
79+
class ${1:name}
8080
{
8181
public:
8282
$1(${2});
@@ -87,12 +87,12 @@ snippet cl
8787
};
8888
# member function implementation
8989
snippet mfun
90-
${4:void} ${1:`Filename('$1', 'ClassName')`}::${2:memberFunction}(${3}) {
90+
${4:void} ${1:ClassName}::${2:memberFunction}(${3}) {
9191
${5:/* code */}
9292
}
9393
# namespace
9494
snippet ns
95-
namespace ${1:`Filename('', 'my')`} {
95+
namespace ${1:name} {
9696
${2}
9797
} /* namespace $1 */
9898
##

dist/snippets/java.snippets

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,11 @@ snippet j.u
3939
##
4040
## Class
4141
snippet cl
42-
class ${1:`Filename("", "untitled")`} ${2}
42+
class $1 ${2}
4343
snippet in
44-
interface ${1:`Filename("", "untitled")`} ${2:extends Parent}${3}
44+
interface $1 ${2:extends Parent}${3}
4545
snippet tc
46-
public class ${1:`Filename()`} extends ${2:TestCase}
46+
public class $1 extends ${2:TestCase}
4747
##
4848
## Class Enhancements
4949
snippet ext
@@ -140,15 +140,15 @@ snippet /**
140140
* ${1}
141141
*/
142142
snippet @au
143-
@author `system("grep \`id -un\` /etc/passwd | cut -d \":\" -f5 | cut -d \",\" -f1")`
143+
@author $1
144144
snippet @br
145-
@brief ${1:Description}
145+
brief ${1:Description}
146146
snippet @fi
147-
@file ${1:`Filename()`}.java
147+
file ${1:name}.java
148148
snippet @pa
149-
@param ${1:param}
149+
param ${1:name}
150150
snippet @re
151-
@return ${1:param}
151+
return ${1:param}
152152
##
153153
## Logger Methods
154154
snippet debug
@@ -170,7 +170,7 @@ snippet wh
170170
##
171171
## Main method
172172
snippet main
173-
public static void main (String[] args) {
173+
public static void main(String[] args) {
174174
${1:/* code */}
175175
}
176176
##

dist/snippets/kotlin.snippets

Lines changed: 79 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,49 @@
1+
## Access Modifiers
2+
snippet po
3+
protected
4+
snippet pr
5+
private
6+
snippet int
7+
internal
8+
19
# Packages and imports
210
snippet import
311
import $1
412
snippet imp_as
513
import $1 as $2
14+
snippet j.i
15+
java.io.
16+
snippet j.n
17+
java.net.
18+
snippet j.u
19+
java.util.
20+
621
# Classes and objects
722
snippet class:Any
8-
class $1 : ${2: Any} {
23+
class $1 : ${2:Any} {
924
$0
1025
}
1126
snippet data_class
12-
data class ${1:foo}(${0})
27+
data class ${1:foo}($0)
28+
snippet interface
29+
interface $1 ${2:: Foo}
30+
snippet init
31+
init {
32+
$1
33+
}
34+
snippet constructor
35+
constructor($1) : this($2) {
36+
$0
37+
}
38+
39+
# Grtter & Setter
40+
snippet get
41+
get() = field
42+
snippet set
43+
set(value) {
44+
field = value
45+
}
46+
1347
# Functions
1448
snippet fun
1549
fun ${1:foo}() {
@@ -23,6 +57,11 @@ snippet fun:Any
2357
fun ${1:foo}(): ${2:Any} {
2458
$0
2559
}
60+
snippet infix_fun
61+
infix fun ${1:foo}($2: $3) {
62+
$0
63+
}
64+
2665
# Conditions and loops
2766
snippet if
2867
if ($1) {
@@ -41,6 +80,7 @@ snippet if_else
4180
snippet when
4281
when ($1) {
4382
$2 -> $0
83+
->
4484
}
4585
snippet for
4686
for (${1: item} in ${2: items}) {
@@ -62,9 +102,46 @@ snippet do_while
62102
do {
63103
$0
64104
} while ($1)
105+
65106
# Exceptions
66107
snippet try_catch
67108
try {
68109
$0
69110
} catch (e: Exception) {
70111
}
112+
113+
# KDoc
114+
snippet /*
115+
/**
116+
* $1
117+
*/
118+
snippet @au
119+
author $1
120+
snippet @pa
121+
param ${1:name}
122+
snippet @re
123+
return ${1:param}
124+
snippet @th
125+
throws ${1:class}
126+
127+
# Collections
128+
snippet arrof
129+
arrayOf($1)
130+
snippet arrofnull
131+
arrayOfNulls()
132+
snippet listof
133+
listOf($1)
134+
snippet mlistof
135+
mutableListOf($1)
136+
snippet mapof
137+
mapOf($1)
138+
snippet mapof
139+
mutableMapOf($1)
140+
snippet setof
141+
setOf($1)
142+
snippet msetof
143+
mutableSetOf($1)
144+
snippet hashsof
145+
hashSetOf()
146+
snippet hashmof
147+
hashMapOf()

dist/snippets/markdown.snippets

Lines changed: 12 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -81,49 +81,44 @@ snippet youtube
8181

8282
# The quote should appear only once in the text. It is inherently part of it.
8383
# See http://octopress.org/docs/plugins/pullquote/ for more info.
84-
8584
snippet pullquote
8685
{% pullquote %}
8786
${1:text} {" ${2:quote} "} ${3:text}
8887
{% endpullquote %}
8988

9089
snippet unordered_list
91-
- ${1:${SELECTED_TEXT:first}}
90+
- ${1:first}
9291
- ${2:second}
9392
- ${3:third}
94-
$0
95-
9693
snippet ordered_list
97-
1. ${1:${SELECTED_TEXT:first}}
94+
1. ${1:first}
9895
2. ${2:second}
9996
3. ${3:third}
100-
$0
101-
10297
snippet horizontal_rule
10398
----------\n
10499

105100
snippet strikethrough
106-
~~${1:${SELECTED_TEXT:Striked Text}}~~
101+
~~${1:Striked Text}~~
107102

108103
snippet bold
109-
**${1:${SELECTED_TEXT:Bold Text}}**$0
104+
**${1:Bold Text}**$0
110105

111106
snippet italic
112-
*${1:${SELECTED_TEXT:Italic Text}}*$0
107+
*${1:Italic Text}*$0
113108

114109
snippet heading1
115-
# ${1:${SELECTED_TEXT:Heading 1}}
110+
# ${1:Heading 1}
116111
snippet heading2
117-
## ${1:${SELECTED_TEXT:Heading 2}}
112+
## ${1:Heading 2}
118113
snippet heading3
119-
### ${1:${SELECTED_TEXT:Heading 3}}
114+
### ${1:Heading 3}
120115
snippet heading4
121-
#### ${1:${SELECTED_TEXT:Heading 4}}
116+
#### ${1:Heading 4}
122117
snippet heading5
123-
##### ${1:${SELECTED_TEXT:Heading 5}}
118+
##### ${1:Heading 5}
124119
snippet heading6
125-
###### ${1:${SELECTED_TEXT:Heading 6}}
120+
###### ${1:Heading 6}
126121

127122
snippet quote
128-
> ${1:${SELECTED_TEXT:Your Quote}}
123+
> ${1:Your Quote}
129124

0 commit comments

Comments
 (0)