Is there any way to convert all spaces to tabs, not file by file?
If I open a file and go through View => Indentation => Convert Indentation to Tabs
, it only changes this file. I want to convert indentations to tabs in a whole project.
Is there any way to convert all spaces to tabs, not file by file?
If I open a file and go through View => Indentation => Convert Indentation to Tabs
, it only changes this file. I want to convert indentations to tabs in a whole project.
Use search and replace in multiple files to convert n
spaces to tabs in select files.
First open find in files panel, cmd + shift + f, by default to find and replace in multiple files. Next define a regular expression to match spaces as tabs eg {4}
(make sure you set Regular Expressions in the panel) for 4 spaces and replace with \t
in desired files. Change {4}
to however many spaces are being used for indentation.
As mentioned in comments to match spaces at the start of a line you can use the regexp ^( {4})+
*.{js,txt}
(for instance) in the where which will only include javascript and text files. Probably should of mentioned save all in the answer good point
– megawac
Apr 13 '14 at 18:09
\t
and replace with two spaces
– cabgfx
Feb 17 '15 at 12:39