-
Notifications
You must be signed in to change notification settings - Fork 0
/
config_geany_snippets.conf
192 lines (174 loc) · 9.04 KB
/
config_geany_snippets.conf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
# g++ -Wall -o "%e.out" "%f" -std=c++14 -lgtest -lgtest_main -lpthread
# Geany's snippets configuration file
#
# use \n or %newline% for a new line (it will be replaced by the used EOL char(s) - LF, CR/LF, CR).
# use \t or %ws% for an indentation step, it will be replaced according to the current document's indent mode.
# use \s to force whitespace at beginning or end of a value ('key= value' won't work, use 'key=\svalue').
# use %key% for all keys defined in the [Special] section.
# use %cursor% to define where the cursor should be placed after completion. You can define multiple
# %cursor% wildcards and use the "Move cursor in snippet" to jump to the next defined cursor
# position in the completed snippet.
# You can define a section for each supported filetype to overwrite default settings, the section
# name must match exactly the internal filetype name, run 'geany --ft-names' for a full list.
#
# Additionally, you can use most of the template wildcards like {developer}, {command:...},
# or {date} in the snippets.
# See the documentation for details.
# For a list of available filetype names, execute:
# geany --ft-names
# Default is used for all filetypes and keys can be overwritten by [filetype] sections
[Default]
site=Title: %cursor%\nDate: {command:date +"%d-%b-%Y %T"}\nCategory: myCategory\nModified: {command:date +"%d-%b-%Y %T"}
now={command:date +"%d-%b-%Y %T"}
cuda=#include <stdio.h>\n#include <cuda.h>\n__global__ void kernel(){\n\tprintf("hi \\n");\n}\nint main(){\n\tkernel<<<1,32>>>();\n\tcudaDeviceSynchronize();\n\treturn 0;\n}\n
acc=//~~~START:{command:date +"%a, %d-%b-%Y, %T %Z"}\n//~~~Author:Rajesh Pandian M | mrprajesh.co.in\n//~ nvc++ -acc -gpu=managed -Minfo=all hello.cpp -o hello.out && ./hello.out\n//~ nvc++ -acc=multicore -Minfo=all -fopenmp hello.cpp -o hello.out && ./hello.out\n\n#include <iostream>\n\nusing namespace std;\n\nint main(int argc, char* argv[]) {\n unsigned n = 1 << 30;\n std::cout << "N:" << n << '\\n';\n\n \n int* a = (int*) malloc (sizeof(int) *n);\n\n unsigned long long int sum = 0.0;\n \n #pragma acc parallel loop copyin(a) \n for (unsigned i = 0; i < n; ++i) {\n a[i] = i;\n }\n\n #pragma acc parallel loop reduction (+:sum)\n for (unsigned i = 0; i < n; ++i) {\n a[i] = a[i]%2;\n sum += a[i];\n }\n\n\n for (unsigned i = 0; i < 10; ++i) {\n std::cout<< i << " " << a[i] << '\\n';\n }\n std::cout << "Sum: " << sum << std::endl; \n \n return 0;\n}
cpp=//~~~START:{command:date +"%a, %d-%b-%Y, %T %Z"}\n//~~~Author:{developer} | mrprajesh.co.in \n#include <bits/stdc++.h>\nusing namespace std;\nint main(int argc, char* argv[]){\n\tstd::cout << "Hello Dear Programmer! \\n\\n --cpp\\n";\n\t%cursor%\n\treturn 0;\n}\n
euler=//START-{command:date +"%a, %d-%b-%Y, %T %Z"}\n//~~~Author:{developer} | mrprajesh.co.in \n#include "rajzlib.cxx"\ntypedef unsigned long long int ull;\nusing namespace std;\nint main(int argc, char* argv[]){\n\tstd::cout << "Hello Dear Programmer! \\n\\n --cpp\\n";\n\t%cursor%\n\treturn 0;\n}\n
c=#include <stdio.h>\nint main(){\n\t%cursor%\n\treturn 0;\n}
warn=<aside class="warning"> </aside>
note=<aside class="notice"> </aside>
vec=std::vector
vector=std::vector
cout=std::cout<< "%cursor%" << '\\n';
cin=std::cin
pair=std::pair
set=std::set
link=[%cursor%](url)
url=[%cursor%](url)
code=<pre>\n%cursor% \n</pre>
jlink=[%cursor%]({% link _posts/name-of-the-post-file.md %})
raw={% raw %}\n%cursor% \n{% endraw %}
h3=### %cursor%
h4=#### %cursor%
C=:clubs:
S=:spades:
H=:hearts:
D=:diamonds:
J=:black_joker:
to=:fast_forward::fast_forward:
img=![image NOT lOaDeD](images/%cursor%)
ull=typedef unsigned long long int ull; //use llu in printf
ll=typedef long long int ll;
printv=template <typename Container>\nvoid print(const Container &data){\n\tstd::copy(data.begin(),data.end(),\n\tstd::ostream_iterator<typename Container::value_type>(std::cout, " "));\n\tstd::cout<<'\\n';\n}
print=std::copy(list.begin(), list.end(),std::ostream_iterator<int>(std::cout, " ")); std::cout<< std::endl; //#include <iterator> //ostream_iterator
# special keys to be used in other snippets, cannot be used "standalone"
# can be used by %key%, e.g. %brace_open%
# nesting of special keys is not supported (e.g. brace_open=\n{\n%brace_close% won't work)
# key "wordchars" is very special, it defines the word delimiting characters when looking for
# a word to auto complete, leave commented to use the default wordchars
[Special]
brace_open=\n{\n\t
brace_close=}\n
block=\n{\n\t%cursor%\n}
block_cursor=\n{\n\t%cursor%\n}
#wordchars=_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789
# Optional keybindings to insert snippets
# Note: these can be overridden by Geany's configurable keybindings
[Keybindings]
#! #for=<Ctrl>7
[C]
if=if (%cursor%)%block_cursor%
else=else%block_cursor%
for=for (i = 0; i < %cursor%; i++)%block_cursor%
while=while (%cursor%)%block_cursor%
do=do\n{\n\t%cursor%\n} while (%cursor%)\n
switch=switch (%cursor%)%brace_open%case %cursor%:\n\t\t%cursor%\n\t\tbreak;\n\tdefault:\n\t\t%cursor%\n%brace_close%
fast=ios_base::sync_with_stdio(false);\ncin.tie(NULL);
[C++]
if=if (%cursor%)%block_cursor%
else=else%block_cursor%
for=for (int i = 0; i < %cursor%; i++)%brace_open%\n%brace_close%
while=while (%cursor%)%block_cursor%
do=do\n{\n\t%cursor%\n} while (%cursor%)\n
switch=switch (%cursor%)%brace_open%case %cursor%:\n\t\t%cursor%\n\t\tbreak;\n\tdefault:\n\t\t%cursor%\n%brace_close%
try=try%block%\ncatch (%cursor%)%block_cursor%
cout=std::cout<< "%cursor%" << '\\n';
endl=std::endl;\n%cursor%
end=std::endl;\n%cursor%
fast=ios_base::sync_with_stdio(false);\ncin.tie(NULL);
[Java]
if=if (%cursor%)%block_cursor%
else=else%block_cursor%
for=for (int i = 0; i < %cursor%; i++)%brace_open%\n%brace_close%
while=while (%cursor%)%block_cursor%
do=do\n{\n\t%cursor%\n} while (%cursor%)\n
switch=switch (%cursor%)%brace_open%case %cursor%:\n\t\t%cursor%\n\t\tbreak;\n\tdefault:\n\t\t%cursor%\n%brace_close%
try=try%block%\ncatch (%cursor%)%block_cursor%
[PHP]
if=if (%cursor%)%block_cursor%
else=else%block_cursor%
for=for ($i = 0; $i < %cursor%; $i++)%brace_open%\n%brace_close%
while=while (%cursor%)%block_cursor%
do=do\n{\n\t%cursor%\n} while (%cursor%)\n
switch=switch (%cursor%)%brace_open%case %cursor%:\n\t\t%cursor%\n\t\tbreak;\n\tdefault:\n\t\t%cursor%\n%brace_close%
try=try%block%\ncatch (%cursor%)%block_cursor%
[Javascript]
if=if (%cursor%)%block_cursor%
else=else%block_cursor%
for=for (i = 0; i < %cursor%; i++)%block_cursor%
while=while (%cursor%)%block_cursor%
do=do\n{\n\t%cursor%\n} while (%cursor%)\n
switch=switch (%cursor%)%brace_open%case %cursor%:\n\t\t%cursor%\n\t\tbreak;\n\tdefault:\n\t\t%cursor%\n%brace_close%
try=try%block%\ncatch (%cursor%)%block_cursor%
[C#]
if=if (%cursor%)%block_cursor%
else=else%block_cursor%
for=for (i = 0; i < %cursor%; i++)%block_cursor%
while=while (%cursor%)%block_cursor%
do=do\n{\n\t%cursor%\n} while (%cursor%)\n
switch=switch (%cursor%)%brace_open%case %cursor%:\n\t\t%cursor%\n\t\tbreak;\n\tdefault:\n\t\t%cursor%\n%brace_close%
try=try%block%\ncatch (%cursor%)%block_cursor%
[Vala]
if=if (%cursor%)%block_cursor%
else=else%block_cursor%
for=for (i = 0; i < %cursor%; i++)%block_cursor%
while=while (%cursor%)%block_cursor%
do=do\n{\n\t%cursor%\n} while (%cursor%)\n
switch=switch (%cursor%)%brace_open%case %cursor%:\n\t\t%cursor%\n\t\tbreak;\n\tdefault:\n\t\t%cursor%\n%brace_close%
try=try%block%\ncatch (%cursor%)%block_cursor%
[ActionScript]
if=if (%cursor%)%block_cursor%
else=else%block_cursor%
for=for (i = 0; i < %cursor%; i++)%block_cursor%
while=while (%cursor%)%block_cursor%
do=do\n{\n\t%cursor%\n} while (%cursor%)\n
switch=switch (%cursor%)%brace_open%case %cursor%:\n\t\t%cursor%\n\t\tbreak;\n\tdefault:\n\t\t%cursor%\n%brace_close%
try=try%block%\ncatch (%cursor%)%block_cursor%
[Python]
for=for i in xrange(%cursor%):\n\t
if=if %cursor%:\n\t
elif=elif %cursor%:\n\t
else=else:\n\t
while=while %cursor%:\n\t
try=try:\n\t%cursor%\nexcept Exception, ex:\n\t
with=with %cursor%:\n\t
def=def %cursor% (%cursor%):\n\t""" Function doc """\n\t
class=class %cursor%:\n\t""" Class doc """\n\t\n\tdef __init__ (self):\n\t\t""" Class initialiser """\n\t\tpass
[Ferite]
iferr=iferr%block_cursor%fix%block%
monitor=monitor%block_cursor%handle%block%
[Haskell]
[HTML]
table=<table>\n\t<tr>\n\t\t<td>%cursor%</td>\n\t</tr>\n</table>
[Erlang]
case=case %cursor% of\n\t%cursor% -> %cursor%\nend
if=if\n\t%cursor% -> %cursor%\nend
begin=begin\n\t%cursor%\nend
fun=fun(%cursor%) ->\n\t%cursor%\nend
try=try %cursor% of\n\t%cursor% ->\n\t%cursor%\ncatch\n\t%cursor% ->\n\t%cursor%\nend
module=-module(%cursor%).
export=-export(%cursor%).
compile=-compile(%cursor%).
include=-include(%cursor%).
[CUDA]
cudaMalloc=cudaMalloc(&%cursor%, sizeof(%cursor%)*(%cursor%));
cudamalloc=cudaMalloc(&%cursor%, sizeof(%cursor%)*(%cursor%));
htod=cudaMemcpy(%cursor% , , sizeof()* N, cudaMemcpyHostToDevice);
dtoh=cudaMemcpy(%cursor% , , sizeof()* N, cudaMemcpyDeviceToHost);
h2d=cudaMemcpy(%cursor% , , sizeof()* N, cudaMemcpyHostToDevice);
d2h=cudaMemcpy(%cursor% , , sizeof()* N, cudaMemcpyDeviceToHost);
[Keybindings]
#! link=<Ctrl>+<Shift>7
#! link=<Ctrl>l #NOT working clashing with global keybindings
link=<Ctrl>7
#! cod=<Ctrl>1