Code Snippets via keyboard shortcut possible?

I am wondering if code snippers are possible. Little pieces of code that you can assign to a keyboard shortcut (or maybe even a toolbar icon). I think I understand live templates but it doesn't seem to do this exactly and requires a user to start typing something, unless I am missing a way to add keyboard shortcuts to them.

Comment actions Permalink

Not possible.

Live templates are actually good -- you just need to get used to them.

In any case -- you can record a macro where you expand live template (or typing whole code from scratch) and then you can assign shortcut to it in "Settings | Keymap".

Alternatively -- check plugins -- there may be one that does such task in a way you want it.

Comment actions Permalink

I can tell live templates are very good. I am still brainstorming different ways to use them. They seem very powerful.

I was able to do what I wanted with a macro though as you suggested. Thanks.


Please sign in to leave a comment.