Artist's studio

Visual Studio Code: Change Keyboard Shortcuts

For various reasons, you may need to change the keyboard shortcuts (keybindings) for a Visual Studio Code function. In my case, I can press Ctrl and Alt together only with great difficulty—not to mention Ctrl+Alt+Shift. The solution for that pronlem is to custom-modify Visual Studio Code keyboard shortcuts. And the extension for achieving that is tshino's Keyboard Macro Beta.

Install an Extension with a Problematic Keyboard Shortcut

  1. In Visual Studio Code, click Extend and search for Keyboard Macro Beta.
  2. When it displays, click Install.
  3. Notice that to start or stop recording, you press Crl+Alt+R. To play back recording, you press Ctrl+Alt+P. For me (David McMurrey), that is really hard. So the thing to do is to alter the keybindings for Keyboard Macro Beta.

Change the Keyboard Shortcut

  1. Press Ctrl+Shift+P or View > Command Palette then start typing keyb to get to Keyboard Shortcuts:
  2. Listing of all keyboard shortcuts

    and click on Preferences: Open Keyboard Shortcuts. You'll see a big list of all Visual Studio Code keyboard shortcuts:

    All keyboard shortcuts listed
  3. In the search bar, type ctrl+alt+r or whatever name or keyboard sequence of a shortcut you want to find then change.
  4. Search string to find keyboard shortcut
  5. Right-click on the Keyboard: Start Recording line and select Change keybinding... or Add keybinding...:
  6. Search string to find keyboard shortcut
  7. Let's say you prefer Ctrl+Shift+R. Visual Studio Code tells you which other keyboard shortcuts use this sequence:
  8. Results of a keyboard-shortcut search
  9. Click the link to the other uses to see if any are critical to your work:
  10. Other keyboard shortcuts using Ctrl+Shift+R

    Refactoring is not essential to my technical writing, but wrapping is. However, standard word-wrapping can be accomplished in other ways. So I'll choose Change keybinding...

  11. To get back to that search for ctrl+shift+r, you can also type start recording in the search bar.
  12. Entering the keyboard sequence is tricky: press and release Ctrl; press and release Shift; press and release R (lowercase). Then press Enter. Here are the results:
  13. Completed keyboard shortcut change

Of course, the job is not over for the recording. We have to change the keyboard shortcut for finish recording, which is a toggle for Ctrl+Alt+R. Change that to Ctrl+Shift+R too. And then there's playback!

Complete This Unit

To reassure your instructor that you have gotten through this unit successfully, compose e-mail desribing the keyboard shortcuts you set up, whether you had any problems, whether the resources provided here were adequate.

Send this e-mail to your instructor at admin@mcmassociates.io (click this link).

Return

Return to your bookmarked course main page.

Related Information

How to Customize Keyboard Shortcuts in Visual Studio Code

VS Code tips — Editor word wrap

Information and programs provided by admin@mcmassociates.io.