How to replace all tab characters in a file by seq

2020-05-15 08:28发布

问题:

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?

回答1:

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



回答2:

Replace only tabs used for indentation

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

Replace all tabs

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