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

Intellij IdeaIndentationCode Formatting

Intellij Idea Problem Overview


Given a file in my project, I want to be able to replace all of the tab characters in the file with white spaces. Is there any way to do this in intellij?

Intellij Idea Solutions


Solution 1 - Intellij Idea

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

Solution 2 - Intellij Idea

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

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionJeremy WView Question on Stackoverflow
Solution 1 - Intellij IdeaVasile JureschiView Answer on Stackoverflow
Solution 2 - Intellij IdeaROMANIA_engineerView Answer on Stackoverflow