Custom Postfix Templates

Compatible with: IntelliJ IDEA Android Studio
Jan 13, 2018
1 564
Documentation | Screencast | Predefined templates

This plugin allows you to define your own postfix templates for Java, Scala, Kotlin, and JavaScript. It comes with a set of predefined templates which can be edited and extended, e.g.:
  • string.toInt → Integer.parse(string)
  • longValue.toInt → ((int) longValue)
  • array.toList → Arrays.asList(array)

Download plugin

Recent change notes

Version 1.5.0
  • Added full support for Scala (typed templates).

General usage instructions

Go to Tools → Custom Postfix Templates and write your own postfix templates for your code or just the predefined ones to simplify your life. For instance, write "array.toList" and see how it gets replaced by "Arrays.asList(array)". Other predefined but editable templates are: toByte, toChar, toInt, toLong, toFloat, toDouble ● toList, toSet, toMap ● sort, sortBy, minBy, maxBy, groupBy ● exists, forall ● reverse, concat ● Optional.forEach ● String.r