Using Live Templates to type less

Hi :slight_smile:

I’m surprised I can’t find any post about this:

This repository includes a collection of Live Templates for IntelliJ Idea. What they enable is for you to type ora (for example) and after pressing the TAB key it gets converted into

fun main() = application { 
    configure { }
    program {
        extend {

I find that super convenient. Just create a new Kotlin file, type ora [TAB] and you’re rolling :slight_smile:

You can combine those with your own live templates. My settings look like this:

I added things I frequently use. For example if I type kb [TAB] I get

keyboard.keyDown.listen { 
    when(it.key) {
        KEY_ENTER -> 1+1
        KEY_ESCAPE -> application.exit()

I got used to closing my program by pressing the ESC key with Processing ¯\_(ツ)_/¯.
The 1+1 is just a placeholder to fill with something more useful, in case you are wondering :slight_smile:

Do you have any templates that make your life easier?

The Settings Repository Idea plugin is no longer included by default. It made it easy to synchronize settings between your IDE and a repo.

One can install that plugin from the marketplace but the reviews are not positive at all, so here’s how to install the templates manually in 3 simple steps:

1 Like