Bug 165428 - ability to assign keyboard shortcut to a snippet
Summary: ability to assign keyboard shortcut to a snippet
Status: RESOLVED FIXED
Alias: None
Product: kdevplatform
Classification: Developer tools
Component: snippet (show other bugs)
Version: git master
Platform: openSUSE Linux
: NOR wishlist
Target Milestone: ---
Assignee: kdevelop-bugs-null
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-06-30 17:01 UTC by Maciej Pilichowski
Modified: 2011-08-07 06:59 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Maciej Pilichowski 2008-06-30 17:01:17 UTC
Version:            (using KDE 3.5.9)
Installed from:    SuSE RPMs

ability to assign keyboard shortcut to a snippet

Well, what can I say more? In edit dialog there should be also place for keyboard shortcut so I could call snippet X by pressing ctrl+alt+shift+? :-)
Comment 1 Andreas Pakulat 2008-06-30 17:46:07 UTC
I don't think having shortcuts for snippets makes much sense when we can provide completion of snippets. I think its much easier to type fo<ctrl+space> (or have automatic completion) and hit down once to select "foreach" instead of "for". This is already mostly working in KDevelop4 actually.

The problem with keyboard shortcuts is that it is somewhat disturbing to normal typing IMHO (especially such things as Ctrl+Alt+Shift+<something>), its far more natural to just type the start of the snippet and then automatically complete the rest.

What do you think?
Comment 2 Maciej Pilichowski 2008-06-30 17:52:44 UTC
First paragraph -- true, of course.

Second, ctrl+alt+shift+meta, this was of course humorous example, look at the smiley. Shortcuts are examples, they should be configurable, and with this in mind, I agree with you that I don't use it in _all_ snippets, but for some, every 2 minutes usage, it would be useful to have ability to just hit F6 and get the snippet, instead of writing "for"+F7 (which would call foreach snippet).
Comment 3 Andreas Pakulat 2008-06-30 19:18:48 UTC
Another problem is: With 50 snippets you instantly have 50 more actions in the configure-shortcuts dialog which adds quite some clutter. Especially when people start to share snippet repositories its getting easily out-of-hand.

I'm not sure wether its possible in the curreng gui framework to change the list of actions and thus shortcuts, so the configuration could be inside the snippet part and it would only expose the actions that actually do have shortcuts set.

Anyway, will keep this in mind, as snippets support is something I want to work on before the 4.0 release (its rather incomplete currently).
Comment 4 Maciej Pilichowski 2008-06-30 20:03:34 UTC
I had in mind the shortcuts available through snippets, but well, via settings -> shortcuts this would also be useful (or rather consistent). One group -> "snippets" should solve clutter problem (you don't like, just collapse the snippets node).
Comment 5 Andreas Pakulat 2008-06-30 22:47:59 UTC
Apart from the grouping in the shortcuts dialog not working currently (which is a separate bug) it would still clutter a bit when browsing. Anyway, the idea is quite ok, we can find the right implementation when somebody actually does write the code for this :)
Comment 6 Robert Gruber 2009-03-24 10:10:12 UTC
In KDevelop4 there is codecompletion for snippets.
Shouldn't that do the trick?
Comment 7 Maciej Pilichowski 2009-03-24 13:19:17 UTC
Andreas already made that suggestion :-) But no, I really mean shortcut, so you won't have to type any prefix first.
Comment 8 Aleix Pol 2011-08-07 06:59:55 UTC
We already have shortcuts for snippets.