Question
Is there a combination of keyboard shortcuts allowing to select a method, and extend the selection below, method by method?
Akin to Vim's start/end of visual selection, or Emacs set-mark-command .
Answer
Solution 1:
- In File | Settings | Keymap, assign a shortcut to the action called “Toggle Sticky Selection”
- In the editor, set the cursor to the beginning of a method and use the shortcut to toggle sticky selection ON
- Jump between method names using Alt + Arrow Up/Down (actions: "Next Method", "Previous Method") to incrementally select each method's body
- Use the shortcut to disable sticky selection mode when done
Solution 2:
- In File | Settings | Keymap, assign a shortcut to the action called “Move Caret Forward/Backward a Paragraph with Selection”
- Use the shortcut to jump through methods paragraph by paragraph incrementally selecting each paragraph. In methods with no line breaks in them, the action will select the entire method at once.
Related issues
IJPL-30987: Feature request to make the 'Toggle Sticky Selection' action more discoverable in the settings
Comments
0 comments
Please sign in to leave a comment.