21

I look around for the preferences in TextMate and there seems to be no method to set the indent to 2 spaces when we highlight some code and choose

Text -> Shift Right

Right now it is indenting 4 spaces but is there a way to make it 2?

nonopolarity
  • 146,324
  • 131
  • 460
  • 740

2 Answers2

41

It's on the bottom bar off the application towards the middle. It'll say something like 'Soft Tabs: 4' if you click it you can change it to do 2 spaces for tabs.

Justin
  • 4,434
  • 4
  • 28
  • 37
  • if it is changed to 2, and then "Text -> Shift Right" is used on highlighted text, then a tab is actually inserted for each line... it shows as 2 spaces, but the compiler for HAML will complain that it is tab instead of space. – nonopolarity Jun 02 '10 at 20:47
  • you may want to look into using the `expand` command in the terminal for your compiler. – Jon W Jun 02 '10 at 22:17
  • 2
    @ Jian Lin When you select the the little drop down to set the tab size (it either says `Soft Tabs: 4` or `Tab Size: 4`) ensure that there is a check at the bottom where it says `Soft Tabs (Spaces)` this will use spaces for indentation and tabs. – Justin Jun 02 '10 at 22:35
  • Did this fix the issue for you? – Justin Jun 03 '10 at 19:34
  • 1
    yes i think so... just that at first, when i click "right arrow" there after soft tab is inserted, it moved 2 spaces by 2 spaces, making me thinking that it is not space but was a tab that was inserted... i had to copy and paste that code to another text editor to verify that it was 2 spaces. – nonopolarity Jun 04 '10 at 05:23
2

Also you can edit multiple lines by holding Option and dragging your mouse along the spot in the lines. When you type, the text will be on all the lines you selected at that spot.

Jon W
  • 15,480
  • 6
  • 37
  • 47