For some reason intelliJ doesn’t let you import code style guides.
Like the Java one I wanted to use from Google.
https://github.com/google/styleguide
To import the style guide (intellij-java-google-style.xml) after cloning the repository, to this.
> cd ~/Library/Preferences/IntelliJIdeaXX
> mkdir codestyles
> cp /intellij-java-google-style.xml .
Fire up intelliJ, goto preferences, search for Coding Style, and you should see Google Coding style there.
Links that help
Jan 11, 2016 @ 16:15:25
Your instructions are off slightly. They should say this:
> cd ~/Library/Preferences/IntelliJIdeaXX
> mkdir codestyles
> cd codestyles # cp /intellij-java-google-style.xml .
Jan 11, 2016 @ 16:16:20
Try this again:
> cd ~/Library/Preferences/IntelliJIdeaXX
> mkdir codestyles
> cd codestyles
> cp /intellij-java-google-style.xml .
Jan 20, 2016 @ 13:13:29
Under Windows for e.g. IntelliJ IDEA 15, the directory would be ~\.IntelliJIdea15\config\codestyles (where ~ is the home directory of the user, like e.g. C:\Users\ThomasWeitzel).
Thank you for your post!
Feb 03, 2016 @ 20:22:19
Thanks for the post. It helped
Feb 24, 2016 @ 05:45:17
I am unable to see google code style option in the list after following the steps mentioned.I am using IntelliJ 15. Is there any additional config?
Aug 03, 2016 @ 16:50:06
I think it works after copying the right file in the codestyles subfolder. The reason it may not be working is if you “saved” the styles xml from GitHub web UI, then the file that gets saved is an html and Intellij silently ignores it. I know, a human error, but Intellij is just silent about it (not showing the googlestyle in the dropdown). The best thing is to clone the google styleguide GitHub repo and copy the xml from there.
Aug 04, 2016 @ 04:20:36
Awesome. Thank you Kedarmhaswade.
Mar 14, 2017 @ 20:26:05
None of this works
I don’t see “Google Style” or “Intellij Idea code style XML” as options to import
Sep 12, 2016 @ 20:19:08
IntelliJ 2016 can import style guides directly. Open Preferences…, drill down to Editor > Code Style > Java, click Manage…, click Import…, choose IntelliJ IDEA code style XML, click OK, and select the style xml you want to import.
Sep 13, 2016 @ 14:20:15
Awesome. Thanks Zeo.