gedit r6300 - in branches/gnome-2-22: . plugins/snippets/data
- From: pborelli svn gnome org
- To: svn-commits-list gnome org
- Subject: gedit r6300 - in branches/gnome-2-22: . plugins/snippets/data
- Date: Tue, 27 May 2008 07:53:40 +0000 (UTC)
Author: pborelli
Date: Tue May 27 07:53:40 2008
New Revision: 6300
URL: http://svn.gnome.org/viewvc/gedit?rev=6300&view=rev
Log:
backport snippet improvements
Modified:
branches/gnome-2-22/ChangeLog
branches/gnome-2-22/plugins/snippets/data/c.xml
branches/gnome-2-22/plugins/snippets/data/perl.xml
branches/gnome-2-22/plugins/snippets/data/python.xml
Modified: branches/gnome-2-22/plugins/snippets/data/c.xml
==============================================================================
--- branches/gnome-2-22/plugins/snippets/data/c.xml (original)
+++ branches/gnome-2-22/plugins/snippets/data/c.xml Tue May 27 07:53:40 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: branches/gnome-2-22/plugins/snippets/data/perl.xml
==============================================================================
--- branches/gnome-2-22/plugins/snippets/data/perl.xml (original)
+++ branches/gnome-2-22/plugins/snippets/data/perl.xml Tue May 27 07:53:40 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: branches/gnome-2-22/plugins/snippets/data/python.xml
==============================================================================
--- branches/gnome-2-22/plugins/snippets/data/python.xml (original)
+++ branches/gnome-2-22/plugins/snippets/data/python.xml Tue May 27 07:53:40 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]