Dan Gamble
Dan Gamble

Reputation: 4165

Select the closing tag in HTML with Intellij/PyCharm

I can't seem to find a keybind or an ability to select the closing tag of an element. Say im sitting on the opening div tag i wanna be able to select the closing tag to be able to change this to say a section or header for example.

I can use Add Select for Next Occurrence but if there are some div inside the the element i want to change then obviously it selects them as well.

Upvotes: 3

Views: 1734

Answers (1)

Bohuslav Burghardt
Bohuslav Burghardt

Reputation: 34776

You can use CTRL+[ to navigate to opening tag and CTRL+] to navigate to the closing tag.

By the way, there is an easier way to rename a tag. If you have the opening tag selected you can just hit SHIFT+F6 (rename refactoring) to change the tag.

Other way is to change the opening tag (let's say from div to section), hit ALT+Enter and select Rename end tag 'div' to 'section').


Update: IntelliJ 14.1 also introduced new simultaneous tag edit feature which simplifies tag renaming even further.

Upvotes: 6

Related Questions