Advertisement
adnan360

Geany Snippets Config

Sep 7th, 2016
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
INI file 11.66 KB | None | 0 0
  1. # ~/.config/geany/snippets.conf
  2. # Also available from Geany->Tools->Configuration Files->Snippets
  3.  
  4. # Geany's snippets configuration file
  5. # use \n or %newline% for a new line (it will be replaced by the used EOL char(s) - LF, CR/LF, CR)
  6. # use \t ot %ws% for an indentation step, if using only spaces for indentation only spaces will be used
  7. # use \s to force whitespace at beginning or end of a value ('key= value' won't work, use 'key=\svalue')
  8. # use %cursor% to define where the cursor should be placed after completion
  9. # use %key% for all keys defined in the [Special] section
  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. # filetype names:
  14. # C, C++, D, Java, Pascal, ASM, Fortran, CAML, Haskell, VHDL, Perl, PHP, Javascript, Python, Ruby,
  15. # Tcl, Lua, Ferite, Sh, Make, O-Matrix, XML, Docbook, HTML, CSS, SQL, LaTeX, Diff, Conf, None
  16.  
  17. # Default is used for all filetypes and keys can be overwritten by [filetype] sections
  18. [Default]
  19. if=if (%cursor%)%brace_open%\n%brace_close%
  20. else=else%brace_open%%cursor%\n%brace_close%
  21. for=for (i = 0; i < %cursor%; i++)%brace_open%\n%brace_close%
  22. while=while (%cursor%)%brace_open%\n%brace_close%
  23. do=do%brace_open%%cursor%\n%brace_close% while ()
  24. switch=switch (%cursor%)%brace_open%case : break;\n%ws%default: \n%brace_close%
  25. try=try%block_cursor%catch ()%block%
  26. lorem=Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.%cursor%
  27.  
  28. [Special]
  29. brace_open=\n{\n\t
  30. brace_close=}\n
  31. block=\n{\n\t\n}\n
  32. block_cursor=\n{\n\t%cursor%\n}\n
  33. wordchars=._abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789
  34.  
  35. [C++]
  36. for=for (int i = 0; i < %cursor%; i++)%brace_open%\n%brace_close%
  37.  
  38. [Java]
  39. for=for (int i = 0; i < %cursor%; i++)%brace_open%\n%brace_close%
  40.  
  41. [Javascript]
  42. jready=$(document).ready(function(){\n\t%cursor%\n});
  43. jfunc=$(function() {\n\t%cursor%\n});
  44. log=console.log('%cursor%');
  45. alert=alert('%cursor%');
  46.  
  47. [PHP]
  48. # Little php snippets written by Atanas Beloborodov <nasko@cod3r.org>
  49. # Some php5 object`s usefull snippets
  50. php=<?php\n%cursor%\n?>
  51. class=class\n{\n\tpublic function __construct()\n\t{\n\t\t%cursor%\n\t}\n\n\tpublic function __destruct()\n\t{\n\t\t%cursor%\n\t}\n}
  52. interface=interface %cursor% %block%
  53. static=public static function %cursor%() %block%
  54. public=public function %cursor%()%block%
  55. protected=protected function %cursor%()%block%
  56. private=private function %cursor%()%block%
  57. #Control structures :
  58. for=for ($i = 0; $i < %cursor%; $i++ %block%
  59. while=while (%cursor%) %block%
  60. if=if (%cursor%) %block%
  61. switch=switch (%cursor%) {\n\tcase '';\n\n\tbreak;\n\n\tdefault :\n\n\tbreak;\n}\n
  62. else=if (%cursor%) %block%else %block%
  63. elseif=if (%cursor%) {\n\t\n}\nelseif () {\n\t\n}\nelse {\n\t\n}\n
  64. do=do %block%while (%cursor%);
  65. foreach=foreach (%cursor%) %block%
  66. # Include methods
  67. # Note : require and include is not functions ! Not required braces ()
  68. req=require "%cursor%";
  69. reqo=require_once "%cursor%";
  70. inc=include "%cursor%";
  71. inco=include_once "%cursor%";
  72. # Others :
  73. function=function %cursor%() %block%
  74. def=define ('%cursor%','');
  75. throw=throw new Exception ('%cursor%');e%
  76.  
  77. [Python]
  78. utf8=#-*- coding: utf-8 -*-
  79. for=for i in xrange(%cursor%):\n\t
  80. doc=""" %cursor% """\n
  81. elif=elif %cursor%:\n\t
  82. else=else:\n\t%cursor%
  83. if=if %cursor%:\n\t
  84. from=from %cursor% import %cursor%\n
  85. main=if __name__ == '__main__':\n\t%cursor%
  86. class=class %cursor%(object):\n\t""" %cursor% """\n\t\n\tdef __init__ (self):\n\t\t""" Class initialiser """\n\t\tpass
  87. def=def %cursor%(self):\n\t""" Function doc\n\n\t@param PARAM: DESCRIPTION\n\t@return RETURN: DESCRIPTION\n\t"""\n\t
  88. get=def get%cursor%(self): return self._var\n
  89. set=def set%cursor%(self): self._var = var\n
  90. .=self.%cursor%
  91. try=try:\n\t%cursor%\nexcept Exception, e:\n\t
  92. py=#!/usr/bin/env python\n#-*- coding:utf-8 -*-\n\n%cursor%
  93. while=while %cursor%:\n\t
  94. with=with %cursor%:\n\t
  95. head="""\n\t%cursor%PROJECT - MODULE\n\n\tDESCRIPTION\n\n\t@copyright: {year} by {developer} <{mail}>\n\t@license: GNU GPL, see COPYING for details.\n"""\n
  96. p=print "%cursor%"
  97. pr=print %cursor%
  98. # Django models
  99. # by Tomasz Karbownicki <tomasz@karbownicki.com>
  100. mclass=class %cursor%(models.Model):\n\t'''%cursor%'''\n\n\tdef __unicode__(self):\n\t\treturn self.XXXXX\n\n\tdef get_absolute_url(self):\n\t\treturn "/XXXXX/%s/" % self.slug\n\n\tclass Meta:\n\t\tverbose_name = "%cursor%"\n\t\tverbose_name_plural = "%cursor%"
  101. mchar=%cursor% = models.CharField(max_length=50, verbose_name=u'%cursor%')
  102. mint=%cursor% = models.IntegerField(verbose_name=u'%cursor%')
  103. mtext=%cursor% = models.TextField(verbose_name=u'%cursor%')
  104. mkey=%cursor% = models.ForeignKey(%cursor%, verbose_name=u'%cursor%')
  105. mimage=%cursor% = models.ImageField(upload_to='', verbose_name=u'%cursor%')
  106. mbool=%cursor% = models.BooleanField(verbose_name=u'%cursor%')
  107. mdate=%cursor% = models.DateField(verbose_name=u'%cursor%', help_text='Format daty: 2009-04-28')
  108. memail=%cursor% = models.EmailField(verbose_name=u'%cursor%')
  109. murl=%cursor% = models.URLField(verbose_name=u'%cursor%')
  110. mslug=%cursor% = models.SlugField(verbose_name=u'%cursor%', unique=True)
  111.  
  112. [Ferite]
  113. iferr=iferr%block_cursor%fix%block%
  114. monitor=monitor%block_cursor%handle%block%
  115.  
  116. [HTML]
  117. # by Tomasz Karbownicki <tomasz@karbownicki.com>
  118. # top
  119. 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>
  120. html=<html lang="%cursor%">\n\t%cursor%\n</html>
  121. head=<head>\n\t%cursor%\n</head>
  122. js=<script type="text/javascript">\n\t%cursor%\n</script>
  123. js2=<script src="%cursor%" type="text/javascript"></script>
  124. alert=alert('%cursor%');
  125. css=<style type="text/css">\n\t%cursor%\n</style>
  126. css2=<link href="%cursor%" rel="stylesheet" type="text/css" />
  127. rss=<link rel="alternate" type="application/rss+xml" title="%cursor%" href="%cursor%" />
  128. title=<title>%cursor%</title>
  129. utf=<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
  130. ie7=<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
  131. refresh=<meta http-equiv="refresh" content="2;url=%cursor%" />
  132. body=<body>\n\t%cursor%\n</body>
  133. # table
  134. 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>
  135. td=<td>%cursor%</td>
  136. tr=<tr>%cursor%</tr>
  137. th=<th>%cursor%</th>
  138. caption=<caption>%cursor%</caption>
  139. # form
  140. form=<form action="%cursor%" method="post">\n\n\t<input type="submit" value="%cursor%" />\n</form>
  141. formp=<form action="%cursor%" method="post">\n\n\t<p>{{ form.as_p }}</p>\n<p><input type="submit" value="%cursor%" /></p>\n</form>
  142. label=<label for="%cursor%"></label>
  143. input=<input type="text" name="%cursor%" value="%cursor%" id="%cursor%" />
  144. pass=<input type="password" name="%cursor%" id="%cursor%" />
  145. textarea=<textarea name="%cursor%" cols="50" rows="10" id="%cursor%" ></textarea>
  146. select=<select name="%cursor%" id="%cursor%">\n\t<option value="%cursor%"></option>\n</select>
  147. radio=<input type="radio" name="%cursor%" value="%cursor%" />
  148. checkbox=<input type="checkbox" name="%cursor%" value="%cursor%" />
  149. button=<button type="%cursor%">%cursor%</button>
  150. fieldset=<fieldset>\n\t<legend>%cursor%</legend>\n</fieldset>
  151. # list
  152. ul=<ul class="%cursor%">\n\t<li>%cursor%</li>\n</ul>
  153. ol=<ol class="%cursor%">\n\t<li>%cursor%</li>\n</ol>
  154. li=<li>%cursor%</li>
  155. dl=<dl class="%cursor%">\n\t<dt>%cursor%</dt>\n\t<dd>%cursor%</dd>\n</dl>
  156. dt=<dt>%cursor%</dt>
  157. dd=<dd>%cursor%</dd>
  158. # inline
  159. a=<a href="%cursor%">%cursor%</a>
  160. i=<i>%cursor%</i>
  161. span=<span>%cursor%</span>
  162. em=<em>%cursor%</em>
  163. small=<small>%cursor%</small>
  164. big=<big>%cursor%</big>
  165. cite=<cite>%cursor%</cite>
  166. strong=<strong>%cursor%</strong>
  167. img=<img src="%cursor%" alt="%cursor%" title="%cursor%" />%cursor%
  168. thumb=<a href="%cursor%"><img src="%cursor%" alt="%cursor%" title="%cursor%" /></a>
  169. # block
  170. div=<div class="%cursor%">%cursor%</div>
  171. h1=<h1>%cursor%</h1>
  172. h2=<h2>%cursor%</h2>
  173. h3=<h3>%cursor%</h3>
  174. h4=<h4>%cursor%</h4>
  175. h5=<h5>%cursor%</h5>
  176. h6=<h6>%cursor%</h6>
  177. p=<p>%cursor%</p>
  178. pre=<pre>\n%cursor%\n</pre>
  179. code=<code>%cursor%</code>
  180. prec=<pre><code>%cursor%</code></pre>
  181. quote=<blockquote>\n\t<p>\n\t\t%cursor%\n\t</p>\n</blockquote>
  182. # other
  183. cl=class="%cursor%"
  184. id=id="%cursor%"
  185. cmt=<!--\n\t%cursor%\n-->
  186. cmt2=<!-- %cursor% -->
  187. br=<br/>
  188. hr=<hr/>
  189. 1s=&nbsp;
  190. 3s=&nbsp;&nbsp;&nbsp;
  191. 7s=&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  192. dummyimage=<img src="http://dummyimage.com/%cursor%x%cursor%/000/fff.png" alt="" title="" />
  193. dummyimage2=<img src="http://lorempixel.com/%cursor%/%cursor%/" alt="" title="" />
  194. widget=<div class="widget">\n\t<div class="widget-header">\n\t\t<i class="icon-"></i>\n\t\t<h3>%cursor%</h3>\n\t</div>\n\t<div class="widget-content">\n\t</div>\n</div>
  195. # Django templates
  196. if={% if %cursor% %}\n\t\n{% endif %}
  197. for={% for sth in %cursor% %}\n\t%cursor%\n{% endfor %}
  198. dv={{ %cursor% }}
  199. db={% %cursor% %}
  200. dbl={% block %cursor% %}\n\t%cursor%\n{% endblock %}
  201. trans={% trans "%cursor%" %}
  202. # jQuery
  203. jquery=<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.5/jquery.min.js"></script>
  204. jqueryui=<script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js"></script>
  205. jready=$(document).ready(function(){\n\t%cursor%\n});
  206. jfunc=$(function(){\n\t%cursor%\n});
  207. log=console.log('%cursor%');
  208.  
  209. [CSS]
  210. # by Tomasz Karbownicki <tomasz@karbownicki.com>
  211. bc=background-color: %cursor%;
  212. bp=background-position: %cursor%;
  213. bct=background-color: transparent;
  214. ba=background: url(%cursor%) %cursor%;
  215. ma=margin: %cursor%;
  216. pa=padding: %cursor%;
  217. bo=border: %cursor%;
  218. co=color: %cursor%;
  219. cu=cursor: %cursor%;
  220. he=height: %cursor%;
  221. wi=width: %cursor%;
  222. di=display: %cursor%;
  223. fs=font-size: %cursor%;
  224. ff=font-family: %cursor%;
  225. fw=font-weight: %cursor%;
  226. ta=text-align: %cursor%;
  227. ts=text-shadow: %cursor%;
  228. td=text-decoration: %cursor%;
  229. fl=float: %cursor%;
  230. lh=line-height: %cursor%;
  231. im=!important
  232. po=position: %cursor%;
  233. ov=overflow: %cursor%;
  234. op=opacity: 0.5;
  235. ra=-moz-border-radius: %cursor%px; -webkit-border-radius: %cursor%px; border-radius: %cursor%px;
  236. sh=border-shadow: %cursor%px %cursor%px #%cursor% %cursor%px;
  237. cmt=/* ######### %cursor% ######### */
  238. hide=text-indent: 9999em; line-height: 9999em; overflow: hidden;
  239.  
  240. [Javascript]
  241. jready=$(document).ready(function(){\n\t%cursor%\n});
  242. jfunc=$(function(){\n\t%cursor%\n});
  243. log=console.log('%cursor%');
  244.  
  245. [LaTeX]
  246. # by Frank Lanitz
  247. frame=\\begin{frame}\n%ws%\\frametitle{%cursor%}\n%ws%%cursor%\n\\end{frame}
  248. block=\\begin{block}{%cursor%}\n%ws%%cursor%\n\\end{block}
  249. itemize=\\begin{itemize}\n%ws%\\item %cursor%\n\\end{itemize}
  250. enumerate=\\begin{enumerate}\n%ws%\\item %cursor%\n\\end{enumerate}
  251. description=\\begin{description}\n%ws%\\item %cursor%\n\\end{description}
  252.  
  253. [Tcl]
  254. # by Witek Mozga
  255. proc=proc %cursor% {  } {\n\t\n} ; # end proc
  256. namespace=namespace eval %cursor% {\n\t\n}; # end namespace
  257. expr=expr { %cursor% }
  258. oo=oo::class create %cursor%  {\n\t\n}; # end class
  259. for=for {set i 0} {$i < %cursor%} {incr i} {\n\t\n} ; # end for
  260. while=while { $%cursor% } {\n\t\n} ; # end while
  261. foreach=foreach x $%cursor% {\n\t\n} ; # end foreach
  262. if=if { $%cursor% } {\n\t\n} ; # end if
  263. else=else {\n\t\n} ; # end else
  264. elseif=elseif { $%cursor% } {\n\t\n} ; # end elseif
  265. switch=switch %cursor% {\n\t\n\tdefault {  }\n} ; # end switch
  266. set=set %cursor% {  }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement