Last Updated: November 02, 2018
·
32.74K
· 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

I just ran into this problem minutes ago. Thanks!

over 1 year ago ·

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

over 1 year ago ·

<3

over 1 year ago ·

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

Thanks :)

over 1 year ago ·

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 ·

That package is magic! Thanks for sharing.

over 1 year ago ·

Neat package @robcolbert

over 1 year ago ·

perfect! thanks.

+1 for 'four fucking spaces'

over 1 year ago ·

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

over 1 year ago ·

I thought this was common knowledge

over 1 year ago ·

great solution!!!!!!!

over 1 year ago ·

Awesome, thanks! :)

over 1 year ago ·

Brilliant solution!

over 1 year ago ·

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

over 1 year ago ·

Nice ! :)

over 1 year ago ·