Search code examples
sublimetext2sublimetext3sublimetextsublime-text-plugin

Indent subsequent lines without hanging indent


In Sublime, long lines are wrapped using hanging indent (also known as "reverse indent"). Example:

(I use "word_wrap": "true" in my settings).

enter image description here

Is there way to make long lines wrap without this hanging indentation, i.e. like in Brackets:enter image description here


Solution

  • From my observations, ST always adds one indentation level to lines that were wrapped, if the base scope begins with source. (If indent_subsequent_lines is set to true, ST will indent subsequent word wrapped lines to the level of the line being wrapped and then add the extra level of indentation.)

    It seems there is no way to disable hanging indentation in ST for source code. Indeed, this behavior can cause text to be unviewable if it is indented further than the window width - https://github.com/SublimeTextIssues/Core/issues/286.

    It might be worth logging an issue at https://github.com/SublimeTextIssues/Core/issues to ask the ST devs to consider making an option to disable the hanging indentation.