Indenting code in Sublime text 2?

后端 未结 20 2259
没有蜡笔的小新
没有蜡笔的小新 2020-11-28 17:19

In Visual Studio I can press Ctrl+K+D to indent everything so the code is structured nicely and readable. Is there a shortcut in Sublime 2 t

相关标签:
20条回答
  • 2020-11-28 17:40

    Netbeans like Shortcut Key

    Go to Preferences > Key Bindings > User and add the code below:

    [
        { "keys": ["ctrl+shift+f"], "command": "reindent", "args": {"single_line": false} }
    ]
    

    Usage

    Ctrl + Shift + F

    0 讨论(0)
  • 2020-11-28 17:40

    I used to use Alt + Shift + F in NetBeans, I checked and there isn't any collision in the default keymap array of sublime, so I added it to my sublime and I'm using it without any problem.

    0 讨论(0)
  • 2020-11-28 17:41

    Select everything, or whatever you want to re-indent and do Alt+ E+L+R. This is really quick and painless.

    0 讨论(0)
  • 2020-11-28 17:44

    It is very simple. Just go to Edit=>Line=>Reindent

    0 讨论(0)
  • 2020-11-28 17:45

    Select all code that you intend to indent, then hit Ctrl + ] in Sublime text to indent.

    For macOS users, use command + ] to indent, and command + [ to un-indent.

    0 讨论(0)
  • 2020-11-28 17:45

    This is my configuration for sublime-keymap:

    [
      {
        "keys": [",+=+="],
        "command": "reindent",
        "args": {
          "single_line": false
        }
      }
    ]
    

    For vim people, just use ,== to reindent the whole file.

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