wer
wer

Reputation: 201

Selecting several lines in Intellij using keyboard shortcuts

How can I select several lines in Intellij using keyboard shortcuts? I found out that I can do it with

ctrl + shift + right/left

But I have to press this buttons several times to select whole line. What is more the selection starts from current caret position, so if it's not the beginning/end (depending of using left or right arrow) of the line, the whole first line is not selected.

Upvotes: 1

Views: 4236

Answers (1)

Mike Nakis
Mike Nakis

Reputation: 62120

What I usually do is to hit the Home key, and then either:

  1. Shift+End to select until the end of the current line, or

  2. Shift+Down to select until the next line, and then keep pressing Shift+Down to select multiple lines.

Also, IntelliJ IDEA supports the "Extend Selection" and "Shrink Selection" commands, for which the default key bindings are Ctrl+Alt+Left and Ctrl+Alt+Right.

These allow you to select entire blocks of code rather than word by word. You may still need to press the keys multiple times, but way fewer times than when selecting on a word by word basis.

Upvotes: 4

Related Questions