plugins: plugin loader redesign
[geany-mirror.git] / data / snippets.conf
blob40a037b5514cee567837111a31a102e36fb021ae
1 # Geany's snippets configuration file
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.
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.
17 # For a list of available filetype names, execute:
18 # geany --ft-names
20 # Default is used for all filetypes and keys can be overwritten by [filetype] sections
21 [Default]
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
35 # Optional keybindings to insert snippets
36 # Note: these can be overridden by Geany's configurable keybindings
37 [Keybindings]
38 #for=<Ctrl>7
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%
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%
57 [Java]
58 if=if (%cursor%)%block_cursor%
59 else=else%block_cursor%
60 for=for (int i = 0; i < %cursor%; i++)%brace_open%\n%brace_close%
61 while=while (%cursor%)%block_cursor%
62 do=do\n{\n\t%cursor%\n} while (%cursor%)\n%cursor%
63 switch=switch (%cursor%)%brace_open%case %cursor%:\n\t\t%cursor%\n\t\tbreak;\n\tdefault:\n\t\t%cursor%\n%brace_close%%cursor%
64 try=try%block%\ncatch (%cursor%)%block_cursor%
66 [PHP]
67 if=if (%cursor%)%block_cursor%
68 else=else%block_cursor%
69 for=for ($i = 0; $i < %cursor%; $i++)%brace_open%\n%brace_close%
70 while=while (%cursor%)%block_cursor%
71 do=do\n{\n\t%cursor%\n} while (%cursor%)\n%cursor%
72 switch=switch (%cursor%)%brace_open%case %cursor%:\n\t\t%cursor%\n\t\tbreak;\n\tdefault:\n\t\t%cursor%\n%brace_close%%cursor%
73 try=try%block%\ncatch (%cursor%)%block_cursor%
75 [Javascript]
76 if=if (%cursor%)%block_cursor%
77 else=else%block_cursor%
78 for=for (i = 0; i < %cursor%; i++)%block_cursor%
79 while=while (%cursor%)%block_cursor%
80 do=do\n{\n\t%cursor%\n} while (%cursor%)\n%cursor%
81 switch=switch (%cursor%)%brace_open%case %cursor%:\n\t\t%cursor%\n\t\tbreak;\n\tdefault:\n\t\t%cursor%\n%brace_close%%cursor%
82 try=try%block%\ncatch (%cursor%)%block_cursor%
84 [C#]
85 if=if (%cursor%)%block_cursor%
86 else=else%block_cursor%
87 for=for (i = 0; i < %cursor%; i++)%block_cursor%
88 while=while (%cursor%)%block_cursor%
89 do=do\n{\n\t%cursor%\n} while (%cursor%)\n%cursor%
90 switch=switch (%cursor%)%brace_open%case %cursor%:\n\t\t%cursor%\n\t\tbreak;\n\tdefault:\n\t\t%cursor%\n%brace_close%%cursor%
91 try=try%block%\ncatch (%cursor%)%block_cursor%
93 [Vala]
94 if=if (%cursor%)%block_cursor%
95 else=else%block_cursor%
96 for=for (i = 0; i < %cursor%; i++)%block_cursor%
97 while=while (%cursor%)%block_cursor%
98 do=do\n{\n\t%cursor%\n} while (%cursor%)\n%cursor%
99 switch=switch (%cursor%)%brace_open%case %cursor%:\n\t\t%cursor%\n\t\tbreak;\n\tdefault:\n\t\t%cursor%\n%brace_close%%cursor%
100 try=try%block%\ncatch (%cursor%)%block_cursor%
102 [ActionScript]
103 if=if (%cursor%)%block_cursor%
104 else=else%block_cursor%
105 for=for (i = 0; i < %cursor%; i++)%block_cursor%
106 while=while (%cursor%)%block_cursor%
107 do=do\n{\n\t%cursor%\n} while (%cursor%)\n%cursor%
108 switch=switch (%cursor%)%brace_open%case %cursor%:\n\t\t%cursor%\n\t\tbreak;\n\tdefault:\n\t\t%cursor%\n%brace_close%%cursor%
109 try=try%block%\ncatch (%cursor%)%block_cursor%
111 [Python]
112 for=for i in xrange(%cursor%):\n\t
113 if=if %cursor%:\n\t
114 elif=elif %cursor%:\n\t
115 else=else:\n\t
116 while=while %cursor%:\n\t
117 try=try:\n\t%cursor%\nexcept Exception, ex:\n\t
118 with=with %cursor%:\n\t
119 def=def %cursor% (%cursor%):\n\t""" Function doc """\n\t
120 class=class %cursor%:\n\t""" Class doc """\n\t\n\tdef __init__ (self):\n\t\t""" Class initialiser """\n\t\tpass
122 [Ferite]
123 iferr=iferr%block_cursor%fix%block%
124 monitor=monitor%block_cursor%handle%block%
126 [Haskell]
128 [HTML]
129 table=<table>\n\t<tr>\n\t\t<td>%cursor%</td>\n\t</tr>\n</table>
131 [Erlang]
132 case=case %cursor% of\n\t%cursor% -> %cursor%\nend
133 if=if\n\t%cursor% -> %cursor%\nend
134 begin=begin\n\t%cursor%\nend
135 fun=fun(%cursor%) ->\n\t%cursor%\nend
136 try=try %cursor% of\n\t%cursor% ->\n\t%cursor%\ncatch\n\t%cursor% ->\n\t%cursor%\nend
137 module=-module(%cursor%).
138 export=-export(%cursor%).
139 compile=-compile(%cursor%).
140 include=-include(%cursor%).