navgeet
navgeet

Reputation: 1007

How to indent xml in emacs like intellij?

Android Studio creates boilerplate xml code that looks like this:

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    tools:context=".MyActivity">

OTOH indenting it via emacs aligns all siblings with each other, which takes up too much space and makes life tough for me in a team full of intellij users.

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
                xmlns:tools="http://schemas.android.com/tools"
                android:layout_width="match_parent"
                tools:context=".MyActivity">

How do I configure emacs for indenting xml like this? I'm out of words to frame a google search for this problem.

Upvotes: 4

Views: 302

Answers (1)

fxbois
fxbois

Reputation: 826

web-mode.el does that by default

Upvotes: 4

Related Questions