Is there a way to use both `CamelHumps` words but ...
# intellij
w
Is there a way to use both
CamelHumps
words but fall back to default, non-camel-humps behavior as needed? My use case is that I often use multi-cursor to select stuff, and would like to be able to select e.g. all fields here:
Copy code
class Foo(
  val <|>id: String,
  val <|>someComplexProp: Int,
  val <|>otherProp: Unit,
)
with cursors at
<|>
I can’t find an easy way to select all the properties. Sometimes
extend selection
works as it’ll select single word first and whole identifier second, but that doesn’t work with identifiers that are just one word (like
id
here).
solved 1
s
Your example works okay for me, it selects all the fields using either Extend selection or Move caret to next word with selection
w
Do you have
CamelHumps
option on? The thing is I want to use camel humps words, but this one use case doesn’t work well with them
s
Oh I see 💡
I agree, it doesn’t work when that option is switched on 😞
Look at the available actions in the keymap — there’s a separate “Move caret to next word” and “Move caret to next word with different CamelHumps mode”
Plus variations of those actions for extending the selection
Presumably if you have CamelHumps on, then “with different CamelHumps mode” means do the action as if it was off, and vice versa
You should be able to map a keyboard shortcut for the “with different CamelHumps mode” versions so you can fall back to it when you need it 👍
w
yes! That’s exactly what what I needed 🙂 thanks a lot! I looked for something around selecting a word, not moving the caret
👍🏾 1
👍 1
s
Yeah, “move caret to next word with selection” isn’t the simplest way to describe it 😂
r
Yep, "with different CamelHumps" versions are great. I have them all mapped to
(normal shortcut) + Alt
and it works wonders to be able to differentiate if you want to select words, or you want to select identifiers