Reputation: 36638
I have a SCSS file I am currently working on. The indentation is 4 spaces, but for some reason PHPStorm only moves the cursor 2 spaces every time I tab. Is there a way to change this? Strange thing is I have other files in the project (mostly JS) and they are tabbed 4 spaces.
Upvotes: 43
Views: 48246
Reputation: 165108
Settings/Preferences
Editor | Code Style
If you are using the actual Tab
symbol for intents then you will see the changes straight away. But if you use Space
then you will need to invoke Code | Reformat Code
(or similar Code | Reformat File...
) to see the changes in the indents.
In case if you have changed the settings in Code Style but still see the old/different settings being applied: check if you have .editorconfig
file(s) in your project and EditorConfig is enabled (by default).
The settings from such a file will overwrite your Code Style settings (it's expected as it's the nature of such files). In this case you will need to edit your .editorconfig
file (or disable EditorConfig integration).
P.S. I prefer setting the basic settings (like indent size, indent symbol etc) in the .editorconfig
file. It's portable, flexible, and allows setting up different settings for files that do not have dedicated Code Style settings in the IDE.
Upvotes: 70
Reputation: 131
After applying the settings, the tab will not apply right away. For this to work you have to Code -> Reformat Code
Upvotes: 10