Smart Wrap in Vim

后端 未结 8 1463
离开以前
离开以前 2020-12-02 06:28

I have been wondering if Vim has the capability to smart wrap lines of code, so that it keeps the same indentation as the line that it is indenting. I have noticed it on som

相关标签:
8条回答
  • 2020-12-02 07:05
    :set smartindent
    :set autoindent
    

    I think you still have to use a return though

    0 讨论(0)
  • 2020-12-02 07:07

    I don't think it's possible to have exactly the same indentation, but you can still get a better view by setting the 'showbreak' option.

    :set showbreak=>>>
    

    Example:

    <p>
        <a href="http://www.example.com">
            This is a bogus link, used to demonstrate
    >>>an example
        </a>
    </p>
    

    The real thing looks better than the example code above, because Vim uses a different colour for '>>>'.

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