a0mghg
Last Updated: November 02, 2018
·
23.79K
· tessa-lt

Convert 4 spaces to 2 in Sublime Text

Assuming you have the following settings in Sublime:

"tab_size": 2,
"translate_tabs_to_spaces": true,

If you get a file indented with 4 fucking spaces:

  1. Select all
  2. View > Indentation > tab width: 4
  3. View > Indentation > convert indentation to tabs
  4. View > Indentation > tab width: 2
  5. View > Indentation > convert indentation to spaces

If you get a file indented with 2 fucking tabs, just skip step 2.

15 Responses
Add your response

8989

I just ran into this problem minutes ago. Thanks!

over 1 year ago ·
13414

I just used this, but to convert from 2 to 4 ;)

over 1 year ago ·
15074

<3

over 1 year ago ·
16015

Or if you get a file indented with 2 fucking spaces, just go through the steps backwards.

Thanks :)

over 1 year ago ·
16090

Or, using the HTML/CSS/JS Prettify package, just press Cmd+Shift+H and poof! Fuck your fucking settings - the file is however I want it, now :)

over 1 year ago ·
16271

That package is magic! Thanks for sharing.

over 1 year ago ·
17117

Neat package @robcolbert

over 1 year ago ·
17287

perfect! thanks.

+1 for 'four fucking spaces'

over 1 year ago ·
18168

You are a fucking genius. A god!!!! Also, thank you.

over 1 year ago ·
20126

I thought this was common knowledge

over 1 year ago ·
21264

great solution!!!!!!!

over 1 year ago ·
22648

Awesome, thanks! :)

over 1 year ago ·
28349

Brilliant solution!

over 1 year ago ·
29164

nice... lols on "indented with 2 fucking tabs" ;)

over 1 year ago ·
31131

Nice ! :)

about 1 month ago ·