Skip to content

Instantly share code, notes, and snippets.

@gcnit
Created May 31, 2021 21:27
Show Gist options
  • Save gcnit/c93c41d0e531bb66672bd24420dde986 to your computer and use it in GitHub Desktop.
Save gcnit/c93c41d0e531bb66672bd24420dde986 to your computer and use it in GitHub Desktop.
Add Google Style Guide to Intellij

The google-java-format plugin is the preferred way to format the code. As it only kicks in on demand, it’s also recommended to have code style settings which help to create properly formatted code as-you-go. Those settings can’t completely mimic the format enforced by the google-java-format plugin but try to be as close as possible. So before submitting code, please make sure to run Reformat Code.

  • Download intellij-java-google-style.xml.
  • Open Intellij
  • Go to File → Settings → Editor → Code Style.
  • Click on Manage.
  • Click on Import.
  • Choose IntelliJ IDEA Code Style XML.
  • Select the previously downloaded file intellij-java-google-style.xml.
  • Make sure that Google Style is chosen as Scheme.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment