Line break within HTML tags in Visual Studio Code

Asked

Viewed 11,445 times

2

How to enable line breaking within tags HTML to look like this?

<input 
      class="someClass"
      id="someId"
      name="someName"
      ng-model="vm.model"
      ng-click="vm.someAction()"/>

When format the text in Visual Code (Alt+Shift+F) it leaves the HTML tags this way:

<input class="someClass" id="someId" name="someName" value="someValue" ng-model="vm.model" ng-click="vm.someAction"/>

It removes all line breaks that I had inserted. In Netbeans I don’t have this problem. I already changed the Code settings, downloaded extensions and nothing works.

  • B. Maríclio > Referring to the break of lines in question of > HTML, is not "good use" do this with the text tag "code". Therefore Visual Code Studio breaks the way you’re talking. >If you notice, every programming language you > make in Visual Code it breaks the lines according to the "good use > of the code".

1 answer

2

This functionality is really missing in Visual Studio Code and, if it already exists, I haven’t found it in the shortcuts.

But to enable breaking lines in the same hand you will in Files > Preferences > Settings, then in the module Publisher, you search for editor.wordWrap who will be off just change to on.

quebra de linhas automaticamente Visual Code

This change will run line breaks automatically.

  • 1

    Thanks for the tip friend. But I found a very good pluggin, the Beaultify https://marketplace.visualstudio.com/items?itemName=HookyQR.beautify

  • Thanks for the tip friend. But I found a very good pluggin, the Beaultify https://marketplace.visualstudio.com/items?itemName=HookyQR.beautify

Browser other questions tagged

You are not signed in. Login or sign up in order to post.