![]() ![]() But the code itself doesn't have much more than it needs to work. I wish I understood a bit more about the menu stuff - you have to use the GTK API for that, and it uses some default params that I don't understand exactly for where to place the menu. You can see that it's cut down to just about the bare-minimum. (If you want to try them, just put them in ~/.gnome2/gedit/plugins). I'll just link to the two files needed to run the plugin: inserttimestamp.gedit-plugin and inserttimestamp.py. By looking at some other plugins and stripping away the excess, I got down to a super-simple plugin that simply adds a menu, then does something to the document (in this case adding a timestamp). If you follow the gedit plugin how-to instructions, you can see that the document writers broke the cardinal rule of beginning how-tos by including crap you don't need at first. I'm glad I didn't notice though, since that allowed me to learn how plugins work and create a sort of "canonical" plugin that I can expand on later. It wasn't until *AFTER* I wrote a simple plugin to do the same thing that I noticed that you can just go into "configure plugin" and choose the default format. ![]() There's already a plugin that's included called "Insert Date" but by default it pops up a dialog to ask you for a format each time. This can be a bit of an issue, as if I've turned on line numbers and highlighting, and then open up a random text file for a README or something, the use cases sort of overlap (not that it bothers me that much).Īnyways, I decided to create a *really simple* plugin for inserting a timestamp - I use text documents to record ideas and todos, and I always put in a timestamp before I start writing. ![]() It's actually amusing that the default text editor in Gnome is as powerful as it is - coming from Windows, you're used to Notepad being a piece of junk and having to find other apps to do any real work. I actually really like gedit as a text editor - it's lightweight and with the plugins provides nearly as much functionality as UltraEdit or Textmate. usr/local/share/gtksourceview-3.I was looking at the various gedit plugins yesterday, and decided I wanted to write my own. usr/share/gnome/gtksourceview-3.0/styles/ In Debian-based distributions this is package python-gtksourceview2.Ī typical search path for GtkSourceView version 3 looks like To run it you need the python bindings for GtkSourceView 2. If this does not work in your distribution you can find out your style search path with this python script. usr/local/share/gtksourceview-2.0/styles/ usr/share/gnome/gtksourceview-2.0/styles/ ![]() To install a style just place its XML file into a folder of the style search path.Ī typical search path for GtkSourceView version 2 looks like: So the information below isn't particularly relevant, though I'll let it stay because it might help in some way. The original themes are (on my machine) at: Though I believe on some installations it is at: $HOME/.local/share/gedit/styles/ On my machine it seems gedit keeps its newly added themes at: ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |