title: Break line on each tag attribute and keep them aligned in Visual Studio HTML code editor
body: <h2>If you'd like to see this implemented in the next version of VS, please vote for it <a href="http://visualstudio.uservoice.com/forums/121579-visual-studio/suggestions/3657691-break-line-on-each-tag-attribute-and-keep-them-ali" rel="noreferrer">here</a>.</h2>
  
  <hr>
  
  <p>Suppose the following horizontally lengthy <code>&lt;button&gt;</code> <code>HTML</code> declaration:</p>
  
  <pre><code>&lt;button type="submit" class="btn btn-primary" id="save" name="action:@ViewContext.RouteData.Values["action"]"&gt;&lt;i class="icon-save icon-large"&gt;&lt;/i&gt; @Localization.Save&lt;/button&gt;
  </code></pre>
  
  <p>As you see all tag attributes are inline such that they extend a long way to right in the code editor...</p>
  
  <p>Do you know of any Visual Studio option or extension that allows it to be formatted with <kbd>Ctrl</kbd> + <kbd>K</kbd> then <KBD>Ctrl</KBD> + <KBD>F</KBD> like this:</p>
  
  <pre><code>&lt;button type="submit"
          class="btn btn-primary"
          id="save"
          name="action:@ViewContext.RouteData.Values["action"]"&gt;
  &lt;i class="icon-save icon-large"&gt;&lt;/i&gt;@Localization.Save
  &lt;/button&gt;
  </code></pre>
  
  <p>I think the above format makes it easy to spot a given attribute although it'll clearly make the vertical scroll-bar a little longer. :)</p>
  
  <p>I tried fiddling with Visual Studio options in <code>TOOLS =&gt; Options... =&gt; Text Editor =&gt; HTML</code> but didn't find an option to control this behavior.</p>
  
  <p>Of course I can align it manually but then if I hit <kbd>Ctrl</kbd> + <kbd>K</kbd> then <KBD>Ctrl</KBD> + <KBD>F</KBD> by mistake I lose all the custom made formatting.</p>
  
  <p>If there's no such a thing available, I think this makes a great idea for a Visual Studio extension. As a plus it could even alphabetically order the attributes. :)</p>
  
  <hr>
  
  <p>Doing a little bit more Googling I found that the <code>XAML</code> editor in Visual Studio has what I'd like to have in the HTML editor:</p>
  
  <p><a href="http://msdn.microsoft.com/en-us/library/bb763100.aspx" rel="noreferrer">Position each attribute on a separate line</a></p>
  
  <p><img src="https://i.stack.imgur.com/O4raF.png" alt="enter image description here"></p>
  
  <hr>
  
  <p>I asked this same question at the Visual Studio Extensibility forum:</p>
  
  <p><a href="http://social.msdn.microsoft.com/Forums/en-US/vsx/thread/0d97c205-9f29-4ba7-9d0b-253413077dce/" rel="noreferrer">http://social.msdn.microsoft.com/Forums/en-US/vsx/thread/0d97c205-9f29-4ba7-9d0b-253413077dce/</a></p>
  
  <hr>
  
  <h2>If you'd like to see this implemented in the next version of VS, please vote for it <a href="http://visualstudio.uservoice.com/forums/121579-visual-studio/suggestions/3657691-break-line-on-each-tag-attribute-and-keep-them-ali" rel="noreferrer">here</a>.</h2>