Go to File > preferences > Keyboard Shortcuts; Search for comment Double click the existing shortcut 'keybinding` And press the new keyboard shortcut in my case ctrl + shfit + / You can assign any shortcuts you want. Hope it helps. Well there are way more keyboard shortcuts in VS Code and of course, you can configure tons of your own shortcuts. But the above is what mostly gets me around. You can find the full list of shortcuts on the Visual Studio Code website. ⌘K ⌘C ⌃⇧Add line comment ⌘K ⌘U Remove line comment ⌘/ ⌃⇧Toggle line comment ⇧⌥A Toggle block comment ⌥Z Editor Toggle word wrap. Other operating systems’ keyboard shortcuts and additional unassigned shortcuts available at aka.ms/vscodekeybindings for macOS. One more thing to add before we begin. In Visual Studio for Mac preferences, under Key Bindings section, you can choose the Scheme of key bindings. You can select the scheme from this list. Open Visual Studio Code and navigate to File>>Preferences>>Keyboard Shortcut Open Visual Studio Code Keyboard ShortCuts Click on edit keybindings. Json You will see two files Default bindings and keybindings.json side by side as shown below.
Overview
Using Visual Studio (in Parallels) on my Mac works pretty well, except when I try to use Command+Arrow to move to the beginning or end of a line. When you press Command+Arrow in Visual Studio on a Mac, the window moves around the screen, which is quite surprising and not at all helpful.
I did some research and found some useful information about mapping Mac Keyboard Shortcuts to Visual Studio (and Windows) in the following areas:
- Comments from the post in #1 above
Keyboard Shortcut For Commenting In Visual Studio Mac Osx
The information above basically involves using AutoHotKey to remap the keys and then modifying the keyboard shortcuts in Visual Studio to get the desired result.
Below is a summary of the steps required to use Mac keyboard shortcuts such as Command+Left Arrow from within a Parallels or similar Windows VM and Visual Studio.
Note this tutorial is for Windows 10 and Visual Studio 2015.
- Install AutoHotKey
- Download the MacKeyboard.ahk file (note this modifies more than just Visual Studio keys and incorporates changes from the links above.The file is a fork from here).
- Setup the .ahk file to run at startup
- Type Command+R to open the run window, then type shell:startup
- Copy the MacKeyboard.ahk file into the startup folder.
- Type Command+R to open the run window, then type shell:startup
- Open Visual Studio
- Press Ctrl+Q and type Keyboard to open keyboard settings.
- Type “Edit.LineStart” in “Show commands containing” to select the LineStart command
- Select “Text Editor” in the “Use new shortcut in:” box
- Type Shift+Control+Option+Left Arrow into “Press shortcut keys:” and click Assign
- Click OK to close the Options window.
- Double click on the MacKeyboard.ahk script to run it.
- Open a project in Visual Studio and Command+Left Arrow should bring your cursor to the home position. Alt+Left Arrow should move a word at a time.
F1 Show Command Palette | |
Quick Open, Go to File | |
New window/instance | |
Close window/instance | |
User Settings | |
Keyboard Shortcuts |
Cut line (empty selection) | |
Copy line (empty selection) | |
Move line up/down | |
Copy line up / down | |
Insert line below | |
Insert line above | |
Jump to matching bracket | |
Indent/outdent line | |
or | |
Go to beginning of line | |
Go to end of line | |
Go to beginning of file | |
Go to end of file | |
Scroll line up/down | |
Scroll page up | |
Scroll page down | |
Fold (collapse) region | |
Unfold (uncollapse) region | |
Fold (collapse) all subregions | |
Unfold (uncollapse) all subregions | |
Fold (collapse) all regions | |
Unfold (uncollapse) all regions | |
Add line comment | |
Remove line comment | |
Toggle line comment | |
Toggle block comment | |
Toggle word wrap |
Show all symbols | |
Go to line | |
Go to file | |
Go to symbol | |
Show Problems panel | |
Go to next error or warning | |
Go to previous error or warning | |
Navigate editor group history | |
Go back | |
Go forward | |
Toggle Tab moves focus |
Find | |
Replace | |
Find next | |
Find previous | |
Select all occurences of Find match | |
Add selection to next Find match | |
Move last selection to next Find match |
How To Create Project In Visual Studio Mac
Insert cursor | |
Insert cursor above / below | |
Undo last cursor operation | |
Insert cursor at end of each line selected | |
Select current line | |
Select all occurrences of current selection | |
Select all occurrences of current word | |
Expand selection | |
Shrink selection | |
Column (box) selection | |
Column (box) selection left/right | |
Column (box) selection page up | |
Column (box) selection page down |
Trigger suggestion | |
Trigger parameter hints | |
Format document | |
Format selection | |
Go to Definition | |
Peek Definition | |
12 Open Definition to the side | |
Quick Fix | |
Show References | |
Rename Symbol | |
Trim trailing whitespace | |
M Change file language |
Close editor | |
F Close folder | |
Split editor | |
Focus into first group | |
Focus into second group | |
Focus into third group | |
Focus into previous/next editor group | |
Move editor left | |
Move editor right | |
ht Move active editor group |
New File | |
Open File | |
Save | |
Save As | |
Save All | |
Close | |
Close All | |
Reopen closed editor | |
er Keep preview mode editor open | |
Open next | |
Open previous | |
P Copy path of active file | |
R Reveal active file in Explorer | |
O Show active file in new window/instance |
Toggle full screen | |
Toggle editor layout (horizontal/vertical) | |
Zoom in | |
Zoom out | |
Toggle Sidebar visibility | |
Show Explorer / Toggle focus | |
Show Search | |
Show Source Control | |
Show Debug | |
Show Extensions | |
Replace in files | |
Toggle Search details | |
Show Output panel | |
Open Markdown preview | |
V Open Markdown preview to the side | |
Z Zen Mode (Esc Esc to exit) |
Toggle breakpoint | |
Start/Continue | |
Stop | |
Step into | |
Step out | |
Step over | |
Show hover |
Show integrated terminal | |
Create new terminal | |
Copy selection | |
Scroll up/down | |
Scroll page up | |
Scroll page down | |
Scroll to top | |
Scroll to bottom |