Reputation: 1
What is the shortcut for "Collapse empty tag" in Android Studio or how could set it in keymap?
<element></element>
Convert to
<element />
If I press "Alt + Enter" shows me that option, but I would like to access this option directly
:(
P.S. I'm sorry for my English.
Upvotes: 0
Views: 1284
Reputation: 31696
If you have a tag like:
<element></element>
and want to convert it to
<element/>
then the simplest way is to type a slash /
within the opening element
tag, i.e.
<element/></element>
^^
↑↑↑ type '/'
The IDE will automatically remove the closing </element>
which results in:
<element/>
Upvotes: 1
Reputation: 97178
As of version 2016.2, there is no support in IntelliJ IDEA for assigning shortcuts to individual intention actions directly. The Alt-Enter popup is the only way to access this action from the keyboard.
Upvotes: 0