Question

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.

Was it helpful?

Solution

Highlight all the lines that need to be indented and just press TAB or shift + TAB as needed. In particular, in your example, highlight everything from the second before block to third end from the end. You could also try to highlight all lines and choose Edit -> Lines -> Reindent from the menur bar, thought I've had mixed results with that.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top