How to replace all tab characters in a file by sequences of white-spaces in intellij?

Solution 1:

Go to Edit | Convert Indents , and then choose To Spaces or To Tabs respectively. It's in the documentation: Changing identation

Solution 2:

Replace only tabs used for indentation

  • Ctrl + Shift + A
  • type "To Spaces" > Enter

    To Spaces

Replace all tabs

  • Ctrl + R
  • check Regex
  • Enter \t and spaces
  • Replace all

    Replace tab with 4 spaces