0

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.

Remember_me
  • 223
  • 4
  • 18
  • Mark all the lines you want to indent and press **Tab**. – Holger Just May 09 '14 at 12:50
  • @Holger Just I want to indent by two spaces, it's not same as tab. or configuring the tab to be 2 spaces – Remember_me May 09 '14 at 13:14
  • @downvoter, care to elaborate the downvote? – Remember_me May 09 '14 at 13:15
  • In Ruby (and thus Rails too) it is the generally accepted convention ti use only two spaces as indentation, never actual tabs. Thus, you should have configured sublime to indent with that format. And then, the Tab key magically does the right thing :) – Holger Just May 09 '14 at 15:07
  • @Remember_me See this question for configuring indentation: http://stackoverflow.com/questions/9474090/how-do-i-force-sublime-text-2-to-indent-two-spaces-per-tab – Mohamad Jan 03 '15 at 20:05

1 Answers1

0

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.

Philipp Antar
  • 182
  • 3
  • 11