2

Does anyone know what settings or package I can use to make vim autoindent html if it's wider that the screen. eg. it is displaying like this:

<main>
  <section>
    <form action="#">
      <input type="text" class="someclassname" id="someid" value="foo" 
placeholder="" data-foo="foo" data-bar="bar" />
    </form>
  </section>
</main>

I would like it to indent the broken line like this:

<main>
  <section>
    <form action="#">
      <input type="text" class="someclassname" id="someid" value="foo" 
        placeholder="" data-foo="foo" data-bar="bar" />
    </form>
  </section>
</main>

or even this:

<main>
  <section>
    <form action="#">
      <input type="text" 
        class="someclassname" 
        id="someid" value="foo" 
        placeholder="enter something" 
        data-foo="foo" 
        data-bar="bar" />
    </form>
  </section>
</main>

Cheers

0

1 Answer 1

3

Short Answer: set breakindent

Long Answer: https://stackoverflow.com/questions/1204149/smart-wrap-in-vim

1
  • Thank you, I have been looking for that setting for a couple of weeks now. it was my stay with vim or go back to php storm clincher.
    – synthet1c
    Commented Mar 20, 2017 at 6:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.