forked from OpenCode/geany-openerp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
snippets.conf
131 lines (112 loc) · 7.08 KB
/
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
# 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]
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%cursor%
switch=switch (%cursor%)%brace_open%case %cursor%:\n\t\t%cursor%\n\t\tbreak;\n\tdefault:\n\t\t%cursor%\n%brace_close%%cursor%
try=try%block%\ncatch (%cursor%)%block_cursor%
# 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}\n%cursor%
#wordchars=_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789
# Optional keybindings to insert snippets
# Note: these can be overridden by Geany's configurable keybindings
[Keybindings]
#for=<Ctrl>7
[C++]
for=for (int i = 0; i < %cursor%; i++)%brace_open%\n%brace_close%
[Java]
for=for (int i = 0; i < %cursor%; i++)%brace_open%\n%brace_close%
[PHP]
for=for ($i = 0; $i < %cursor%; $i++)%brace_open%\n%brace_close%
[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
# =====================================================================
# START OPENERP PYTHON SNIPPETS LIST
class=class %cursor%(osv.osv):\n\n\t_name = ""\n\t_description = ""\n
cols=_columns = {\n\t%cursor%\n\t}
defs=_defaults = {\n\t%cursor%\n\t}
char=fields.char('%cursor%', size=64),
integ=fields.integer('%cursor%'),
bool=fields.boolean('%cursor%'),
float=fields.float('%cursor%'),
text=fields.text('%cursor%'),
date=fields.date('%cursor%'),
datetime=fields.datetime('%cursor%'),
fnct=fields.function(%cursor%, type='', arg=None, fnct_inv=None, fnct_inv_arg=None, fnct_search=None, obj=None, method=True, store=False, multi=False),
def_fnct=def %cursor%(self, cr, uid, ids, name, arg, context=None):
selec=fields.selection(\n\t(('%cursor%', ''),('', '')),\n\t''),
o2m=fields.one2many('%cursor%','',''),
m2o=fields.many2one('%cursor%',''),
super=super(class_name%cursor%,self).function(cr, uid, ids, context)
raise=raise osv.except_osv(_('%cursor%'), _(''))
pdb=import pdb; pdb.set_trace()
create=%cursor%create(cr, uid, vals, context=None)
write=%cursor%write(cr, uid, ids, vals, context=None)
unlink=%cursor%unlink(cr, uid, ids, context=None)
browse=%cursor%browse(cr, uid, ids, context=None)
search=search(cr, uid, [('%cursor%')], context=None)
openerp_py={\n\t'name': '',\n\t'version': '',\n\t'category': '',\n\t'description': """""",\n\t'author': '',\n\t'website': '',\n\t'license': 'AGPL-3',\n\t"depends" : [],\n\t"init_xml" : [],\n\t"update_xml" : [],\n\t"demo_xml" : [],\n\t"active": False,\n\t"installable": True\n}
# END OPENERP PYTHON SNIPPETS LIST
# =====================================================================
# =====================================================================
# START OPENERP XML SNIPPETS LIST
[XML]
tree=<record id="%cursor%" model="ir.ui.view">\n\t<field name="name"></field>\n\t<field name="model"></field>\n\t<field name="type">tree</field>\n\t<field name="arch" type="xml">\n\t\t<tree string="">\n\t\t\t<field name="name"/>\n\t\t</tree>\n\t</field>\n</record>
tree_in=<record id="" model="ir.ui.view">\n\t<field name="name"></field>\n\t<field name="model"></field>\n\t<field name="inherit_id" ref=""/>\n\t<field name="arch" type="xml">\n\t\t<field name="name" />\n\t</field>\n</record>
form=<record id="%cursor%" model="ir.ui.view">\n\t<field name="name"></field>\n\t<field name="model"></field>\n\t<field name="type">form</field>\n\t<field name="arch" type="xml">\n\t\t<form string="">\n\t\t\t<field name="name"/>\n\t\t</form>\n\t</field>\n</record>
form_in=<record id="" model="ir.ui.view">\n\t<field name="name"></field>\n\t<field name="model"></field>\n\t<field name="inherit_id" ref=""/>\n\t<field name="arch" type="xml">\n\t\t<field name="name" />\n\t</field>\n</record>
menu=<menuitem\n\tid="%cursor%"\n\tname=""\n\tstring=""\n\taction=""\n\tparent=""/>
search=<record id="%cursor%" model="ir.ui.view">\n\t<field name="name"></field>\n\t<field name="model"></field>\n\t<field name="type">search</field>\n\t<field name="arch" type="xml">\n\t\t<search string="">\n\t\t\t<field name="name"/>\n\t\t</search>\n\t</field>\n</record>
search_in=<record id="%cursor%" model="ir.ui.view">\n\t<field name="name"></field>\n\t<field name="model"></field>\n\t<field name="inherit_id" ref=""/>\n\t<field name="arch" type="xml">\n\t\t<field name="name" >\n\t</field>\n</record>
action=<record id="%cursor%" model="ir.actions.act_window">\n\t<field name="name"></field>\n\t<field name="type">ir.actions.act_window</field>\n\t<field name="res_model"></field>\n\t<field name="view_type">form</field>\n\t<field name="view_mode">tree,form</field>\n\t<field name="view_id" ref=""/>\n\t<field name="help"></field>\n</record>
button=<button name="%cursor%" states="" string="" type="object" icon=""/>
button_action=<button name="%(%cursor%)d" states="" string="" type="action" icon=""/>
notebook=<notebook>\n\t<page string="%cursor%">\n\t</page>\n</notebook>
filter=<filter domain="[('%cursor%', '', '')]" icon="" string="" help=""/>
context=<field name="context">{'%cursor%':}</field>
domain=<field name="domain">[('%cursor%','','')]</field>
# END OPENERP XML SNIPPETS LIST
# =====================================================================
[Ferite]
iferr=iferr%block_cursor%fix%block%
monitor=monitor%block_cursor%handle%block%
[Haskell]
# prevent completion of "do"-while-loops in Haskell
do=
[HTML]
table=<table>\n\t<tr>\n\t\t<td>%cursor%</td>\n\t</tr>\n</table>