gEdit Template plugin
Monday, 19. November 2007, 17:14:40
How it works:
* Copy the files of the Template plugin into ~/.gnome2/gedit/plugins
* create a folder "templates" in ~/.gnome2/gedit
* copy your templates files into it (example default.html)
* Start gEdit and enable the plugin "New File From a Template" in the preferences
* After a restart the plugin appears in the File menu
* Assign the typical shortcut "Shift+Ctrl+N" to it
* the new created files will get the mimetype of the template files
Download:
http://files.myopera.com/area42/files/gedit_template_plugin.zip
gEdit plugins i wrote too:
http://my.opera.com/area42/blog/gedit-language-reference-plugin
http://my.opera.com/area42/blog/gedit-browser-preview-plugin
A lot of other gEdit plugins can be found here.








Anonymous # 28. November 2007, 04:02
Great template! I've just released a basic template set for this: http://hansengel.wordpress.com/2007/11/27/gedit-template-plugin-basic-templates/
It includes most templates that web developers would need.
Eckhard M. Jäger # 28. November 2007, 07:47
very cool, i will check it out!
Anonymous # 28. November 2007, 13:37
I have a suggestion for this plugin....
Why not make support for "variables", like the current user logged in? Then, we could reference the variables from our templates through brackets (ex. "{user}"). The plugin would process the template, and replace the variables with their values.
Eckhard M. Jäger # 28. November 2007, 18:10
Anonymous # 26. July 2008, 07:49
Hi!
I have a problem with one of your plugins - template-plugin.
The dialogwindow will not close after I have choosed a template.
Its an template I made myself(actionscript)....when I choose
another the window close....strange.
Regards
TompaD
Eckhard M. Jäger # 26. July 2008, 10:20
Can i download it and take a look? Or drop me a line: bart neeeneenee de
Anonymous # 1. August 2008, 09:12
I made a new one with mxml-extension, but the same there, no closing of window after clicking OK.
It looks like this:
regards
Tompad
Eckhard M. Jäger # 1. August 2008, 10:36
Anonymous # 2. August 2008, 07:37
How strange!
The filenames is Flex.mxml and Actionscript3.as - I tried with different files...
So no spaces...Is it because I run it on Xubuntu?? ...but when none of the templates should work......the "original" templates loads as they should.....this is a mysterium for me.....
Anonymous # 2. August 2008, 08:31
Hi again!
I tried to make other template - TXT.txt, DOC.doc and PHP5.php - and guess what!
Only PHP5.php did work as the "original" templates. Is there a list in the plugin with which files is accepted?
Anonymous # 2. August 2008, 08:40
Hi again! :-)
What is the latest version of plugin?
I got 1.02.
Regards
TompaD
Eckhard M. Jäger # 2. August 2008, 09:04
Anonymous # 2. August 2008, 09:31
Lets see - I have Xubuntu 8.04 with Xfce 4 Desktop Environment
version 4.4.2 (Xfce 4.4), gEdit is 2.22.3
Alexs # 21. October 2008, 17:10
Jetzt muss ich nur noch schauen dass ich den Color-Picker (nicht das ganze Paket) zum laufen bekomme.
Grüsse Alexs
Eckhard M. Jäger # 21. October 2008, 20:38
Hier gibt es noch mehr Plugins für gEdit:
http://live.gnome.org/Gedit/Plugins#third_party
Und unbedingt die Snippet-Sammlung für das Externe Werkzeuge-Plugin ansehen:
http://live.gnome.org/Gedit/ExternalToolsPluginSnippets
Anonymous # 2. May 2009, 10:03
I think this is somewhat broken in gEdit 2.26.1 (Ubuntu 9.04). The part that's broken seems to be the language detection of the template. I just deleted that whole part and it worked.
But thanks, great plugin :)
Eckhard M. Jäger # 6. May 2009, 21:22
you are right, i got a brand new Dell Studio 17 and will install Jaunty on it, then i will fix this problem.
Anonymous # 7. May 2009, 06:36
I made a version that uses ~/Templates (to share with nautilus) and uses some variables:
$$DATETIME$$
$$YEAR$$
$$USER_EMAIL$$
$$USER_NAME$$
$$USER_NICKNAME$$
It grabs this data from the gnome "About Me" dialog.
You can see how to add them by searching for "add some useful presets" in template.py
I also included templates for Druapl6 module, and some others I find useful.
http://david.konsumer.googlepages.com/gedit_template_plugin.zip
Eckhard M. Jäger # 7. May 2009, 19:33
this sound great. Did it working on Ubuntu 9.04?
Alexs # 11. May 2009, 16:19
Wenn ich eine HTML-Vorlage mit gedit 2.26.1 öffnen will (sidux), steht folgendes in der Konsole:
Grüße Alexs
Eckhard M. Jäger # 11. May 2009, 20:43
yes i know there is a problem with the gEdit Template plugin. I switched now to Ubuntu 9.04 that ships with Gnome 2.26 and will fix this problem soon.
Thanks for your reply.
Anonymous # 11. May 2009, 22:43
area42: yes, I am using jaunty.
alex: I didn't touch the language stuff (I don't think.) By the error message, it looks like you are using an older version (I notice there is old language stuff commented out at line 145) Try a new version, try switching around the commented stuff in that area. Maybe comment all the language stuff. what happens?
th3pr0ph3t # 19. May 2009, 20:03
Anyway, I want to share it and the modifications I did include:
- the language thing where the template is not loaded because it tries to call a method that does not exist anymore.
- the plugin now ASKS now asks for the NEW DOCUMENT's name (starting in the currently open file's directory). It copies the file, then opens it.
- it does not fail (showing an empty document) when the template uses an encoding different than UTF-8 (I needed ISO-8859-1).
- the following expressions are resolved if found in the template text:
$USER $USERNAME, $LOGNAME
$HOME
...and all vars replaced by os.path.expandvars()
$DATE
$TIME
$DATETIME
$GEDIT_CURRENT_DOCUMENT_URI
$GEDIT_CURRENT_DOCUMENT_NAME
$GEDIT_CURRENT_DOCUMENT_PATH
$GEDIT_CURRENT_DOCUMENT_DIR
Well that's the way I like it, maybe somebody else does.
Here's the file, regards.
http://files.myopera.com/th3pr0ph3t/files/template.zip
Eckhard M. Jäger # 20. May 2009, 07:34
Anonymous # 6. July 2009, 19:15
It's not working for me. When I go to 'New from template', I'll try and open my template. But it won't. It doesn't work using a double-click or just pressing open. I end up having to close the window, and just opening the file, and doing a 'Save-as'. This is on Ubuntu 9.04.
Anonymous # 6. July 2009, 19:18
Oh, th3pr0ph3t's fix seems to be working for me.
It also ask for the new name of the file, which is something that would have been useful.
Anonymous # 15. July 2009, 06:33
I lost on how to assign a keyboard shortcut, could someone please post how they did it. Thanks.
Eckhard M. Jäger # 15. July 2009, 21:24
http://blogs.gnome.org/thos/files/2007/05/Screenshot-Appearance%20Preferences-4.png
Well if dynamic shortcuts enabled on your gnome desktop than hover over the menu entry and press the keyys you like to use
Anonymous # 10. August 2009, 12:12
@th3pr0ph3t,
your modified plugin works for me, thanks.
Anonymous # 10. September 2009, 16:20
I have this same problem mentioned above:
----------
It's not working for me. When I go to 'New from template', I'll try and open my template. But it won't. It doesn't work using a double-click or just pressing open. I end up having to close the window, and just opening the file, and doing a 'Save-as'. This is on Ubuntu 9.04.
-----------
It used to work fine. Not sure when it stopped working
Anonymous # 18. November 2009, 20:52
I'm currently getting a broken link on the zip file, is it still available?
Anonymous # 4. January 2010, 15:39
I found a little bug that it's easy to correct in template.py .
In line 229 #buttons = (gtk.STOCK_CANCEL, gtk.RESPONSE_CANCEL, gtk.STOCK_OPEN, gtk.RESPONSE_OK) appears a button with the label 'Open' when it really has to say 'Save' because its function is to save the file generated from the template.
I put in my line 229: buttons = (gtk.STOCK_CANCEL, gtk.RESPONSE_CANCEL, gtk.STOCK_SAVE, gtk.RESPONSE_OK) and it works!
Hope it can help.