Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 2918d1e

Browse files
committed
Merge pull request honza#387 from feju/master
Julia: Snippets for Julia
2 parents ad8d939 + 40e9ffc commit 2918d1e

File tree

1 file changed

+99
-0
lines changed

1 file changed

+99
-0
lines changed

snippets/julia.snippets

Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
snippet #!
2+
#!/usr/bin/env julia
3+
4+
# Functions
5+
snippet fun function definition
6+
function ${1}(${2})
7+
${0}
8+
end
9+
10+
snippet ret return
11+
return(${0})
12+
13+
# Printing to console
14+
snippet pr print
15+
print("${1}")
16+
${0}
17+
18+
snippet prl print line
19+
println("${1}")
20+
${0}
21+
22+
# Includes
23+
snippet use load a package
24+
using ${0}
25+
26+
snippet incl include source code
27+
include("${1}")
28+
${0}
29+
30+
# Loops
31+
snippet forc for loop iterating over iterable container
32+
for ${1} in ${2}
33+
${0}
34+
end
35+
36+
snippet for standard for loop
37+
for ${1} = ${2}
38+
${0}
39+
end
40+
41+
snippet fornest nested for loop
42+
for ${1} = ${2}, ${3} = ${4}
43+
${0}
44+
end
45+
46+
snippet wh while loop
47+
while ${1} ${2:<=} ${3}
48+
${0}
49+
end
50+
51+
# Conditionals
52+
snippet if if statement
53+
if ${1}
54+
${0}
55+
end
56+
57+
snippet el else part of statement
58+
else
59+
${0}
60+
61+
snippet eif else if part of if statement
62+
else if ${1}
63+
${0}
64+
65+
snippet ife full if-else statement
66+
if ${1}
67+
${2}
68+
else
69+
${0}
70+
end
71+
72+
# Exceptions
73+
snippet try try catch
74+
try
75+
${1}
76+
catch ${2}
77+
${0}
78+
end
79+
80+
snippet fin finally statement
81+
finally
82+
${0}
83+
84+
snippet thr throw
85+
throw(${1})
86+
${0}
87+
88+
# Messages
89+
snippet in
90+
info("${1}")
91+
${0}
92+
93+
snippet wa
94+
warn("${1}")
95+
${0}
96+
97+
snippet err
98+
error("${1}")
99+
${0}

0 commit comments

Comments
 (0)