While experimenting with keyboard shortcut keys for different commands in WebStorm IDE, I wondered why not use mouse click/wheel in combination with keyboard keys as shortcut for executing different commands. If you are using mouse it’s always more convenient to not to lift your hand to press a combination shortcut keys. Below is the list of some useful mapping/binding to combine mouse with keyboard keys as shortcut for IDE’s commands. [Link]
Extend / Shrink Selection
If you are using any of JetBrains family of IDEs such as Webstorm, PhpStorm e.t.c. you must be using its feature called extend/shrinking selection, its from one of its smart selection feature. [Link]
the default keyboard shortcut is
Windows: Ctrl + W
Mac: ⌥ + arrow Up/down
Instead of above we could add and use following mapping:
Windows: CTRL + (mouse wheel up/down)
Mac: ⌘ + (mouse wheel up/down)
Folding / Unfolding Code Blocks
Default keyboard shortcut keys for folding and unfolding code blocks are:
Windows: Alt + (arrow up/down)
Mac: ⌘ + arrow Up/down
Instead of above we could add and use following mapping
Windows: Alt + (mouse wheel up/down)
Mac: ⌘ + (mouse wheel up/down)
Navigating Forward / Backword
Default keyboard shortcut keys for navigating to and fro are:
Windows: Ctrl+Alt+(Left/Right)
Mac: ⌘([ / ])
Instead of above we could add and use following mapping
Windows: Ctrl + Alt + (mouse wheel up/down)
Mac: ⌥ + ⌘ + (mouse wheel up/down)
Navigate to Line
Default keyboard shortcut keys to navigate to line are:
Windows: Ctrl + G
Mac: ⌘ + L
Instead of above we could add and use following mapping
Windows: Ctrl + (mouse right click)
Mac: ⌘ + (mouse right click)
Summary
Combining mouse click/wheel with keyboard keys as shortcut for executing commands could be very useful, it is more natural to use mouse wheel to execute any of the (recursive toggling behavior) such as folding/unfolding, extending/shrinking, navigating forward/backward, we just have to combine any special keys with mouse wheel to give it uniqueness. This concept could also be applied to any other IDE, text editor or software.