Idea can edit multiple lines at the same time - both win & mac support

1 Background introduction

The idea editor is very powerful, one of its functions is excellent, and many programmers like to use it very much. This function can greatly improve work efficiency-------------multiple lines of code can be edited at the same time

2win

2.1 Method 1

Hold down alt+left mouse button and drag up/down

In this way, after selecting multiple lines, you can directly edit multiple lines.

Advantages : Multiple consecutive lines can be easily selected and edited at the same time

Disadvantage : must be consecutive lines

2.2 Method 2 - Flexible

Press and hold Ctrl+Shift+Alt+mouse at the same time and click the place to be edited.

You can click a few more places. At this time, it seems that the cursor has been copied, which is very beautiful.

Advantages : You can easily select **** non- consecutive lines and edit them at the same time
Disadvantages : Need to point one by one

3 mac

3.1 Method 1

Press and hold option + left mouse button to drag up/down

In this way, after selecting multiple lines, you can directly edit multiple lines.

Advantages : Multiple consecutive lines can be easily selected and edited at the same time

Disadvantage : must be consecutive lines

3.2 Practice

Requirements: Assign the same value to the following variables
insert image description here
option + left mouse button drag, and then edit. The effect is as follows:
insert image description here

3.3 Method 2 - Flexible

Press and hold Command+Shift+option+mouse at the same time and click the place to be edited.

You can click a few more places. At this time, it seems that the cursor has been copied, which is very beautiful.

Advantages : You can easily select **** non- consecutive lines and edit them at the same time
Disadvantages : Need to point one by one

3.4 Practice

insert image description here
Then enter hhh:
insert image description here

Guess you like

Origin blog.csdn.net/qq_39463175/article/details/129094109