If you need to adjust indentation settings, in the Settings/Preferences dialog ( Ctrl+Alt+S ), go to Editor | Code Style. On the appropriate language page, on the Tabs and Indents tab, specify the appropriate indents options and click OK.
Open files in the preview taband select the Enable Preview Tab option. You can also enable the preview tab in Settings/Preferences | General | Editor Tabs | Opening Policy.
Only for the current fileIf you want to convert tabs to spaces, you can write "spaces", then choose "To Spaces". To convert tabs to spaces, you can chose "To Spaces" from the same place.
These are common Indent and Unindent actions, default shortcuts: Tab and Shift + Tab .
File > Settings > Editor > Code Style > Java > Tabs and Indents > Use tab character
Substitute weapon of choice for Java as required.
You have the following options:
Ctrl + Shift + A > write "tabs" > double click on "To Tabs"
If you want to convert tabs to spaces, you can write "spaces", then choose "To Spaces".
Edit > Convert Indents > To Tabs
To convert tabs to spaces, you can chose "To Spaces" from the same place.
The paths in the other answers were changed a little:
It seems that it doesn't matter if you check/uncheck the box from Settings... or from Other Settings > Default Settings..., because the change from one window will be available in the other window.
The changes above will be applied for the new files, but if you want to change spaces to tabs in an existing file, then you should format the file by pressing Ctrl + Alt + L.
I have started using IntelliJ IDEA Community Edition version 12.1.3 and I found the setting in the following place: -
File > Other Settings > Default Settings > {choose from Code Style dropdown}
For anyone not able to get this, another thing you need to uncheck the following as well
Preferences > Editor > Code Style
[] Enable EditorConfig support
EditorConfig may override the IDE code style settings
My IntelliJ version 15.0.4
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With