|
| 1 | +# Geany's snippets configuration file |
| 2 | +# |
| 3 | +# use \n or %newline% for a new line (it will be replaced by the used EOL char(s) - LF, CR/LF, CR). |
| 4 | +# use \t or %ws% for an indentation step, it will be replaced according to the current document's indent mode. |
| 5 | +# use \s to force whitespace at beginning or end of a value ('key= value' won't work, use 'key=\svalue'). |
| 6 | +# use %key% for all keys defined in the [Special] section. |
| 7 | +# use %cursor% to define where the cursor should be placed after completion. You can define multiple |
| 8 | +# %cursor% wildcards and use the "Move cursor in snippet" to jump to the next defined cursor |
| 9 | +# position in the completed snippet. |
| 10 | +# You can define a section for each supported filetype to overwrite default settings, the section |
| 11 | +# name must match exactly the internal filetype name, run 'geany --ft-names' for a full list. |
| 12 | +# |
| 13 | +# Additionally, you can use most of the template wildcards like {developer}, {command:...}, |
| 14 | +# or {date} in the snippets. |
| 15 | +# See the documentation for details. |
| 16 | + |
| 17 | +# For a list of available filetype names, execute: |
| 18 | +# geany --ft-names |
| 19 | + |
| 20 | +# Default is used for all filetypes and keys can be overwritten by [filetype] sections |
| 21 | +[Default] |
| 22 | + |
| 23 | +# special keys to be used in other snippets, cannot be used "standalone" |
| 24 | +# can be used by %key%, e.g. %brace_open% |
| 25 | +# nesting of special keys is not supported (e.g. brace_open=\n{\n%brace_close% won't work) |
| 26 | +# key "wordchars" is very special, it defines the word delimiting characters when looking for |
| 27 | +# a word to auto complete, leave commented to use the default wordchars |
| 28 | +[Special] |
| 29 | +brace_open=\n{\n\t |
| 30 | +brace_close=}\n |
| 31 | +block=\n{\n\t%cursor%\n} |
| 32 | +block_cursor=\n{\n\t%cursor%\n}\n%cursor% |
| 33 | +#wordchars=_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789 |
| 34 | + |
| 35 | +# Optional keybindings to insert snippets |
| 36 | +# Note: these can be overridden by Geany's configurable keybindings |
| 37 | +[Keybindings] |
| 38 | +#for=<Ctrl>7 |
| 39 | + |
| 40 | +[C] |
| 41 | +if=if (%cursor%)%block_cursor% |
| 42 | +else=else%block_cursor% |
| 43 | +for=for (i = 0; i < %cursor%; i++)%block_cursor% |
| 44 | +while=while (%cursor%)%block_cursor% |
| 45 | +do=do\n{\n\t%cursor%\n} while (%cursor%)\n%cursor% |
| 46 | +switch=switch (%cursor%)%brace_open%case %cursor%:\n\t\t%cursor%\n\t\tbreak;\n\tdefault:\n\t\t%cursor%\n%brace_close%%cursor% |
| 47 | + |
| 48 | +[C++] |
| 49 | +if=if (%cursor%)%block_cursor% |
| 50 | +else=else%block_cursor% |
| 51 | +for=for (int i = 0; i < %cursor%; i++)%brace_open%\n%brace_close% |
| 52 | +while=while (%cursor%)%block_cursor% |
| 53 | +do=do\n{\n\t%cursor%\n} while (%cursor%)\n%cursor% |
| 54 | +switch=switch (%cursor%)%brace_open%case %cursor%:\n\t\t%cursor%\n\t\tbreak;\n\tdefault:\n\t\t%cursor%\n%brace_close%%cursor% |
| 55 | +try=try%block%\ncatch (%cursor%)%block_cursor% |
| 56 | +template=//abhiy13\n#include <bits/stdc++.h>\n\tusing namespace std;\n\nint main(){\n\tios::sync_with_stdio(false);\n\tint T;\n\tcin >> T;\n\twhile(T--){\n\n\t}\n\treturn 0;\n} |
| 57 | +debug=string to_string(string s) {\n\treturn '"' + s + '"';\n}\nstring to_string(const char* s) {\n\treturn to_string((string) s);\n}\nstring to_string(bool b) {\n\treturn (b ? "true" : "false");\n}\ntemplate <typename A, typename B>\nstring to_string(pair<A, B> p) {\nreturn "(" + to_string(p.first) + ", " + to_string(p.second) + ")";\n}\ntemplate <typename A>\nstring to_string(A v) {\n\tbool first = true;\n\tstring res = "{";\n\tfor (const auto &x : v) {\n\t\tif (!first) {\n\t\t\tres += ", ";\n\t\t}\n\t\tfirst = false;\n\t\tres += to_string(x);\n\t}\n\tres += "}";\n\treturn res;\n}\nvoid print() { cerr << endl; }\ntemplate <typename Head, typename... Tail>\nvoid print(Head H, Tail... T) {\n\tcerr << " " << to_string(H);\n\tprint(T...);\n}\n#ifdef ABHI\n#define debug(...) cerr << "[" << #__VA_ARGS__ << "]:", print(__VA_ARGS__)\n#else\n#define debug(...) 42\n#endif\n |
| 58 | + |
| 59 | +[Java] |
| 60 | +if=if (%cursor%)%block_cursor% |
| 61 | +else=else%block_cursor% |
| 62 | +for=for (int i = 0; i < %cursor%; i++)%brace_open%\n%brace_close% |
| 63 | +while=while (%cursor%)%block_cursor% |
| 64 | +do=do\n{\n\t%cursor%\n} while (%cursor%)\n%cursor% |
| 65 | +switch=switch (%cursor%)%brace_open%case %cursor%:\n\t\t%cursor%\n\t\tbreak;\n\tdefault:\n\t\t%cursor%\n%brace_close%%cursor% |
| 66 | +try=try%block%\ncatch (%cursor%)%block_cursor% |
| 67 | + |
| 68 | +[PHP] |
| 69 | +if=if (%cursor%)%block_cursor% |
| 70 | +else=else%block_cursor% |
| 71 | +for=for ($i = 0; $i < %cursor%; $i++)%brace_open%\n%brace_close% |
| 72 | +while=while (%cursor%)%block_cursor% |
| 73 | +do=do\n{\n\t%cursor%\n} while (%cursor%)\n%cursor% |
| 74 | +switch=switch (%cursor%)%brace_open%case %cursor%:\n\t\t%cursor%\n\t\tbreak;\n\tdefault:\n\t\t%cursor%\n%brace_close%%cursor% |
| 75 | +try=try%block%\ncatch (%cursor%)%block_cursor% |
| 76 | + |
| 77 | +[Javascript] |
| 78 | +if=if (%cursor%)%block_cursor% |
| 79 | +else=else%block_cursor% |
| 80 | +for=for (i = 0; i < %cursor%; i++)%block_cursor% |
| 81 | +while=while (%cursor%)%block_cursor% |
| 82 | +do=do\n{\n\t%cursor%\n} while (%cursor%)\n%cursor% |
| 83 | +switch=switch (%cursor%)%brace_open%case %cursor%:\n\t\t%cursor%\n\t\tbreak;\n\tdefault:\n\t\t%cursor%\n%brace_close%%cursor% |
| 84 | +try=try%block%\ncatch (%cursor%)%block_cursor% |
| 85 | + |
| 86 | +[C#] |
| 87 | +if=if (%cursor%)%block_cursor% |
| 88 | +else=else%block_cursor% |
| 89 | +for=for (i = 0; i < %cursor%; i++)%block_cursor% |
| 90 | +while=while (%cursor%)%block_cursor% |
| 91 | +do=do\n{\n\t%cursor%\n} while (%cursor%)\n%cursor% |
| 92 | +switch=switch (%cursor%)%brace_open%case %cursor%:\n\t\t%cursor%\n\t\tbreak;\n\tdefault:\n\t\t%cursor%\n%brace_close%%cursor% |
| 93 | +try=try%block%\ncatch (%cursor%)%block_cursor% |
| 94 | + |
| 95 | +[Vala] |
| 96 | +if=if (%cursor%)%block_cursor% |
| 97 | +else=else%block_cursor% |
| 98 | +for=for (i = 0; i < %cursor%; i++)%block_cursor% |
| 99 | +while=while (%cursor%)%block_cursor% |
| 100 | +do=do\n{\n\t%cursor%\n} while (%cursor%)\n%cursor% |
| 101 | +switch=switch (%cursor%)%brace_open%case %cursor%:\n\t\t%cursor%\n\t\tbreak;\n\tdefault:\n\t\t%cursor%\n%brace_close%%cursor% |
| 102 | +try=try%block%\ncatch (%cursor%)%block_cursor% |
| 103 | + |
| 104 | +[ActionScript] |
| 105 | +if=if (%cursor%)%block_cursor% |
| 106 | +else=else%block_cursor% |
| 107 | +for=for (i = 0; i < %cursor%; i++)%block_cursor% |
| 108 | +while=while (%cursor%)%block_cursor% |
| 109 | +do=do\n{\n\t%cursor%\n} while (%cursor%)\n%cursor% |
| 110 | +switch=switch (%cursor%)%brace_open%case %cursor%:\n\t\t%cursor%\n\t\tbreak;\n\tdefault:\n\t\t%cursor%\n%brace_close%%cursor% |
| 111 | +try=try%block%\ncatch (%cursor%)%block_cursor% |
| 112 | + |
| 113 | +[Python] |
| 114 | +for=for i in xrange(%cursor%):\n\t |
| 115 | +if=if %cursor%:\n\t |
| 116 | +elif=elif %cursor%:\n\t |
| 117 | +else=else:\n\t |
| 118 | +while=while %cursor%:\n\t |
| 119 | +try=try:\n\t%cursor%\nexcept Exception, ex:\n\t |
| 120 | +with=with %cursor%:\n\t |
| 121 | +def=def %cursor% (%cursor%):\n\t""" Function doc """\n\t |
| 122 | +class=class %cursor%:\n\t""" Class doc """\n\t\n\tdef __init__ (self):\n\t\t""" Class initialiser """\n\t\tpass |
| 123 | + |
| 124 | +[Ferite] |
| 125 | +iferr=iferr%block_cursor%fix%block% |
| 126 | +monitor=monitor%block_cursor%handle%block% |
| 127 | + |
| 128 | +[Haskell] |
| 129 | + |
| 130 | +[HTML] |
| 131 | +table=<table>\n\t<tr>\n\t\t<td>%cursor%</td>\n\t</tr>\n</table> |
| 132 | + |
| 133 | +[Erlang] |
| 134 | +case=case %cursor% of\n\t%cursor% -> %cursor%\nend |
| 135 | +if=if\n\t%cursor% -> %cursor%\nend |
| 136 | +begin=begin\n\t%cursor%\nend |
| 137 | +fun=fun(%cursor%) ->\n\t%cursor%\nend |
| 138 | +try=try %cursor% of\n\t%cursor% ->\n\t%cursor%\ncatch\n\t%cursor% ->\n\t%cursor%\nend |
| 139 | +module=-module(%cursor%). |
| 140 | +export=-export(%cursor%). |
| 141 | +compile=-compile(%cursor%). |
| 142 | +include=-include(%cursor%). |
0 commit comments