Hi.
While playing around with Geany and exploring its features, some ideas came to my mind that might be nice to have, also some questions:
- Snippets: Very cool feature. But adding a snippet to snippets.conf apparently needs a Geany restart to get it working. Would it be possible to add a function to reload snippets.conf while Geany is running and make newly defined snippets work on-the-fly? Also it would be nice, if I could use snippets across several filetypes, e.g. I'd like to use my HTML-snippets also in PHP-files. I can copy them to the PHP-section of course, but maybe something like: [HTML,PHP] could be used for a section?
- Templates: Is it correct that I can only add templates for defined filetypes? I'd like to be able to have a template for XHTML-strict and one for XHTML-transitional e.g. and see them in the "New (with template)"-menu.
- Filetypes: Is it possible to add a custom filetype, e.g. Flash-ActionScript and tell it to use the cpp-lexer of Scintilla, like you can do in SciTE?
Am Donnerstag, den 01.05.2008, 18:29 +0200 schrieb Andreas Mokros:
Hi.
While playing around with Geany and exploring its features, some ideas came to my mind that might be nice to have, also some questions:
- Snippets:
Very cool feature. But adding a snippet to snippets.conf apparently needs a Geany restart to get it working. Would it be possible to add a function to reload snippets.conf while Geany is running and make newly defined snippets work on-the-fly?
Nice idea.
Also it would be nice, if I could use snippets across several filetypes, e.g. I'd like to use my HTML-snippets also in PHP-files. I can copy them to the PHP-section of course, but maybe something like: [HTML,PHP] could be used for a section?
Nice idea too.
- Templates:
Is it correct that I can only add templates for defined filetypes? I'd like to be able to have a template for XHTML-strict and one for XHTML-transitional e.g. and see them in the "New (with template)"-menu.
Reading the manual of the current version tells me, that there has just to be added a new filetypes.language. I didn't checked that yet.
- Filetypes:
Is it possible to add a custom filetype, e.g. Flash-ActionScript and tell it to use the cpp-lexer of Scintilla, like you can do in SciTE?
At the moment this is not possible. Yet. I'm following the development in SVN and there seems something to be in work for that. ;)
Am Freitag, den 02.05.2008, 19:48 +0200 schrieb Dominic Hopf:
Am Donnerstag, den 01.05.2008, 18:29 +0200 schrieb Andreas Mokros:
Hi.
While playing around with Geany and exploring its features, some ideas came to my mind that might be nice to have, also some questions:
- Snippets:
Very cool feature. But adding a snippet to snippets.conf apparently needs a Geany restart to get it working. Would it be possible to add a function to reload snippets.conf while Geany is running and make newly defined snippets work on-the-fly?
Nice idea.
Also it would be nice, if I could use snippets across several filetypes, e.g. I'd like to use my HTML-snippets also in PHP-files. I can copy them to the PHP-section of course, but maybe something like: [HTML,PHP] could be used for a section?
Nice idea too.
- Templates:
Is it correct that I can only add templates for defined filetypes? I'd like to be able to have a template for XHTML-strict and one for XHTML-transitional e.g. and see them in the "New (with template)"-menu.
Reading the manual of the current version tells me, that there has just to be added a new filetypes.language. I didn't checked that yet.
Well. The filetype has to be known by Geany. Check against the filedefs-directory to see which filetypes are recognized. I tried that out with filetype.javascript (which worked) and filetype.xhtml (which did not work.)
- Filetypes:
Is it possible to add a custom filetype, e.g. Flash-ActionScript and tell it to use the cpp-lexer of Scintilla, like you can do in SciTE?
At the moment this is not possible. Yet. I'm following the development in SVN and there seems something to be in work for that. ;)
Regards,
On Fri, 02 May 2008 20:10:11 +0200, Dominic Hopf dmaphy@googlemail.com wrote:
Hi,
- Templates:
Is it correct that I can only add templates for defined filetypes? I'd like to be able to have a template for XHTML-strict and one for XHTML-transitional e.g. and see them in the "New (with template)"-menu.
Reading the manual of the current version tells me, that there has just to be added a new filetypes.language. I didn't checked that yet.
Well. The filetype has to be known by Geany. Check against the filedefs-directory to see which filetypes are recognized. I tried that out with filetype.javascript (which worked) and filetype.xhtml (which did not work.)
XHTML is not a filetype in Geany and so filetypes.xhtml doesn't work. But filetypes.xml or filetypes.html will work.
Quoting the manual: "Filetype template files are read from the ~/.geany/templates directory, and are named "filetype." followed by the filetype name, e.g. "filetype.python", "filetype.sh", etc. If you are unsure about the filetype name extensions, they are the same as the filetype configuration file extensions, commonly installed in /usr/share/geany, with the prefix "filetypes."."
Regards, Enrico
Dominic Hopf wrote:
function to reload snippets.conf while Geany is running and make newly defined snippets work on-the-fly?
Nice idea.
Definitely. An editor dialog for snippets would also be nice. Maybe that could be done with GeanyLua... There's that function: configuration_read_snippets in keyfile.c, which seems to load the snippets-data. Would it be a problem to simply add this function to keybindings/menu-items?
Also it would be nice, if I could use snippets across several filetypes, e.g. I'd like to use my HTML-snippets also in PHP-files.
Nice idea too.
Thinking about it, for the PHP/HTML-case it might be useful to have subsets, so I could define HTML-snippets and then use all of them in PHP as well, same goes for JavaScript/CSS and HTML...
Is it correct that I can only add templates for defined filetypes?
Well. The filetype has to be known by Geany. Check against the filedefs-directory to see which filetypes are recognized. I tried that out with filetype.javascript (which worked) and filetype.xhtml (which did not work.)
Yes. I already tried this, hence my question.
Is it possible to add a custom filetype, e.g. Flash-ActionScript and tell it to use the cpp-lexer of Scintilla, like you can do in SciTE?
At the moment this is not possible. Yet. I'm following the development in SVN and there seems something to be in work for that. ;)
I saw the branch. Nice...
On Fri, 2 May 2008 23:11:18 +0200, Andreas Mokros am@medienpensionat.com wrote:
Dominic Hopf wrote:
function to reload snippets.conf while Geany is running and make newly defined snippets work on-the-fly?
Nice idea.
Definitely. An editor dialog for snippets would also be nice. Maybe that could be done with GeanyLua...
It would be nice but isn't really necessary IMO. Patches/Plugins are welcome.
But we could add the possibility to reload the snippets data in Geany, same for the template data.
Also it would be nice, if I could use snippets across several filetypes, e.g. I'd like to use my HTML-snippets also in PHP-files.
Nice idea too.
Thinking about it, for the PHP/HTML-case it might be useful to have subsets, so I could define HTML-snippets and then use all of them in PHP as well, same goes for JavaScript/CSS and HTML...
I think it's just enough to write such common snippets in the default section and then they become available for all filetypes. Things like [PHP,HTML] would make it too complicated, IMHO.
Regards, Enrico
On Thu, 1 May 2008 18:29:05 +0200 Andreas Mokros am@medienpensionat.com wrote:
...
Also it would be nice, if I could use snippets across several filetypes, e.g. I'd like to use my HTML-snippets also in PHP-files. I can copy them to the PHP-section of course, but maybe something like: [HTML,PHP] could be used for a section?
As Enrico mentioned, you can use the [Default] section to do this. But we might accept a patch.
- Templates:
Is it correct that I can only add templates for defined filetypes? I'd like to be able to have a template for XHTML-strict and one for XHTML-transitional e.g. and see them in the "New (with template)"-menu.
Custom template file support is on the TODO list, so hopefully you will be able to do this at some point. Something like:
New with template ->Programming ->C ->file header ->main.c ->project.h ->project.c ->... ... ...
And I think that these file templates could be read from disk, like opening a file, rather than caching them. But I'm not sure when it'll get done ;-)
- Filetypes:
Is it possible to add a custom filetype, e.g. Flash-ActionScript and tell it to use the cpp-lexer of Scintilla, like you can do in SciTE?
I started some work which is necessary to support this, so probably at some point you will be able to do it ;-)
Regards, Nick