[Geany] Inserting fregments of code into geany

Sam Russo samrusso4 at xxxxx
Sun Feb 1 02:05:34 UTC 2009


Thanks all,
I've had some replies re my request on snippets, and I've implemented 
some additions in my
/home/sam/.geany/snippets.conf

it works OK but still not really enough.

Let me explain:
In editiplus I you have a cliptext library tab (part of the GUI) when 
you open up the correct cliptext library (e.g phpcode) you see all the 
labels for your fragments of code. You put so much in there you ofter 
have to search it.
e.g I might be inserting a text box into a webpage and I know one of my 
fragments had some style sheet code in there. So I would look up "text" 
and all my cliptext library entries starting with "text" can be toggled 
through. I then find the "text box - style sheet"  entry double click it 
and it inserts the code into the editor at the cursor position.
With Geany's snippets you actually have to remember the keyboard entry 
to have it inserted. This won't work because there are literally 
hundreds of entries and you memory is jogged by looking them up and then 
inserting them.

Here is another scenario that I use cliptext libraries that Geany 
snippets could benefit from:
I teach programming for students and after delivering a lesson I can ask 
them to pull up, for example the "Module 23 Cliptext". Inside this there 
would be the code I used in each of the Tutorials from Module 23. Eg 
"Tutorial 1 - Exercise 1code", "Tutorial 2 - Exercise 2 code" etc.

For my own use ATM I will put them all into a "Tomboy Notebook" and 
search->copy->paste into Geany.

Thanks
sam




Dominic Hopf wrote:
> Am Samstag, den 31.01.2009, 14:20 +1100 schrieb Sam Russo:
>   
>> Hi all,
>> this is my first posting to the geany mail list!
>> I've been looking for a replacement for Editplus (excellent windows text 
>> editor... but now I completely debian/ubuntu based) to do my coding 
>> (php/perl/sql) and Geany looks like it might be sufficient.
>>
>> What I need to be able to do ( I'm not sure if "snippets" can actually 
>> do it)  is as follows:
>> 1. Bring up a list that has all my little fragments of code. THis will 
>> not replace any text it simply will be inserted at the cursor point
>> 2. I would like to search quickly my fragments
>> e.g  mysql_connect
>> will insert the 4 or 5 lines have the mysql_connect code with my 
>> username passwords host etc in it
>>     
> Until this point, this is possible with snippets which are supported by
> current versions of geany. You will have to manually edit your
> snippets.conf accordingly. See the documentation for information how to
> do that.
>
>   
>> 3. Once I find the correct fragment I click on it and it inserts the 
>> code into the editor at the cursor point.
>>     
> Sounds like you are asking for a GUI to edit and list snippets. Would be
> an interesting feature, but i don't think it will get into 0.16. Maybe
> in a later version or as a plugin. Patches are welcome anyway i think.
> (I'm not developer of geany.)
>
>   
>> 4. I have different lists as well.
>> e.g phpcode,perlcode,actionscript code, etc
>>     
> This is also supported by the snippets-feature, at least PHP and Perl
> are. I'm not sure if geany has language support for Action Script yet.
>
> _______________________________________________
>   
>> Geany mailing list
>> Geany at uvena.de
>> http://lists.uvena.de/cgi-bin/mailman/listinfo/geany
>>     
>> ------------------------------------------------------------------------
>>
>> _______________________________________________
>> Geany mailing list
>> Geany at uvena.de
>> http://lists.uvena.de/cgi-bin/mailman/listinfo/geany
>>     




More information about the Users mailing list