Skip to content

Instantly share code, notes, and snippets.

@blfpd
Last active August 29, 2015 13:56
Show Gist options
  • Save blfpd/9269795 to your computer and use it in GitHub Desktop.
Save blfpd/9269795 to your computer and use it in GitHub Desktop.
Snippet.conf for Django and webdeveloppement
# 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]
ç=``%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
[Conf]
aout=\n[2013/08/%cursor%]\n%cursor%\n
sep=\n[2013/09/%cursor%]\n%cursor%\n
oct=\n[2013/10/%cursor%]\n%cursor%\n
nov=\n[2013/11/%cursor%]\n%cursor%\n
dec=\n[2013/12/%cursor%]\n%cursor%\n
[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%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%
[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%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%
[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%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%
[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%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%
[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%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%
log=console.log(%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%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%
[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%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%
[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%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%
[Python]
s=self
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
doc="""%cursor%."""
def=def %cursor%(self%cursor%):\n\t"""%cursor%"""\n\t
class=class %cursor%:\n\t"""%cursor%"""\n\t\n\tdef __init__ (self):\n\t\t""" Class initialiser """\n\t\tpass
_=_("%cursor%")
model=class %cursor%(models.Model):\n\t\n\tdef __unicode__(self):\n\t\treturn name\n
arg=*args
kw=**kwargs
args=*args, **kwargs
pdb=import pdb; pdb.set_trace()
# Django Model Fields
char=models.CharField(_("%cursor%"), max_length=255)
text=models.TextField(_("%cursor%"))
date=models.DateField(_("%cursor%"))
datetime=models.DateTimeField(_("%cursor%"))
bool=models.BooleanField(
choice=models.CharField(_("%cursor%"), max_length=, choices=_CHOICES)
email=models.EmailField(_("%cursor%"), max_length=254)
url=models.URLField(
fk=models.ForeignKey(
bl=blank=True
nu=null=True
# Selenium
br=browser.
name=find_element_by_name('
names=find_elements_by_name('
id=find_element_by_id('
tag=find_element_by_tag_name('
tags=find_elements_by_tag_name('
link=find_element_by_link_text('
links=find_element_by_links_text('
css=find_element_by_css_selector('
aeq=assertEquals(
ain=assertIn(
[HTML]
html5=<!DOCTYPE html>\n<html lang="en">\n<head>\n\t<meta charset="utf-8" />\n\t<title>%cursor%</title>\n</head>\n<body>\n\t%cursor%\n</body>\n</html>
html=<html lang="%cursor%">\n\t%cursor%\n</html>
head=<head>\n\t%cursor%\n</head>
js=<script type="text/javascript">\n\t%cursor%\n</script>
js2=<script src="%cursor%" type="text/javascript"></script>
css=<style type="text/css">\n\t%cursor%\n</style>
css2=<link href="%cursor%" rel="stylesheet" type="text/css" />
rss=<link rel="alternate" type="application/rss+xml" title="%cursor%" href="%cursor%" />
title=<title>%cursor%</title>
utf=<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
ie7=<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
refresh=<meta http-equiv="refresh" content="2;url=%cursor%" />
body=<body>\n\t%cursor%\n</body>
# table
table=<table>\n\t<thead>\n\t\t<tr>\n\t\t\t<th>%cursor%</th>\n\t\t</tr>\n\t</thead>\n\t<tbody>\n\t\t<tr>\n\t\t\t<td>%cursor%</td>\n\t\t</tr>\n\t</tbody>\n</table>
td=<td>%cursor%</td>
tr=<tr>%cursor%</tr>
th=<th>%cursor%</th>
caption=<caption>%cursor%</caption>
# form
form=<form action="%cursor%" method="post">\n\n\t<input type="submit" value="%cursor%" />\n</form>
formp=<form action="%cursor%" method="post">\n\n\t<p>{{ form.as_p }}</p>\n<p><input type="submit" value="%cursor%" /></p>\n</form>
label=<label for="%cursor%"></label>
input=<input type="text" name="%cursor%" value="%cursor%" id="%cursor%" />
pass=<input type="password" name="%cursor%" id="%cursor%" />
textarea=<textarea name="%cursor%" cols="50" rows="10" id="%cursor%" ></textarea>
select=<select name="%cursor%" id="%cursor%">\n\t<option value="%cursor%"></option>\n</select>
radio=<input type="radio" name="%cursor%" value="%cursor%" />
checkbox=<input type="checkbox" name="%cursor%" value="%cursor%" />
button=<button type="%cursor%">%cursor%</button>
fieldset=<fieldset>\n\t<legend>%cursor%</legend>\n</fieldset>
# list
ul=<ul class="%cursor%">\n\t<li>%cursor%</li>\n</ul>
ol=<ol class="%cursor%">\n\t<li>%cursor%</li>\n</ol>
li=<li>%cursor%</li>
dl=<dl class="%cursor%">\n\t<dt>%cursor%</dt>\n\t<dd>%cursor%</dd>\n</dl>
dt=<dt>%cursor%</dt>
dd=<dd>%cursor%</dd>
# inline
a=<a href="%cursor%">%cursor%</a>
span=<span>%cursor%</span>
em=<em>%cursor%</em>
small=<small>%cursor%</small>
big=<big>%cursor%</big>
cite=<cite>%cursor%</cite>
strong=<strong>%cursor%</strong>
img=<img src="%cursor%" alt="%cursor%" title="%cursor%" />
thumb=<a href="%cursor%"><img src="%cursor%" alt="%cursor%" title="%cursor%" /></a>
# block
div=<div>%cursor%</div>
divi=<div id="%cursor%">%cursor%</div>
divcl=<div class="%cursor%">%cursor%</div>
h1=<h1>%cursor%</h1>
h2=<h2>%cursor%</h2>
h3=<h3>%cursor%</h3>
h4=<h4>%cursor%</h4>
h5=<h5>%cursor%</h5>
h6=<h6>%cursor%</h6>
p=<p>%cursor%</p>
pre=<pre>\n%cursor%\n</pre>
code=<code>%cursor%</code>
prec=<pre><code>%cursor%</code></pre>
quote=<blockquote>\n\t<p>\n\t\t%cursor%\n\t</p>\n</blockquote>
# other
cl=class="%cursor%"
id=id="%cursor%"
cmt=<!-- %cursor% -->
cmmt=<!--\n\t%cursor%\n-->
br=<br />
hr=<hr />
1s=&nbsp;
3s=&nbsp;&nbsp;&nbsp;
7s=&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
dummyimage=<img src="http://dummyimage.com/%cursor%x%cursor%/000/fff.png" alt="" title="" />
dummyimage2=<img src="http://lorempixel.com/%cursor%/%cursor%/" alt="" title="" />
# Django templates
if={% if %cursor% %}\n{% endif %}
for={% for %cursor% in %cursor% %}\n\t%cursor%\n{% endfor %}
dv={{ %cursor% }}
db={% %cursor% %}
dc={# %cursor% #}
dbl={% block %cursor% %}\n\t%cursor%\n{% endblock %}
end={% endblock %}
trans={% trans "%cursor%" %}
btrans={% blocktrans with %cursor%= %}%cursor%{% endblocktrans %}
comment={% comment %}%cursor%{% endcomment %}
token={% csrf_token %}
# jQuery
jquery=<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.5/jquery.min.js"></script>
jqueryui=<script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js"></script>
jready=$(document).ready(function(){\n\t%cursor%\n});
jfunc=$(function(){\n\t%cursor%\n});
log=console.log('%cursor%');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment