I am evaluating Geany, as I am moving my main development environment from win to linux (finally!). In windows, I used and loved MultiEdit.
I think that Geany seams to be in line what I expect and like from an editor.
I mostly care about a lean 'C' editor.
So; As far as I can understand, there's no keyword autocompletion. With this I mean e.g. that I type "wh" and hit space, where the editor exanps the keyword and builds the construct, such as: while ( ) { } .. or similar.
I understand that the functionality is almost there, by instead use TAB, but only once the full keyword has been entered. i.e. while<TAB> builds the construct.
Have I understood this correct?
If so; I also realise that snippets could be enhanced to do this, if there would be an optional accept length? e.g: "accept keyword min len lookup = 2" would give the correct key-word expansion after at least wh and TAB where entered. (Obviously whi<TAB> would also work)
Is there any thoughts/work in this direction?
Thanks, - Micael
On Fri, 11 Jul 2008 13:37:59 +0200 Micael m8847@abc.se wrote:
As far as I can understand, there's no keyword autocompletion. With this I mean e.g. that I type "wh" and hit space, where the editor exanps the keyword and builds the construct, such as: while ( ) { } .. or similar.
I understand that the functionality is almost there, by instead use TAB, but only once the full keyword has been entered. i.e. while<TAB> builds the construct.
You can set the 'Complete snippet' keybinding to space if you like.
I also realise that snippets could be enhanced to do this, if there would be an optional accept length? e.g: "accept keyword min len lookup = 2" would give the correct key-word expansion after at least wh and TAB where entered. (Obviously whi<TAB> would also work)
Maybe this could be implemented. For now you could edit ~/.geany/snippets.conf and change the 'while' key to 'wh'.
Regards, Nick
On Friday 11 July 2008 16.07.14 Nick Treleaven wrote:
On Fri, 11 Jul 2008 13:37:59 +0200 Micael <m8847@abc...> wrote:
As far as I can understand, there's no keyword autocompletion. With this I mean e.g. that I type "wh" and hit space, where the editor exanps the keyword and builds the construct, such as: while ( ) { } .. or similar.
I understand that the functionality is almost there, by instead use TAB, but only once the full keyword has been entered. i.e. while<TAB> builds the construct.
You can set the 'Complete snippet' keybinding to space if you like.
Actually, no, as Geany (yet) does not have context knowledge - i.e. if I would write the (quite common) word "if" whithin a comment, it would expand to the construct build... But, I can live with the TAB expansion, in one way, one could argue that it is more natural in the linux environment anyway.
I also realise that snippets could be enhanced to do this, if there would be an optional accept length? e.g: "accept keyword min len lookup = 2" would give the correct key-word expansion after at least wh and TAB where entered. (Obviously whi<TAB> would also work)
Maybe this could be implemented. For now you could edit ~/.geany/snippets.conf and change the 'while' key to 'wh'.
Yeah, I guess! Maybe that is a solution. As this will generate quite a few snippets, I would be concerned about the speed. But maybe this is not really a problem.
Thanks, Micael
On Fri, 11 Jul 2008 21:03:51 +0200 Micael m8847@abc.se wrote:
Maybe this could be implemented. For now you could edit ~/.geany/snippets.conf and change the 'while' key to 'wh'.
Yeah, I guess! Maybe that is a solution. As this will generate quite a few snippets, I would be concerned about the speed. But maybe this is not really a problem.
Just give it a try and maybe some feedback here ;)
Regards, Frank
On Fri, 11 Jul 2008 21:03:51 +0200, Micael m8847@abc.se wrote:
On Friday 11 July 2008 16.07.14 Nick Treleaven wrote:
On Fri, 11 Jul 2008 13:37:59 +0200 Micael <m8847@abc...> wrote:
As far as I can understand, there's no keyword autocompletion. With this I mean e.g. that I type "wh" and hit space, where the editor exanps the keyword and builds the construct, such as: while ( ) { } .. or similar.
I understand that the functionality is almost there, by instead use TAB, but only once the full keyword has been entered. i.e. while<TAB> builds the construct.
You can set the 'Complete snippet' keybinding to space if you like.
Actually, no, as Geany (yet) does not have context knowledge - i.e. if I would write the (quite common) word "if" whithin a comment, it would expand to the construct build...
Well, this can be considered as a bug or as a feature...IMO it's a feature because in this way it's also possible to use snippet completion in comments. And since snippet completion is intended to be triggered explicitly for instance by using TAB and not Space, I don't think this is a real problem.
I also realise that snippets could be enhanced to do this, if there would be an optional accept length? e.g: "accept keyword min len lookup = 2" would give the correct key-word expansion after at least wh and TAB where entered. (Obviously whi<TAB> would also work)
Maybe this could be implemented. For now you could edit ~/.geany/snippets.conf and change the 'while' key to 'wh'.
Yeah, I guess! Maybe that is a solution. As this will generate quite a few snippets, I would be concerned about the speed. But maybe this
As Frank told, try it. Anyway, the snippets are read from the file once at startup and then they are kept in a hash table which is a quite good data structure for this case. The code surely can be improved but I don't think speed is a real concern if you about up to 50 snippets. Check it out.
Regards, Enrico
On Saturday 12 July 2008 11.53.21 Enrico Tröger wrote:
Maybe this could be implemented. For now you could edit ~/.geany/snippets.conf and change the 'while' key to 'wh'.
Yeah, I guess! Maybe that is a solution. As this will generate quite a few snippets, I would be concerned about the speed. But maybe this
As Frank told, try it. Anyway, the snippets are read from the file once at startup and then they are kept in a hash table which is a quite good data structure for this case. The code surely can be improved but I don't think speed is a real concern if you about up to 50 snippets. Check it out.
OK, I did check it out, and I have been using it for some time now, and I can report that it works just fine, no speed issues with my box. :)
I have one small issue with the snippets though, and with # in particular. Such as: #define
Is there a way to use hash in the snippet file? I tried to backslash it, but that did not work.
Obviously, whith hash being the comment character, one cant start the line with #d= ..
On Thu, 7 Aug 2008 18:41:52 +0200, Micael m8847@abc.se wrote:
Hey,
Is there a way to use hash in the snippet file? I tried to backslash it, but that did not work.
Obviously, whith hash being the comment character, one cant start the line with #d= ..
It seems you can't use the hash at any point in a line. But this is a limitation of the GLib key-value file parser. If nobody does it before I'll open a bugreport this evening or tomorrow.
Regards, Enrico
On Fri, 8 Aug 2008 12:45:29 +0200, Enrico Tröger enrico.troeger@uvena.de wrote:
On Thu, 7 Aug 2008 18:41:52 +0200, Micael m8847@abc.se wrote:
Hey,
Is there a way to use hash in the snippet file? I tried to backslash it, but that did not work.
Obviously, whith hash being the comment character, one cant start the line with #d= ..
It seems you can't use the hash at any point in a line. But this is a limitation of the GLib key-value file parser. If nobody does it before I'll open a bugreport this evening or tomorrow.
Done: http://bugzilla.gnome.org/show_bug.cgi?id=547175
Regards, Enrico
On Sun, 10 Aug 2008 15:57:36 +0200 Enrico Tröger enrico.troeger@uvena.de wrote:
It seems you can't use the hash at any point in a line. But this is a limitation of the GLib key-value file parser. If nobody does it before I'll open a bugreport this evening or tomorrow.
One of the responses suggested something like: def=#define
I've tested this and it seems to work.
Regards, Nick
On Mon, 11 Aug 2008 12:44:04 +0100, Nick Treleaven nick.treleaven@btinternet.com wrote:
On Sun, 10 Aug 2008 15:57:36 +0200 Enrico Tröger enrico.troeger@uvena.de wrote:
It seems you can't use the hash at any point in a line. But this is a limitation of the GLib key-value file parser. If nobody does it before I'll open a bugreport this evening or tomorrow.
One of the responses suggested something like: def=#define
I've tested this and it seems to work.
It does. It even works with a hash in the keys but this would also require to include the hash character in the wordchars (see section 'Special' in snippets.conf).
No idea why it didn't work for me before, I thought I tested it in all possibilities but obviously I didn't.
But an hash character at the beginning of the line is still a comment character because it can't be escaped. I'll add this note to the bug report even I think this won't be changed.
Regards, Enrico
On Mon, 11 Aug 2008 15:54:05 +0200, Enrico Tröger enrico.troeger@uvena.de wrote:
On Mon, 11 Aug 2008 12:44:04 +0100, Nick Treleaven nick.treleaven@btinternet.com wrote:
On Sun, 10 Aug 2008 15:57:36 +0200 Enrico Tröger enrico.troeger@uvena.de wrote:
It seems you can't use the hash at any point in a line. But this is a limitation of the GLib key-value file parser. If nobody does it before I'll open a bugreport this evening or tomorrow.
One of the responses suggested something like: def=#define
But an hash character at the beginning of the line is still a comment character because it can't be escaped. I'll add this note to the bug report even I think this won't be changed.
The key-value format just doesn't allow hashes or even escaped hashes in keys especially not at the beginning.
I guess you can workaround the problem, maybe with the the suggestino mentioned above.
Regards, Enrico
On Monday 11 August 2008 19.05.51 Enrico Tröger wrote:
On Mon, 11 Aug 2008 15:54:05 +0200, Enrico Tröger enrico.troeger@uvena.de wrote:
On Mon, 11 Aug 2008 12:44:04 +0100, Nick Treleaven nick.treleaven@btinternet.com wrote:
On Sun, 10 Aug 2008 15:57:36 +0200 Enrico Tröger enrico.troeger@uvena.de wrote:
It seems you can't use the hash at any point in a line. But this is a limitation of the GLib key-value file parser. If nobody does it before I'll open a bugreport this evening or tomorrow.
One of the responses suggested something like: def=#define
But an hash character at the beginning of the line is still a comment character because it can't be escaped. I'll add this note to the bug report even I think this won't be changed.
The key-value format just doesn't allow hashes or even escaped hashes in keys especially not at the beginning.
I guess you can workaround the problem, maybe with the the suggestino mentioned above.
Regards, Enrico
Was this aimed at me? I realized, and used the "workaround" all the time, but it is not really great, since you have to relearn (instead of writing #d .. before hitting TAB, you have to deliberatly omit the hash) which is a route I'd rather not go.
Having said that, I think this is a quite small issue, and maybe not worth any extra work.
Thanks, Micael
On Mon, 11 Aug 2008 20:56:33 +0200, Micael m8847@abc.se wrote:
On Monday 11 August 2008 19.05.51 Enrico Tröger wrote:
On Mon, 11 Aug 2008 15:54:05 +0200, Enrico Tröger enrico.troeger@uvena.de wrote:
On Mon, 11 Aug 2008 12:44:04 +0100, Nick Treleaven nick.treleaven@btinternet.com wrote:
On Sun, 10 Aug 2008 15:57:36 +0200 Enrico Tröger enrico.troeger@uvena.de wrote:
It seems you can't use the hash at any point in a line. But this is a limitation of the GLib key-value file parser. If nobody does it before I'll open a bugreport this evening or tomorrow.
One of the responses suggested something like: def=#define
But an hash character at the beginning of the line is still a comment character because it can't be escaped. I'll add this note to the bug report even I think this won't be changed.
The key-value format just doesn't allow hashes or even escaped hashes in keys especially not at the beginning.
I guess you can workaround the problem, maybe with the the suggestino mentioned above.
Regards, Enrico
Was this aimed at me? I realized, and used the "workaround" all the
Yes.
time, but it is not really great, since you have to relearn (instead of writing #d .. before hitting TAB, you have to deliberatly omit the hash) which is a route I'd rather not go.
Patches are welcome :).
Regards, Enrico