Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit b0010e8

Browse files
committedJul 15, 2015
update c.snip, cpp.snip, python.snip, and sh.snip
cpp.snip: fix snippet of enum struct * add name placeholder * semicolon is required cpp.snip: update snippet of try-catch set default value `...` (any exception is catched) cpp.snip: update snippet of lambda expression * to jump to end of body * semicolon is sometimes required (e.g. in case of declaration) c.snip: update snippet of for * add type specifier: default is int (C99 feature) * set default index to i * set default initial value to 0 python.snip: use hard tab for indentation python.snip: set default value `pass` sh.snip: fix snippet of heredoc
1 parent 0fc709d commit b0010e8

File tree

4 files changed

+37
-36
lines changed

4 files changed

+37
-36
lines changed
 

‎neosnippets/c.snip

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ abbr if () {} else {}
2424

2525
snippet for
2626
abbr for () {}
27-
for (${1} = 0; $1 < ${2}; $1++) {
28-
${0:TARGET}
27+
for (${1:int} ${2:i} = ${3:0}; $2 < ${4}; $2++) {
28+
${0:#:TARGET}
2929
}
3030

3131
snippet while

‎neosnippets/cpp.snip

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ abbr class {}
3333
snippet try
3434
abbr try catch
3535
try {
36-
${1:TARGET}
37-
} catch (${2:e:xception}) {
36+
${1:#:TARGET}
37+
} catch (${2:...}) {
3838
${3}
3939
}
4040

@@ -48,12 +48,12 @@ abbr for (:) {}
4848
# lambda expression ( C++11 feature )
4949
snippet lambda
5050
abbr [](){}
51-
[${1}](${2})${3}{ ${4:TARGET} }
51+
[${1}](${2})${3}{ ${4:TARGET} }${0:;}
5252

5353
# scoped enumeration ( C++11 feature )
5454
snippet enum_scoped
55-
abbr enum struct {}
56-
enum struct { ${1:TARGET} }
55+
abbr enum struct {};
56+
enum struct ${1:#:name} { ${2:#:TARGET} };
5757

5858
# static assert ( C++11 feature )
5959
snippet static_assert

‎neosnippets/python.snip

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ abbr class Class(...): ...
1010
options head
1111
class ${1:#:name}(${2:object}):
1212
def __init__(self, ${3}):
13-
${0}
13+
${0:pass}
1414

1515
snippet classd
1616
abbr class Class(...): "..."
@@ -19,129 +19,129 @@ options head
1919
"""${3:#:class documentation}"""
2020
def __init__(self, ${4}):
2121
"""${5:#:__init__ documentation}"""
22-
${0}
22+
${0:pass}
2323

2424
snippet def
2525
abbr def function(...): ...
2626
options head
2727
def ${1:#:name}(${2}):
28-
${0:TARGET}
28+
${0:pass}
2929

3030
snippet defd
3131
abbr def function(...): """..."""
3232
options head
3333
def ${1:#:name}(${2}):
3434
"""${3:#:function documentation}"""
35-
${0:TARGET}
35+
${0:pass}
3636

3737
snippet defm
3838
abbr def method(self, ...): ...
3939
options head
4040
def ${1:#:name}(self, ${2}):
41-
${0:TARGET}
41+
${0:pass}
4242

4343
snippet defmd
4444
abbr def method(self, ...): "..."
4545
options head
4646
def ${1:#:name}(self, ${2}):
4747
"""${3:#:method documentation}"""
48-
${0:TARGET}
48+
${0:pass}
4949

5050
snippet elif
5151
abbr elif ...: ...
5252
options head
5353
elif ${1:#:condition}:
54-
${0}
54+
${0:pass}
5555

5656
snippet else
5757
abbr else: ...
5858
options head
5959
else:
60-
${0}
60+
${0:pass}
6161

6262
snippet fileidiom
6363
abbr with open()
6464
options head
6565
with open(${1:#:filename}, '${2:#:mode}') as ${3:f}:
66-
${0:TARGET}
66+
${0:pass}
6767

6868
snippet for
6969
abbr for ... in ...: ...
7070
options head
7171
for ${1:#:value} in ${2:#:list}:
72-
${0:TARGET}
72+
${0:pass}
7373

7474
snippet if
7575
abbr if ...: ...
7676
options head
7777
if ${1:#:condition}:
78-
${0:TARGET}
78+
${0:pass}
7979

8080
snippet ifmain
8181
abbr if __name__ == '__main__': ...
8282
alias main
8383
options head
8484
if __name__ == '__main__':
85-
${0:TARGET}
85+
${0:pass}
8686

8787
snippet tryexcept
8888
abbr try: ... except ...: ...
8989
options head
9090
try:
91-
${1:TARGET}
91+
${1:pass}
9292
except ${2:#:ExceptionClass}:
93-
${3}
93+
${3:pass}
9494

9595
snippet tryfinally
9696
abbr try: ... finally: ...
9797
options head
9898
try:
99-
${1:TARGET}
99+
${1:pass}
100100
finally:
101-
${2}
101+
${2:pass}
102102

103103
snippet while
104104
abbr while ...: ...
105105
options head
106106
while ${1:#:condition}:
107-
${0:TARGET}
107+
${0:pass}
108108

109109
snippet with
110110
abbr with {func}({file}) as :
111111
options head
112112
with ${1:open}(${2:#:filename, mode}) as ${3:f}:
113-
${0:TARGET}
113+
${0:pass}
114114

115115
snippet filter
116116
abbr [x for x in {list} if {condition}]
117117
[$1 for ${1:x} in ${2:#:list} if ${3:#:condition}]
118118

119119
snippet print
120120
options word
121-
print(${0:TARGET})
121+
print(${0:#:TARGET})
122122

123123
snippet coding
124124
abbr # -*- coding ...
125-
# -*- coding: utf-8 -*-
125+
# -*- coding: utf-8 -*-
126126

127127
snippet getattr
128128
abbr getattr(..., ...)
129129
options word
130-
getattr(${1:#:obj}, ${2:#:attr})
130+
getattr(${1:#:obj}, ${2:#:attr})
131131

132132
snippet setattr
133133
abbr setattr(..., ...)
134-
setattr(${1:#:obj}, ${2:#:attr}, ${3:#:value})
134+
setattr(${1:#:obj}, ${2:#:attr}, ${3:#:value})
135135

136136
snippet hasattr
137137
abbr hasattr(..., ...)
138138
options word
139-
hasattr(${1:#:obj}, ${2:#:attr})
139+
hasattr(${1:#:obj}, ${2:#:attr})
140140

141141
snippet pdb
142142
abbr import pdb..
143-
import pdb; pdb.set_trace()
143+
import pdb; pdb.set_trace()
144144

145145
snippet ipdb
146146
abbr import ipdb..
147-
import ipdb; ipdb.set_trace()
147+
import ipdb; ipdb.set_trace()

‎neosnippets/sh.snip

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,11 @@ snippet until
4040
done
4141

4242

43-
snippet here
44-
alias h
45-
<<${1}
46-
${0:TARGET}
43+
snippet heredoc
44+
alias h <<
45+
<< ${1:EOF}
46+
${0:#:TARGET}
47+
$1
4748

4849
snippet env
4950
#!/usr/bin/env ${1}

0 commit comments

Comments
 (0)
Please sign in to comment.