Reputation: 4403
I have the following problem.
I use ubuntu 12.04 and sublime-text-2 or gedit.
Sometimes i copy/paste something in a haml/ruby file, i indent it at 2 spaces, but when i push it up to github, the indentation is all wrong and not only the part I've copy/pasted. In my editor looks good.
If I open the file with LibreOffice/LeafPad the identation is like on github, but i wanna have it working on ST2.
Any suggestions?
Upvotes: 7
Views: 14876
Reputation: 83768
To have correct indent across the service you should not use hard tabs
http://opensourcehacker.com/2012/05/13/never-use-hard-tabs/
You can achieve this functionality in Sublime Text 2 with a tab policy setting:
Also not that you might need to choose new policy for existing files from View > Indentation menu.
You can also mass-convert existing files away from tabs.
With Sublime Text 2:
... or batch convert the whole project:
http://miohtama.github.com/vvv/tools/expandtabs.html
Upvotes: 6