Live Templates

Live Templates is an IntelliJ Idea feature that expands short acronyms into full blocks of code.

To install the live templates:

  1. Right click on OPENRNDR.xml → Open In New Window
  2. On the new window, select everything except the first and the last lines.
  3. Right click on the selected text → Copy
  4. In IntelliJ Idea, go to File → Settings → Editor → Live Templates
  5. Click on + on the right side of the window to create a Template Group called OPENRNDR.
  6. Click on the new OPENRNDR group to select it.
  7. Press CTRL+V or Command+V to paste the copied XML templates into the OPENRNDR group.
  8. Close the settings window

Now,

  1. Navigate into src/main/kotlin on the left panel
  2. Create a file called (plotting01.kt for instance)
  3. type ora and press the TAB key

It should get expanded into the following:

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

To start writing a new program from scratch, repeat the last three steps.

edit on GitHub