5 ms·
As a python programmer, these were the first two settings I configured after installing Sublime Text. "tab_size": 2, "translate_tabs_to_spaces": true
by feniv 14y ago
As a python programmer, these were the first two settings I configured after installing Sublime Text.
"tab_size": 2,
"translate_tabs_to_spaces": true
You can either set them as Preferences > Settings - Default or Settings - Syntax specific
- natrius 14y agoUh, two space indentation in Python? Consistency is valuable. Everyone else who writes Python uses four spaces. http://www.python.org/dev/peps/pep-0008/#indentation http://www.python.org/dev/peps/pep-0008/#indentation
- tass 14y agoThis is a great reason to use tabs over spaces.
- buttscicles 14y agoIt wouldn't matter when people don't adhere to standards anyway.
- ketralnis 14y agoThat everybody else uses spaces?
- yen223 14y agoIf the file uses tabs, at least you can choose to display the indentations as 2 spaces or 4 spaces. If the file uses spaces, you don't get to choose.
- SquareWheel 14y agoThis is my reason for preferring tabs. Plus changing indent levels is faster via arrow keys.
- charliesome 14y agoAny reasonable editor can be configured to jump multiple spaces at a time.
- Tloewald 14y agoThe main reason for preferring spaces is wrapping complex calls split across lines. (Of which there is a lot in some languages such as obj-c or JavaScript.) We just went through the whole tabs vs spaces debate on a new project here with, I think, open minds and a general preference for tabs, and ended up using spaces. The alternative was tabs for basic indentation and spaces for line wrapping but that's too hard to maintain. YMMV
- kstrauser 14y agoAnd even faster using tab or shift+tab to pop up or down a level, regardless of whether you're using tabs or spaces.
- SquareWheel 14y agoI do this too, along with Home/End to navigate. Once in a while though I want to move only half way left of the indent, which is one press on tab, 2-4 of space. Can't use ctrl+left there. But more than anything I'm sure it's just familiarity.
- feniv 14y agoI got comfortable with 2 spaces over 4-space tab since it was the accepted coding standard for Ruby at my previous job. The habit carried over to Python and I now find it more succinct and clear.