gedit r6295 - in trunk: . plugins/snippets/data



Author: pborelli
Date: Sat May 24 16:45:02 2008
New Revision: 6295
URL: http://svn.gnome.org/viewvc/gedit?rev=6295&view=rev

Log:
2008-05-24  Paolo Borelli  <pborelli katamail com>

	* plugins/snippets/data/c.xml:
	* plugins/snippets/data/perl.xml:
	* plugins/snippets/data/python.xml:
	Add some useful snippets



Modified:
   trunk/ChangeLog
   trunk/plugins/snippets/data/c.xml
   trunk/plugins/snippets/data/perl.xml
   trunk/plugins/snippets/data/python.xml

Modified: trunk/plugins/snippets/data/c.xml
==============================================================================
--- trunk/plugins/snippets/data/c.xml	(original)
+++ trunk/plugins/snippets/data/c.xml	Sat May 24 16:45:02 2008
@@ -80,12 +80,12 @@
     <description>for loop</description>
   </snippet>
   <snippet id="while">
-    <text><![CDATA[while ($1)
+    <text><![CDATA[while (${1:condition})
 {
 	$0
 }]]></text>
     <tag>while</tag>
-    <description>while</description>
+    <description>while loop</description>
   </snippet>
   <snippet id="once">
     <text><![CDATA[#ifndef __${1:NAME}_H__
@@ -106,6 +106,22 @@
     <tag>if</tag>
     <description>if</description>
   </snippet>
+  <snippet id="elif">
+    <text><![CDATA[else if (${1:condition})
+{
+	$0
+}]]></text>
+    <tag>elif</tag>
+    <description>else if</description>
+  </snippet>
+  <snippet id="else">
+    <text><![CDATA[else
+{
+	$0
+}]]></text>
+    <tag>else</tag>
+    <description>else</description>
+  </snippet>
   <snippet id="Inc">
     <text><![CDATA[#include <${1:file}.h>
 $0]]></text>

Modified: trunk/plugins/snippets/data/perl.xml
==============================================================================
--- trunk/plugins/snippets/data/perl.xml	(original)
+++ trunk/plugins/snippets/data/perl.xml	Sat May 24 16:45:02 2008
@@ -1,5 +1,11 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <snippets language="Perl">
+  <snippet id="perl">
+    <text><![CDATA[#!/usr/bin/perl
+$0]]></text>
+    <tag>perl</tag>
+    <description>#!/usr/bin/perl</description>
+  </snippet>
   <snippet id="ife">
     <text><![CDATA[if ($1) {
 	${2:# body...}

Modified: trunk/plugins/snippets/data/python.xml
==============================================================================
--- trunk/plugins/snippets/data/python.xml	(original)
+++ trunk/plugins/snippets/data/python.xml	Sat May 24 16:45:02 2008
@@ -1,11 +1,27 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <snippets language="Python">
+  <snippet id="py">
+    <text><![CDATA[#!/usr/bin/env python
+#-*- coding:utf-8 -*-
+
+$0]]></text>
+    <description>#!/usr/bin/env python</description>
+    <tag>py</tag>
+  </snippet>
   <snippet id="def">
     <text><![CDATA[def ${1:fname}(${2:self}):
 	${3:pass}]]></text>
     <description>New Function</description>
     <tag>def</tag>
   </snippet>
+  <snippet id="doc">
+    <text><![CDATA["""
+	$1
+"""
+$0]]></text>
+    <description>doc string</description>
+    <tag>doc</tag>
+  </snippet>
   <snippet id="get">
     <text><![CDATA[def get$1(self): return self._$1]]></text>
     <description>New Get Method</description>
@@ -17,11 +33,46 @@
 	def __init__(self${3:,}):
 		${4:pass}
 
-
 $0]]></text>
     <description>New Class</description>
     <tag>class</tag>
   </snippet>
+  <snippet id="for">
+    <text><![CDATA[for ${1:i} in ${2:xrange}(${3:count}):
+	$0]]></text>
+    <description>for loop</description>
+    <tag>for</tag>
+  </snippet>
+  <snippet id="from">
+    <text><![CDATA[from $1 import $2
+$0]]></text>
+    <description>from</description>
+    <tag>from</tag>
+  </snippet>
+  <snippet id="if">
+    <text><![CDATA[if ${1:condition}:
+	$0]]></text>
+    <description>if</description>
+    <tag>if</tag>
+  </snippet>
+  <snippet id="elif">
+    <text><![CDATA[elif ${1:condition}:
+	$0]]></text>
+    <description>elif</description>
+    <tag>elif</tag>
+  </snippet>
+  <snippet id="else">
+    <text><![CDATA[else:
+	$0]]></text>
+    <description>else</description>
+    <tag>else</tag>
+  </snippet>
+  <snippet id="while">
+    <text><![CDATA[while ${1:condition}:
+	$0]]></text>
+    <tag>while</tag>
+    <description>while loop</description>
+  </snippet>
   <snippet id="insert">
     <text><![CDATA["${1:$GEDIT_SELECTED_TEXT}"]]></text>
     <accelerator><![CDATA[<Control>2]]></accelerator>
@@ -42,4 +93,20 @@
     <description>New Set Method</description>
     <tag>set</tag>
   </snippet>
+  <snippet id="try">
+    <text><![CDATA[try:
+	$1
+except ${2:Error}:
+	$0]]></text>
+    <tag>try</tag>
+    <description>Try... Except</description>
+  </snippet>
+  <snippet id="main">
+    <text><![CDATA[if __name__ == '__main__':
+	${1:sys.exit(main())}
+
+$0]]></text>
+    <description>main</description>
+    <tag>main</tag>
+  </snippet>
 </snippets>



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]