How to fix/convert space indentation in Sublime Text?

后端 未结 9 1212
梦谈多话
梦谈多话 2020-11-30 15:59

Example: If I have a document with 2 space indentation, and I want it to have 4 space indentation, how do I automatically convert it by using the Sublime Text editor?

9条回答
  •  夕颜
    夕颜 (楼主)
    2020-11-30 16:56

    I found, in my mind, a simpler solution than Magne:

    On mac:

    "cmd+f" => "  "(two spaces) => "alt+enter" => "arrow right" => "  "(two more spaces) => set tab width to 4(this can be done before or after.
    

    On windows or other platforms change cmd+f and alt+enter with whatever your find and select all hotkeys are.

    Note: this method is prone to "errors" if you have more than one space within your code. It is thus less safe than Magne's method, but it is faster (for me at least).

提交回复
热议问题