Example: If I have a document with 2 space indentation, and I want it to have 4 space indentation, how do I automatically convert it by using the Sublime Text editor?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Here’s a neat trick in Sublime Text 2 or 3 to convert your indentation spacing in a document.
TL;DR:
Converting from 2 spaces to 4 spaces:
Ensure tab width is set to 2. Convert your 2-space indentation to tabs, switch to tab width 4, and then convert the indentation back to spaces.
The detailed description:
Go to:
View -> IndentationIt should read:
Indent using spaces [x]Tab width: 2Select:
Convert Indentation to TabsThen Select:
Tab width: 4Convert Indentation to SpacesDone.