Using Multiple Cursors in Idea and Visual Code

Using Multiple Cursors in Idea and Visual Code

·

1 min read

Multiple cursors is handy for quickly changing multiple places at the same time. Sure, there are other ways of doing it (like using find and replace), but sometimes it is easier to "see" the changes as you are making it. This is how to activate it: 

In Intellij Idea

With the mouse:

  • Hold down ALT + SHIFT while clicking  On the keyboard
  • Press ALT + SHIFT + INS to toggle column selection (or Edit -> Column Selection Mode via the menus)
  • While holding SHIFT press arrow keys to select area
  • Press ALT + SHIFT + INS to toggle column selection back off 

    Visual Code

    With the mouse:
  • Hold down ALT while clicking  On the keyboard:
  • Hold down ALT + CTRL while using the up and down arrow keys to extend the "cursor" vertically
  • While holding down SHIFT, use left and right keys to select the block

Here's an example of using it to populate fields from constructor arguments in Visual Code:  Copy and paste with multiple cursors in Visual Code