In PyCharm when I move between words with the Alt + ←/→
shortcut it moves the cursor between whitespace separated words. How can I make it move the cursor between underscore_seperated_words
?
To move a line up or down, press Alt+Shift+Up or Alt+Shift+Down respectively. To move (swap) a code element to the left or to the right, place the caret at it, or select it and press Ctrl+Alt+Shift+Left for left or Ctrl+Alt+Shift+Right for right.
You can use your mouse to make your selection. Or, use the keyboard. For example, use Move Caret to Previous Word with Selection ( Shift-Ctrl-Left/Right Win/Linux, Alt-Shift-Left/Right macOS) to (a) move the cursor forward or backward a word, while (b) expanding the selection along the way.
If you hit the End key on your keyboard in PyCharm, the caret moves to the end of the line.
The option is not obvious but if I tick Editor -> General -> Smart Keys -> Use "CamelHumps" words
then when moving between words with Alt + ←/→
I can step between underscore separated words rather than just space separated "words". The same works for camelCase words obviously.
If you want both capabilities for whitespace separated and camelCase separated curser movement and selection, there are options in the keymap under Editor Actions
called:
Move Caret to Next Word
Move Caret to Next Word in Different "CamelHumps" Mode
Move Caret to Next Word with Selection in Different "CamelHumps" Mode
Move Caret to Pervious Word
Move Caret to Previous Word in Different "CamelHumps" Mode
Move Caret to Previous Word with Selection in Different "CamelHumps" Mode
As I mainly use the regular cursor movement with Ctrl + ←/→
I added Alt + ←/→
for the "CamelHumps"
mode. As mentioned, the CamelCase works for underline separated as well.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With