2012-08-27 46 views
4

我使用Sublime Text並希望JavaScript文件使用三個空格作爲indentaiton。sublimetext中的默認縮進

我設置在Packages/User/Preferences.sublime-settings

{ 
    "tab_size": 3, 
    "translate_tabs_to_spaces": true 
} 

,但它有沒有影響,我需要手動更改爲每個新文件。

回答

8

當你有一個JavaScript文件打開做到以下幾點:

每語法設置

設置可以在每個語法的基礎上確定。您可以使用首選項/設置 - More/Syntax Specific - User菜單編輯當前語法的 設置。

這將允許您爲當前語法設置自定義首選項。有關縮進的詳細信息,請訪問:http://www.sublimetext.com/docs/2/indentation.html

+1

如果您使用的標準JavaScript選項卡是4空格策略,您可能還希望從文件內容中禁用自動檢測選項卡大小。自動檢測也會覆蓋當前設置http://opensourcehacker.com/2012/05/11/sublime-text-2-tips-for-python-and-web-developers/#Configure_sane_tab_and_whitespace_policy_and_other_settings –