How to replace four spaces with a tab in Sublime Text 2?

后端 未结 8 2369
陌清茗
陌清茗 2020-12-12 09:07

\"enter

I want to replace all the \"four spaces\" that is written by another text edit

相关标签:
8条回答
  • 2020-12-12 09:30

    create a keybinding for quickest way

    { "keys": ["super+alt+t"], "command": "unexpand_tabs", "args": { "set_translate_tabs": true } }

    add this to Preferences > Key Bindings (user) when you press super+alt+t it will convert spaces to tabs

    0 讨论(0)
  • 2020-12-12 09:32

    Select all, then:

    Windows / Linux:

    Ctrl+Shift+p

    then type "indent"


    Mac:

    Shift+Command+p

    then type "indent"

    0 讨论(0)
  • 2020-12-12 09:37

    On main menu;

    View -> Indentation -> Convert Indentation to Tabs / Spaces

    0 讨论(0)
  • 2020-12-12 09:38

    You could add easy key binding:

    Preference > Key binding - user :

    [
        { "keys": ["super+l"], "command": "reindent"},
    ]
    

    Now select the line or file and hit: command + l

    0 讨论(0)
  • 2020-12-12 09:41

    To configure Sublime to always use tabs try the adding the following to preferences->settings-user:

    {
        "tab_size": 4,
        "translate_tabs_to_spaces": false
    }
    

    More information here: http://www.sublimetext.com/docs/2/indentation.html

    0 讨论(0)
  • 2020-12-12 09:48

    Bottom right hand corner on the status bar, click Spaces: N (or Tab Width: N, where N is an integer), ensure it says Tab Width: 4 for converting from four spaces, and then select Convert Indentation to Tabs from the contextual menu that will appear from the initial click.

    Similarly, if you want to do the opposite, click the Spaces or Tab Width text on the status bar and select from the same menu.

    enter image description hereenter image description here

    0 讨论(0)
提交回复
热议问题