{"id":43570,"date":"2021-11-14T12:21:26","date_gmt":"2021-11-14T12:21:26","guid":{"rendered":"https:\/\/foojay.io\/?p=43570"},"modified":"2024-02-06T11:58:24","modified_gmt":"2024-02-06T11:58:24","slug":"working-with-multiple-carets-in-intellij-idea","status":"publish","type":"post","link":"https:\/\/foojay.io\/today\/working-with-multiple-carets-in-intellij-idea\/","title":{"rendered":"Working with Multiple Carets in IntelliJ IDEA"},"content":{"rendered":"\n    <div class=\"article__table\">\n        <div class=\"article__table-header\">\n            <svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\">\n                <path d=\"M8 6H21\" stroke=\"#3562E5\" stroke-width=\"1.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\" \/>\n                <path d=\"M8 12H21\" stroke=\"#3562E5\" stroke-width=\"1.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\" \/>\n                <path d=\"M8 18H21\" stroke=\"#3562E5\" stroke-width=\"1.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\" \/>\n                <path d=\"M3 6H3.01\" stroke=\"#3562E5\" stroke-width=\"1.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\" \/>\n                <path d=\"M3 12H3.01\" stroke=\"#3562E5\" stroke-width=\"1.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\" \/>\n                <path d=\"M3 18H3.01\" stroke=\"#3562E5\" stroke-width=\"1.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\" \/>\n            <\/svg>\n            Table of Contents\n            <svg class=\"chevron\" width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\">\n                <path d=\"M18 15L12 9L6 15\" stroke=\"#3562E5\" stroke-width=\"1.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\"\/>\n            <\/svg>\n        <\/div>\n        <div class=\"article__table-body\"><ul><li><a href=\"#h3-0--reate-ultiple-arets-in-a-ertical-ine\">Create Multiple Carets in a Vertical Line<\/a><\/li><li><a href=\"#h3-1--reate-ultiple-arets-at-the-nd-of-ines\">Create Multiple Carets at the End of Lines<\/a><\/li><li><a href=\"#h3-2--reate-ultiple-arets-at-ny-oint-in-our-ode\">Create Multiple Carets at Any Point in Your Code<\/a><\/li><li><a href=\"#h3-3--ummary\">Summary<\/a><\/li><\/ul><\/div><\/div><!DOCTYPE html PUBLIC \"-\/\/W3C\/\/DTD HTML 4.0 Transitional\/\/EN\" \"http:\/\/www.w3.org\/TR\/REC-html40\/loose.dtd\">\n<?xml encoding=\"utf-8\" ?><html><body><p>Sometimes you need to modify multiple lines of code on separate lines inside IntelliJ IDEA with the same change. The fastest way to achieve that is with <a target=\"_blank\" href=\"https:\/\/www.jetbrains.com\/help\/idea\/working-with-source-code.html?keymap=primary_windows#multiple_cursor\">multiple carets<\/a>. In IntelliJ IDEA you can:<\/p>\n<ul>\n<li>Create multiple carets in a vertical line<\/li>\n<li>Create multiple carets at the end of lines<\/li>\n<li>Create multiple carets at any point in your code<\/li>\n<\/ul>\n<p style=\"text-align: center;\"><div class=\"homepage-today__guide homepage-today__guide--w-image\"\n     data-entry=\"123009\"\n     data-current=\"43570\"\n     style=\"border-color:#00131B;color:#F0981B\"\n    >\n    <div class=\"homepage-today__guide-title-container\">\n        <div class=\"homepage-today__guide-label\">Sponsored Content<\/div>                    <h2 class=\"homepage-today__guide-title\">Live Webinar: High-Frequency Trading on Jakarta EE, 25 March 2pm GMT<\/h2>\n                <p class=\"homepage-today__guide-description\">\n            Discover how Jakarta EE, Payara Micro, and Azul C4 enable ultra-low latency performance for high-frequency trading through real-world GC stress testing and benchmarking.        <\/p>\n\t                <a href=\"https:\/\/www.crowdcast.io\/c\/high-frequency-trading-on-jakarta-ee\"\n               target=\"_blank\"\n               class=\"homepage-today__guide-btn\"\n                >\n                Register here!                <svg\n                        xmlns=\"http:\/\/www.w3.org\/2000\/svg\"\n                        width=\"16\"\n                        height=\"16\"\n                        viewBox=\"0 0 16 16\"\n                        fill=\"none\"\n                >\n                    <path\n                            d=\"M3.33325 8H12.6666\"\n                            stroke=\"white\"\n                            stroke-width=\"1.5\"\n                            stroke-linecap=\"round\"\n                            stroke-linejoin=\"round\"\n                    \/>\n                    <path\n                            d=\"M8 3.33331L12.6667 7.99998L8 12.6666\"\n                            stroke=\"white\"\n                            stroke-width=\"1.5\"\n                            stroke-linecap=\"round\"\n                            stroke-linejoin=\"round\"\n                    \/>\n                <\/svg>\n            <\/a>\n            <\/div>\n    <div class=\"homepage-today__guide-img-container\">\n        <img loading=\"lazy\" decoding=\"async\" width=\"510\" height=\"510\" src=\"https:\/\/foojay.io\/wp-content\/uploads\/2026\/03\/Speaker-Card_Square_Luqman_Simon-510x510.png\" class=\"attachment-medium size-medium wp-post-image\" alt=\"\" srcset=\"https:\/\/foojay.io\/wp-content\/uploads\/2026\/03\/Speaker-Card_Square_Luqman_Simon-510x510.png 510w, https:\/\/foojay.io\/wp-content\/uploads\/2026\/03\/Speaker-Card_Square_Luqman_Simon-80x80.png 80w, https:\/\/foojay.io\/wp-content\/uploads\/2026\/03\/Speaker-Card_Square_Luqman_Simon-120x120.png 120w, https:\/\/foojay.io\/wp-content\/uploads\/2026\/03\/Speaker-Card_Square_Luqman_Simon.png 675w\" sizes=\"auto, (max-width: 510px) 100vw, 510px\" \/>    <\/div>\n<\/div>\n<\/p>\n<h3 id=\"h3-0--reate-ultiple-arets-in-a-ertical-ine\">Create Multiple Carets in a Vertical Line<\/h3>\n<p><a target=\"_blank\" href=\"https:\/\/www.jetbrains.com\/help\/idea\/working-with-source-code.html?keymap=primary_windows#multiple_cursor\">Creating carets<\/a> that are stacked vertically where you have content on different lines, like a list, can save you a lot of time when you're editing your code.<\/p>\n<ul>\n<li><strong>macOS<\/strong> press <strong>Option<\/strong> twice and hold it down the second time. Then use the arrow keys (up or down)<\/li>\n<li><strong>Windows<\/strong> press <strong>Ctrl<\/strong> twice and hold it down the second time. Then use the arrow keys (up or down)<\/li>\n<\/ul>\n<p>Let's say you have defined some variables at the start of your class, but retrospectively you realise that their scope should be <code>private<\/code>, and since we're defining them here, they should also be <code>final<\/code>:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"java\">public String oak = \"Oak\";\npublic String sycamore = \"Sycamore\";\npublic String pine = \"Pine\";<\/pre>\n<p>You could click each one and replace <code>public<\/code> with <code>private<\/code> but there's a faster way in IntelliJ IDEA. You can press <strong>Option<\/strong> (macOS), or <strong>Ctrl<\/strong> (Windows\/Linux) twice, holding it down the second time you press it and then use arrow keys to create a tower of vertical carets. You can then replace public with private just once, not three times. You can also add <code>final<\/code> since you're here:<\/p>\n<p><a target=\"_blank\" href=\"https:\/\/helenjoscott-blogs.s3.eu-west-2.amazonaws.com\/multiple-carets-variables.mp4\"><img decoding=\"async\" src=\"https:\/\/helenjoscott-blogs.s3.eu-west-2.amazonaws.com\/multiple-carets-variables.png\" alt=\"Modifying variables with multiple carets\"><\/a><\/p>\n<p>How about dealing with a big list that you've pasted into your code? How can you inline everything? First let's make an array for our data, then we can use the same clone caret operation before wrapping it in braces and completing the statement:<\/p>\n<p><a target=\"_blank\" href=\"https:\/\/helenjoscott-blogs.s3.eu-west-2.amazonaws.com\/multiple-carets-input-list.mp4\"><img decoding=\"async\" src=\"https:\/\/helenjoscott-blogs.s3.eu-west-2.amazonaws.com\/multiple-carets-input-list.png\" alt=\"Inlining a long list\"><\/a><\/p>\n<p>Finally, how about HTML tags? Again, it's the same process:<\/p>\n<p><a target=\"_blank\" href=\"https:\/\/helenjoscott-blogs.s3.eu-west-2.amazonaws.com\/multiple-carets-html-tags.mp4\"><img decoding=\"async\" src=\"https:\/\/helenjoscott-blogs.s3.eu-west-2.amazonaws.com\/multiple-carets-html-tags.png\" alt=\"HTML tags and multiple carots\"><\/a><\/p>\n<h3 id=\"h3-1--reate-ultiple-arets-at-the-nd-of-ines\">Create Multiple Carets at the End of Lines<\/h3>\n<p>Content at the start of your line is likely to be left-aligned, but that's not the case at the end of your line. We can deal with that by using the mouse to drag the caret down, instead of the vertical arrow keys.<\/p>\n<p>Place your cursor to the far right of the furthest line of code and:<\/p>\n<ul>\n<li><strong>macOS<\/strong> hold down <strong>Option<\/strong> and drag the mouse down (or up)<\/li>\n<li><strong>Windows<\/strong> hold down <strong>Alt<\/strong> and drag the mouse down (or up)\n<ul>\n<li>Note that for Windows the shortcut for this one is <strong>Alt<\/strong>, not <strong>Ctrl<\/strong><\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p>Let's say that you want to add something to the end of each of these strings, for example:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"java\">public final String lion = \"Lives in Africa\";\npublic final String stoat = \"Lives in the United Kingdom\";\npublic final String wolf = \"Lives in Europe\";<\/pre>\n<pre><\/pre>\n<p>This time, instead of cloning the caret in a vertical line with the down arrow, hold down <strong>Option<\/strong> (macOS), or <strong>Alt<\/strong> (Windows\/Linux) and use the mouse to place your caret to the right of the all the lines and then drag the mouse down. The caret will be placed at the end of each line. You can then add the text even though the lines are not in a straight line:<\/p>\n<p><a target=\"_blank\" href=\"https:\/\/helenjoscott-blogs.s3.eu-west-2.amazonaws.com\/multiple-carets-end-of-line.mp4\"><img decoding=\"async\" src=\"https:\/\/helenjoscott-blogs.s3.eu-west-2.amazonaws.com\/multiple-carets-end-of-line.png\" alt=\"Multiple carets at the end of the line\"><\/a><\/p>\n<h3 id=\"h3-2--reate-ultiple-arets-at-ny-oint-in-our-ode\">Create Multiple Carets at Any Point in Your Code<\/h3>\n<p>And finally, what if you want multiple carets, but not in a stacked vertical line or at the end of each line? Again, the shortcut is similar:<\/p>\n<ul>\n<li><strong>macOS<\/strong> hold down <strong>Option<\/strong> and then <strong>Shift<\/strong> and click where you want the caret<\/li>\n<li><strong>Windows<\/strong> hold down <strong>Alt<\/strong> and then <strong>Shift<\/strong> and click where you want the caret<\/li>\n<\/ul>\n<p>Let's say you want to add \"Name\" to these variables, but only to some of them:<\/p>\n<p><a target=\"_blank\" href=\"https:\/\/helenjoscott-blogs.s3.eu-west-2.amazonaws.com\/multiple-carets-random.mp4\"><img decoding=\"async\" src=\"https:\/\/helenjoscott-blogs.s3.eu-west-2.amazonaws.com\/multiple-carets-random.png\" alt=\"Multiple carets at the end of the line\"><\/a><\/p>\n<h3 id=\"h3-3--ummary\">Summary<\/h3>\n<p>There's lots of places that <a target=\"_blank\" href=\"https:\/\/www.jetbrains.com\/help\/idea\/working-with-source-code.html?keymap=primary_windows#multiple_cursor\">multiple carets<\/a> are helpful in <a target=\"_blank\" href=\"https:\/\/www.jetbrains.com\/idea\/\">IntelliJ IDEA<\/a>, especially when you're working with lists. Just remember that for carets in a vertical line, press <strong>Option<\/strong> (macOS) and <strong>Ctrl<\/strong> (Windows\/Linux) twice, holding it down the second time.<\/p>\n<p>For carets to the right of a line hold down <strong>Option<\/strong> (macOS), or <strong>Alt<\/strong> (Windows\/Linux) and drag the mouse pad\/wheel down (or up).<\/p>\n<p>For random carets, you add press and hold <strong>Option<\/strong>+<strong>Shift<\/strong> (macOS), or <strong>Alt<\/strong>+<strong>Shift<\/strong> (Windows\/Linux), then click anywhere to place extra carets.<\/p>\n<p>Multiple carets can also be created using <a target=\"_blank\" href=\"https:\/\/www.jetbrains.com\/help\/idea\/working-with-source-code.html?keymap=secondary_macos#multiple_cursor\">Column Selection Mode<\/a>. There is an example of this, and the techniques we talked about above, in <a target=\"_blank\" href=\"https:\/\/www.youtube.com\/watch?v=JEpeHNsWIMk\">this video from JetBrains<\/a>, specifically at <a target=\"_blank\" href=\"https:\/\/youtu.be\/JEpeHNsWIMk?t=186\">this time point<\/a>. There are lots of other helpful tips in the video as well.<\/p>\n<\/body><\/html>\n","protected":false},"excerpt":{"rendered":"<p>Sometimes you need to modify multiple lines of code on separate lines inside IntelliJ IDEA with the same change. <\/p>\n<p>The fastest way to achieve that is with multiple carets that are either stacked vertically in a list, placed at the end of each line or positioned exactly where you want them in your code.<\/p>\n","protected":false},"author":54,"featured_media":35463,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[221],"tags":[316,199,315,317],"class_list":["post-43570","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-idea","tag-carets","tag-intellij","tag-intellij-idea","tag-lists"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.7 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Working with Multiple Carets in IntelliJ IDEA | foojay<\/title>\n<meta name=\"description\" content=\"Sometimes you need to modify multiple lines of code on separate lines inside IntelliJ IDEA with the same change. Here&#039;s how!\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/foojay.io\/today\/working-with-multiple-carets-in-intellij-idea\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Working with Multiple Carets in IntelliJ IDEA | foojay\" \/>\n<meta property=\"og:description\" content=\"Sometimes you need to modify multiple lines of code on separate lines inside IntelliJ IDEA with the same change. Here&#039;s how!\" \/>\n<meta property=\"og:url\" content=\"https:\/\/foojay.io\/today\/working-with-multiple-carets-in-intellij-idea\/\" \/>\n<meta property=\"og:site_name\" content=\"foojay\" \/>\n<meta property=\"article:published_time\" content=\"2021-11-14T12:21:26+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-02-06T11:58:24+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/foojay.io\/wp-content\/uploads\/2020\/10\/1200px-IntelliJ_IDEA_Logo.svg_.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1200\" \/>\n\t<meta property=\"og:image:height\" content=\"1200\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Helen Scott\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Helen Scott\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"5 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/foojay.io\\\/today\\\/working-with-multiple-carets-in-intellij-idea\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/foojay.io\\\/today\\\/working-with-multiple-carets-in-intellij-idea\\\/\"},\"author\":{\"name\":\"Helen Scott\",\"@id\":\"https:\\\/\\\/foojay.io\\\/#\\\/schema\\\/person\\\/e4db49804a4bfe92c6123fbb0beef6a5\"},\"headline\":\"Working with Multiple Carets in IntelliJ IDEA\",\"datePublished\":\"2021-11-14T12:21:26+00:00\",\"dateModified\":\"2024-02-06T11:58:24+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/foojay.io\\\/today\\\/working-with-multiple-carets-in-intellij-idea\\\/\"},\"wordCount\":709,\"commentCount\":7,\"publisher\":{\"@id\":\"https:\\\/\\\/foojay.io\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/foojay.io\\\/today\\\/working-with-multiple-carets-in-intellij-idea\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/foojay.io\\\/wp-content\\\/uploads\\\/2020\\\/10\\\/1200px-IntelliJ_IDEA_Logo.svg_.png\",\"keywords\":[\"Carets\",\"IntelliJ\",\"IntelliJ IDEA\",\"Lists\"],\"articleSection\":[\"IntelliJ IDEA\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/foojay.io\\\/today\\\/working-with-multiple-carets-in-intellij-idea\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/foojay.io\\\/today\\\/working-with-multiple-carets-in-intellij-idea\\\/\",\"url\":\"https:\\\/\\\/foojay.io\\\/today\\\/working-with-multiple-carets-in-intellij-idea\\\/\",\"name\":\"Working with Multiple Carets in IntelliJ IDEA | foojay\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/foojay.io\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/foojay.io\\\/today\\\/working-with-multiple-carets-in-intellij-idea\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/foojay.io\\\/today\\\/working-with-multiple-carets-in-intellij-idea\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/foojay.io\\\/wp-content\\\/uploads\\\/2020\\\/10\\\/1200px-IntelliJ_IDEA_Logo.svg_.png\",\"datePublished\":\"2021-11-14T12:21:26+00:00\",\"dateModified\":\"2024-02-06T11:58:24+00:00\",\"description\":\"Sometimes you need to modify multiple lines of code on separate lines inside IntelliJ IDEA with the same change. Here's how!\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/foojay.io\\\/today\\\/working-with-multiple-carets-in-intellij-idea\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/foojay.io\\\/today\\\/working-with-multiple-carets-in-intellij-idea\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/foojay.io\\\/today\\\/working-with-multiple-carets-in-intellij-idea\\\/#primaryimage\",\"url\":\"https:\\\/\\\/foojay.io\\\/wp-content\\\/uploads\\\/2020\\\/10\\\/1200px-IntelliJ_IDEA_Logo.svg_.png\",\"contentUrl\":\"https:\\\/\\\/foojay.io\\\/wp-content\\\/uploads\\\/2020\\\/10\\\/1200px-IntelliJ_IDEA_Logo.svg_.png\",\"width\":1200,\"height\":1200,\"caption\":\"IntelliJ IDEA Icon\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/foojay.io\\\/today\\\/working-with-multiple-carets-in-intellij-idea\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/foojay.io\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Working with Multiple Carets in IntelliJ IDEA\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/foojay.io\\\/#website\",\"url\":\"https:\\\/\\\/foojay.io\\\/\",\"name\":\"foojay\",\"description\":\"a place for friends of OpenJDK\",\"publisher\":{\"@id\":\"https:\\\/\\\/foojay.io\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/foojay.io\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/foojay.io\\\/#organization\",\"name\":\"foojay\",\"url\":\"https:\\\/\\\/foojay.io\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/foojay.io\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/foojay.io\\\/wp-content\\\/uploads\\\/2020\\\/04\\\/cropped-Favicon.png\",\"contentUrl\":\"https:\\\/\\\/foojay.io\\\/wp-content\\\/uploads\\\/2020\\\/04\\\/cropped-Favicon.png\",\"width\":512,\"height\":512,\"caption\":\"foojay\"},\"image\":{\"@id\":\"https:\\\/\\\/foojay.io\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/x.com\\\/foojay2020\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/foojay.io\\\/#\\\/schema\\\/person\\\/e4db49804a4bfe92c6123fbb0beef6a5\",\"name\":\"Helen Scott\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/3e6a96f6aef17761fc9b9eadb92da4d1e4727f3aa067be51eba4ef88618f7366?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/3e6a96f6aef17761fc9b9eadb92da4d1e4727f3aa067be51eba4ef88618f7366?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/3e6a96f6aef17761fc9b9eadb92da4d1e4727f3aa067be51eba4ef88618f7366?s=96&d=mm&r=g\",\"caption\":\"Helen Scott\"},\"description\":\"Helen is a Java Developer Advocate at JetBrains. She has over 20 years\u2019 experience in the software industry which has been gained in a variety of roles including developer, technical writer, product owner, and advocacy.\",\"sameAs\":[\"https:\\\/\\\/www.helenjoscott.com\",\"https:\\\/\\\/www.linkedin.com\\\/in\\\/helenjoscott\\\/\",\"https:\\\/\\\/x.com\\\/@helenjoscott\"],\"url\":\"https:\\\/\\\/foojay.io\\\/today\\\/author\\\/helenjoscott\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Working with Multiple Carets in IntelliJ IDEA | foojay","description":"Sometimes you need to modify multiple lines of code on separate lines inside IntelliJ IDEA with the same change. Here's how!","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/foojay.io\/today\/working-with-multiple-carets-in-intellij-idea\/","og_locale":"en_US","og_type":"article","og_title":"Working with Multiple Carets in IntelliJ IDEA | foojay","og_description":"Sometimes you need to modify multiple lines of code on separate lines inside IntelliJ IDEA with the same change. Here's how!","og_url":"https:\/\/foojay.io\/today\/working-with-multiple-carets-in-intellij-idea\/","og_site_name":"foojay","article_published_time":"2021-11-14T12:21:26+00:00","article_modified_time":"2024-02-06T11:58:24+00:00","og_image":[{"width":1200,"height":1200,"url":"https:\/\/foojay.io\/wp-content\/uploads\/2020\/10\/1200px-IntelliJ_IDEA_Logo.svg_.png","type":"image\/png"}],"author":"Helen Scott","twitter_misc":{"Written by":"Helen Scott","Est. reading time":"5 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/foojay.io\/today\/working-with-multiple-carets-in-intellij-idea\/#article","isPartOf":{"@id":"https:\/\/foojay.io\/today\/working-with-multiple-carets-in-intellij-idea\/"},"author":{"name":"Helen Scott","@id":"https:\/\/foojay.io\/#\/schema\/person\/e4db49804a4bfe92c6123fbb0beef6a5"},"headline":"Working with Multiple Carets in IntelliJ IDEA","datePublished":"2021-11-14T12:21:26+00:00","dateModified":"2024-02-06T11:58:24+00:00","mainEntityOfPage":{"@id":"https:\/\/foojay.io\/today\/working-with-multiple-carets-in-intellij-idea\/"},"wordCount":709,"commentCount":7,"publisher":{"@id":"https:\/\/foojay.io\/#organization"},"image":{"@id":"https:\/\/foojay.io\/today\/working-with-multiple-carets-in-intellij-idea\/#primaryimage"},"thumbnailUrl":"https:\/\/foojay.io\/wp-content\/uploads\/2020\/10\/1200px-IntelliJ_IDEA_Logo.svg_.png","keywords":["Carets","IntelliJ","IntelliJ IDEA","Lists"],"articleSection":["IntelliJ IDEA"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/foojay.io\/today\/working-with-multiple-carets-in-intellij-idea\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/foojay.io\/today\/working-with-multiple-carets-in-intellij-idea\/","url":"https:\/\/foojay.io\/today\/working-with-multiple-carets-in-intellij-idea\/","name":"Working with Multiple Carets in IntelliJ IDEA | foojay","isPartOf":{"@id":"https:\/\/foojay.io\/#website"},"primaryImageOfPage":{"@id":"https:\/\/foojay.io\/today\/working-with-multiple-carets-in-intellij-idea\/#primaryimage"},"image":{"@id":"https:\/\/foojay.io\/today\/working-with-multiple-carets-in-intellij-idea\/#primaryimage"},"thumbnailUrl":"https:\/\/foojay.io\/wp-content\/uploads\/2020\/10\/1200px-IntelliJ_IDEA_Logo.svg_.png","datePublished":"2021-11-14T12:21:26+00:00","dateModified":"2024-02-06T11:58:24+00:00","description":"Sometimes you need to modify multiple lines of code on separate lines inside IntelliJ IDEA with the same change. Here's how!","breadcrumb":{"@id":"https:\/\/foojay.io\/today\/working-with-multiple-carets-in-intellij-idea\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/foojay.io\/today\/working-with-multiple-carets-in-intellij-idea\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/foojay.io\/today\/working-with-multiple-carets-in-intellij-idea\/#primaryimage","url":"https:\/\/foojay.io\/wp-content\/uploads\/2020\/10\/1200px-IntelliJ_IDEA_Logo.svg_.png","contentUrl":"https:\/\/foojay.io\/wp-content\/uploads\/2020\/10\/1200px-IntelliJ_IDEA_Logo.svg_.png","width":1200,"height":1200,"caption":"IntelliJ IDEA Icon"},{"@type":"BreadcrumbList","@id":"https:\/\/foojay.io\/today\/working-with-multiple-carets-in-intellij-idea\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/foojay.io\/"},{"@type":"ListItem","position":2,"name":"Working with Multiple Carets in IntelliJ IDEA"}]},{"@type":"WebSite","@id":"https:\/\/foojay.io\/#website","url":"https:\/\/foojay.io\/","name":"foojay","description":"a place for friends of OpenJDK","publisher":{"@id":"https:\/\/foojay.io\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/foojay.io\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/foojay.io\/#organization","name":"foojay","url":"https:\/\/foojay.io\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/foojay.io\/#\/schema\/logo\/image\/","url":"https:\/\/foojay.io\/wp-content\/uploads\/2020\/04\/cropped-Favicon.png","contentUrl":"https:\/\/foojay.io\/wp-content\/uploads\/2020\/04\/cropped-Favicon.png","width":512,"height":512,"caption":"foojay"},"image":{"@id":"https:\/\/foojay.io\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/x.com\/foojay2020"]},{"@type":"Person","@id":"https:\/\/foojay.io\/#\/schema\/person\/e4db49804a4bfe92c6123fbb0beef6a5","name":"Helen Scott","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/3e6a96f6aef17761fc9b9eadb92da4d1e4727f3aa067be51eba4ef88618f7366?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/3e6a96f6aef17761fc9b9eadb92da4d1e4727f3aa067be51eba4ef88618f7366?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/3e6a96f6aef17761fc9b9eadb92da4d1e4727f3aa067be51eba4ef88618f7366?s=96&d=mm&r=g","caption":"Helen Scott"},"description":"Helen is a Java Developer Advocate at JetBrains. She has over 20 years\u2019 experience in the software industry which has been gained in a variety of roles including developer, technical writer, product owner, and advocacy.","sameAs":["https:\/\/www.helenjoscott.com","https:\/\/www.linkedin.com\/in\/helenjoscott\/","https:\/\/x.com\/@helenjoscott"],"url":"https:\/\/foojay.io\/today\/author\/helenjoscott\/"}]}},"_links":{"self":[{"href":"https:\/\/foojay.io\/wp-json\/wp\/v2\/posts\/43570","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/foojay.io\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/foojay.io\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/foojay.io\/wp-json\/wp\/v2\/users\/54"}],"replies":[{"embeddable":true,"href":"https:\/\/foojay.io\/wp-json\/wp\/v2\/comments?post=43570"}],"version-history":[{"count":0,"href":"https:\/\/foojay.io\/wp-json\/wp\/v2\/posts\/43570\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/foojay.io\/wp-json\/wp\/v2\/media\/35463"}],"wp:attachment":[{"href":"https:\/\/foojay.io\/wp-json\/wp\/v2\/media?parent=43570"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/foojay.io\/wp-json\/wp\/v2\/categories?post=43570"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/foojay.io\/wp-json\/wp\/v2\/tags?post=43570"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}