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?
How to replace all tab characters in a file by sequences of white-spaces in intellij?
Asked Answered
Go to Edit | Convert Indents , and then choose To Spaces or To Tabs respectively. It's in the documentation: Changing identation
Do you think it's possible to replace tabs with spaces in all files of a project? When I close all my files, the options To Spaces and To Tabs become inactive –
Headrick
Note that this only converts the tabs at the start of a line. Tabs in the middle of a line (between other text) are not touched. –
Vip
Replace only tabs used for indentation
Replace all tabs
Note that your search and replace (ctrl-r) will always convert a tab to a fixed number of spaces. It does not do a tabulation where you can line things up from one line to the next by using a tab. The indention trick, however, does indeed line things up. –
Samalla
Replace
Ctrl
with Cmd
for Mac and works on IntelliJ 2018.3 –
Prothesis It seems clion is lacking in this area a bit. While it's true that using a regex conversion doesn't keep things aligned properly, it appears to be the ONLY way to ensure there are no tabs left in the file. –
Anywheres
© 2022 - 2024 — McMap. All rights reserved.