I need Eclipse(Kepler) to indent html tags within <head>...</head>
when I hit Ctrl+Shift+F
Currently, this:
<html>
<head>
<title>Insert title here</title>
<script type="text/javascript">
function func() {
console.log("Hello world");
}
</script>
</head>
<body>
<p onclick="func()">Some text</p>
</body>
</html>
becomes this when I hit the key combination.
<html>
<head>
<title>Insert title here</title>
<script type="text/javascript">
function func() {
console.log("Hello world");
}
</script>
</head>
<body>
<p onclick="func()">Some text</p>
</body>
</html>
I need everything within <head>...</head>
to be indented and also all the tags within <html>...</html>
.
Ideally this way:
function func() {
console.log("Hello world");
}
<html>
<head>
<title>Insert title here</title>
<script type="text/javascript">
/* function */
</script>
</head>
<body>
<p onclick="func()">Some text</p>
</body>
</html>
The contents of those tags should always be indented for clean markup, so that the nesting structure is clear to the reader.
You could try to go to: Window > Preferences > Web > HTML Files > Editors.
Add/Remove what you want to indent from the inline field. From what I saw it doesn't include the head tag, so try adding in the list.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With