Search code examples
webstorm

Setting keyboard shortcut for a character in WebStorm


Is there any way I can set a shortcut for a character like equal sign (=) in WebStorm?

For example: Cmd + J prints =

In VSCode we can make a snippet and set a shortcut for that but I could not find any way in WebStorm.


Solution

  • You can use Macros functionality for such thing: https://www.jetbrains.com/help/webstorm/using-macros-in-the-editor.html

    1. Make sure that the focus is in the Editor area
    2. Use Edit | Macros | Start Macro Recording
    3. Press =
    4. Now stop recording, Edit | Macros | Stop Macro Recording
    5. Give it a name
    6. Go to Settings/Preferences | Keymap, locate your freshly recorded macro there (will be under the Macros node) and assign any desired shortcut for that