Multiple cursors
Last modified: 18 July 2024Change the width for a few images using multiple carets
From this tutorial, you will learn to edit a few markup elements simultaneously using multiple carets.
note
Markup elements must be formatted and structured in the same way to benefit from this feature.
Let's assume you've agreed with colleagues and added an image size that displays optimally on all platforms into a style guide. Now you need to change it for many images, which may be time-consuming.
In the example below, we have images for various documentation instances.
Select multiple occurrences and edit them
Press Ctrl0F or select Edit | Find | Find. In the search pane at the top, type img.
Press CtrlAltShift0J or or click Select All Occurrences
on the toolbar.
Edit the width attribute in a few places.
We've edited a few image elements simultaneously using multiple carets in this tutorial.
This may also be useful when you need to add or change any attribute in all markup elements in the document. For example, change the border type for an image or video or the table style for a few tables in a reference.
There are more ways to add and use multiple carets, read about them in the IntelliJ IDEA help.
Thanks for your feedback!