sublime text帮你更好的写python

在Google的Python风格指南中,有这样的要求:

用4个空格来缩进代码

但是每次在敲代码的时候,用一个tab确实比敲四次空格方便的多。令人欣慰的是sublime text 2能够把tab转换成4个空格。具体的设置就是:

在Preference-defalut中能找到这样的两句话:

    // The number of spaces a tab is considered equal to
    "tab_size": 4,

    // Set to true to insert spaces when tab is pressed
    "translate_tabs_to_spaces": false,

一个tab等于四个空格,同时把tabs_to_spaces的开关置为true。

    // The number of spaces a tab is considered equal to
    "tab_size": 4,

    // Set to true to insert spaces when tab is pressed
    "translate_tabs_to_spaces": true

sublime text的默认是:当你在代码中键入 冒号: 的时候,他会自动在下一行缩进一个tab。设置成功以后,缩进的就是四个空格了。  

原文地址:https://www.cnblogs.com/stemon/p/5100174.html