Replacing Tabs with Spaces in Aptana (Soft Tabs)

AptanaUPDATE: It turned out that soft tabs won't work without first adding Haml syntax highlighting to Aptana.

While using Haml in Aptana, I had a problem with line indentation. Since Haml uses space indentation to represent the HTML structure (two spaces for each level), indenting multiple lines with the "tab" characters would result in Haml errors. I tried to search for the word "tab" in Aptana's "Preferences" window but didn't find what I wanted. Here is how to enforce Aptana to replace tabs with regular spaces (soft tabs).

  1. From Aptana "Window" menu, select "Preferences..."
  2. In the the preferences window, select "Aptana" > "Editors"
  3. In the "General" tab of the "Editors" window, select "Use spaces" under "Tab Insertion"
  4. Click the "edit" link besides the "Use spaces" option to open the general "Text Editors" window
  5. In the "Text Editors" window, set the "Displayed tab width" to "2"
  6. Press "OK"
  7. Enjoy two-spaces tabs

Did you like this article? Bookmark it:

Related Articles

3 Comments

  • This doesn't work for me. I'm trying to edit a .haml file and tab still makes an actual tab.

  • I had the same issue. Turns out it depends which editor Aptana opens the file with was the issue. What i did to fix it: Preferences -> General -> Editors -> File Associations Add *.haml (and any others you want) to the File Types list. Then select the one you added and add an Associated Editor underneath, I added the 'Aptana HTML Editor'. Then when you open that file in Aptana it uses that Editor rather than default editor, then the Soft Tab Settings worked correctly for me. Might work using the Text Editor, or by setting your Default Editor but haven't tried that. Hope that helps.

  • Thanks Simon, this worked for me. However, a better solution is to add Haml syntax highlighting to Aptana as I described in this post.

Leave a Comment

If you want to post code, do this:
<pre><code class="ruby|javascript|css|html"> your code here </code></pre>