Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Code style per project in Intellij Idea

I have to develop several Java projects with different code styles at the same time. How to configure in Intellij Idea code style per project?

Thanks

like image 570
olegtarapata Avatar asked Apr 05 '17 13:04

olegtarapata


People also ask

How do I fix code style in IntelliJ?

In the editor, select a code fragment you want to reformat. Before reformatting, you can take a look at the code style settings that are applied to the selected code: press Alt+Enter and click Adjust code style settings. From the main menu, select Code | Reformat Code or press Ctrl+Alt+L .

What is IntelliJ code style?

Code style scheme settings are automatically applied every time IntelliJ IDEA generates, refactors, or reformats your code. The IDE comes with two pre-defined schemes: the Project scheme and the Default scheme. In the Project scheme, the settings that you configure apply only to your current project.

How can I beautify code in IntelliJ?

Sometimes code formatting can get out of sync, but there's an easy fix in IntelliJ IDEA. You can use ⌘⌥L (macOS), or Ctrl+Alt+L (Windows/Linux) to reformat a selection of code according to your reformat settings. You can also display the Reformat File dialog with ⌥⇧⌘L (macOS), or Ctrl+Alt+Shift+L (Windows/Linux).

How do I structure a project in IntelliJ?

You can configure project structure settings not only for the current project, but for all projects that you will be creating later. This means that you can set the new default structure for your projects. From the main menu, select File | New Projects Setup | Structure.


1 Answers

If you go to the Preferences -> Editor -> Code Style, there is a combo box at the top to choose to apply code style settings to the Project only, or at the global level.

enter image description here

like image 154
Saša Šijak Avatar answered Oct 16 '22 10:10

Saša Šijak