Last Updated
Viewed 960,151 Times

I've got some poorly-formatted HTML code that I'd like to reformat. Is there a command that will automatically reformat HTML code in Sublime Text 2 so it looks better and is easier to read?

Is there a way to force Sublime Text 2 to always indent two spaces per tab when working with Ruby files?

I know that indentation can be set under the view -> indentation menu option, but it does not stick. Every time I open a new file and hit tab, it reverts back to four spaces.

I searched all over the web to find how to execute a sublime text command for all files and then save. I need to refactor my old project that has indentation issues like hard tabs.

What I want is to execute the command "expand_tabs" to the whole project. How can I do it?

Similar Question 3 : Indent lines in sublime text 2

I'm working with ruby on rails, and I have a quite large step testing a multistep process. So now one step changed from the last step to second step in the process, now because all describe blocks must be closed I'm in a bit trouble.

My question is, how can I indent n number of lines with 2 spaces, what's the quickest/best way with sublimte text 2? Or lines starting to line x until line y, and indent it by 2 blank spaces?

For ex:

describe 'test 1' do
  before do 
  end

  it 'should something' do
  end
  describe 'test withhin test' do
    before do 
    end

    it 'should something else' do
    end
    describe 'other other' do
      before do
      end

      it 'should sth' do
      end
    end
  end
end

If this was a huge file how can I indent just this part by 2 spaces :

describe 'other other' do
  before do
  end

  it 'should sth' do
  end
end

More details

I don't want to tab the space, by indent by 2 spaces. 2 spaces is merely an example, I might need to move it more than 2 spaces, where tab cannot help me.

Similar Question 4 (1 solutions) : Show indent size of 4 in sublime text

Similar Question 7 (1 solutions) : Pasting code in SublimeText2 uses odd indentation

Similar Question 8 (1 solutions) : How does Word Wrap work in SublimeText?

cc