Khemraj Sharma
Khemraj Sharma

Reputation: 59004

Shortcut for selection till next capital letter IntellIJ/ Android Studio

Say I have following two strings.

String s = "update_user_name";
String s = "updateUserName";

Currently I use CTRL + SHIFT + (Right/Left Arrow) to make whole world selection.

Is there a shortcut for selecting till next capital letter (in 2nd case). Or for different part of word?

I hope there is one shortcut that I don't know.

So that when I press that shortcut that select only update from these strings. Then on next press it select update_user/ updateUser.

Please note this shortcut is expected to work with method names/ strings/ or any text in code.

I hope you understood me.

Upvotes: 7

Views: 1342

Answers (2)

Saad Mansoor
Saad Mansoor

Reputation: 365

I rather create a shortcut (in keymap) to jump to the capitalLetter. Here is how you do it:

Steps:

  1. open settins (CTRL + ALT + S)
  2. search for camelHump
  3. in keymap, for "Move Caret to the Next word With Selection"
  4. set shortcut key as per your desire. e.g. i put shortcut as ALT+SHIFT+rightArrow, because it is similiar to ALT+CTRL+rightArrow (which is used to select whole word)

Upvotes: 1

Frandall
Frandall

Reputation: 418

enable Use "CamelHumps" words in Settings | Editor | General | Smart Keys

Upvotes: 14

Related Questions