Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to format "one line html" as a pretty document in sublime? [duplicate]

Tags:

sublimetext3

I have a html source file containing only one line like the following:

<html><head>test</head><body>wow</body></html>

, and I want to format it as following:

<html>
    <head>
        test
    </head>
    <body>
        wow
    </body>
</html>

, I have used the command: Edit-> Line-> Reindent but it doesn't work.

like image 569
remykits Avatar asked Feb 28 '13 08:02

remykits


1 Answers

In Sublime Text try this:

  1. Highlight the last character in the first tag: ">"
  2. Use Find > Quick Add Next (Command+D on Mac or Ctrl+D on PC)

You'll now have all occurrences highlighted in multiple selections, move the caret to the end of the tag and hit return to insert all the new lines you require.

Good luck

like image 50
waraker Avatar answered Sep 29 '22 04:09

waraker