Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Visual Studio Code - multiple keyboard shortcuts?

Is there any way to set two keyboard shortcuts for one action in VS code? For example, I want to move the cursor to the left by pressing left arrow key or Alt+A.

like image 498
Younghoon Jeong Avatar asked Jul 28 '17 23:07

Younghoon Jeong


People also ask

How do you edit multiple things at once in VS Code?

Use Ctrl + D to use multi word edit of same words in Windows and Linux.

How do I get multiple cursors in VS Code?

VS Code supports multiple cursors for fast simultaneous edits. You can add secondary cursors (rendered thinner) with Alt+Click. Each cursor operates independently based on the context it sits in. A common way to add more cursors is with Shift+Alt+Down or Shift+Alt+Up that insert cursors below or above.

How do you move multiple lines in VS Code?

“visual code move multiple lines” Code Answer's Windows: Ctrl + Alt + Arrow Keys. Linux: Shift + Alt + Arrow Keys. Mac: Opt + Cmd + Arrow Keys.


1 Answers

Edit: Starting from 1.52 it's possible from keybindings GUI:

keybindings gui context menu add keybinding


What stops you from editing keybindings.json?

{     "key": "left",     "command": "cursorLeft",     "when": "textInputFocus" }, {     "key": "alt+a",     "command": "cursorLeft" } 

It can be opened from Command Palette Preferences: Open Keyboard Shortcuts (JSON)

Or by clicking the file icon from keybindings GUI page:

enter image description here

like image 192
Alex Avatar answered Sep 22 '22 10:09

Alex