Keyboard Shortcut For Commenting In Visual Studio Mac

  1. Keyboard Shortcut For Commenting In Visual Studio Mac Osx
  2. How To Create Project In Visual Studio Mac

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:

  1. 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.

  1. Install AutoHotKey
  2. 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).
  3. Setup the .ahk file to run at startup
    1. Type Command+R to open the run window, then type shell:startup
    2. Copy the MacKeyboard.ahk file into the startup folder.
  4. Open Visual Studio
  5. Press Ctrl+Q and type Keyboard to open keyboard settings.
  6. Type “Edit.LineStart” in “Show commands containing” to select the LineStart command
  7. Select “Text Editor” in the “Use new shortcut in:” box
  8. Type Shift+Control+Option+Left Arrow into “Press shortcut keys:” and click Assign
  9. Click OK to close the Options window.
  10. Double click on the MacKeyboard.ahk script to run it.
  11. 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.
↑ Shift + ⌘ Cmd + P then F1

F1 Show Command Palette

⌘ Cmd + P

Quick Open, Go to File

↑ Shift + ⌘ Cmd + N

New window/instance

⌘ Cmd + W

Close window/instance

⌘ Cmd + ,

User Settings

⌘ Cmd + K then ⌘ Cmd + S

Keyboard Shortcuts

⌘ Cmd + X

Cut line (empty selection)

⌘ Cmd + C

Copy line (empty selection)

⌥ Option + ↑ ↓

Move line up/down

↑ Shift + ⌥ Option + ↑ ↓

Copy line up / down

⌘ Cmd + ⤶ Enter

Insert line below

↑ Shift + ⌘ Cmd + ⤶ Enter

Insert line above

↑ Shift + ⌘ Cmd +

Jump to matching bracket

⌘ Cmd + ]

Indent/outdent line

or ⌘ Cmd + [
Home

Go to beginning of line

End

Go to end of line

⌘ Cmd +

Go to beginning of file

⌘ Cmd +

Go to end of file

Ctrl + ↑ ↓

Scroll line up/down

Control + Page Up

Scroll page up

Control + Page Down

Scroll page down

⌥ Option + ⌘ Cmd + [

Fold (collapse) region

⌥ Option + ⌘ Cmd + ]

Unfold (uncollapse) region

⌘ Cmd + K then ⌘ Cmd + [

Fold (collapse) all subregions

⌘ Cmd + K then ⌘ Cmd + ]

Unfold (uncollapse) all subregions

⌘ Cmd + K then ⌘ Cmd + 0

Fold (collapse) all regions

⌘ Cmd + K then ⌘ Cmd + J

Unfold (uncollapse) all regions

⌘ Cmd + K then ⌘ Cmd + C

Add line comment

⌘ Cmd + K then ⌘ Cmd + U

Remove line comment

⌘ Cmd + /

Toggle line comment

↑ Shift + ⌥ Option + A

Toggle block comment

⌥ Option + Z

Toggle word wrap

⌘ Cmd + T

Show all symbols

Control + G

Go to line

⌘ Cmd + P

Go to file

↑ Shift + ⌘ Cmd + O

Go to symbol

↑ Shift + ⌘ Cmd + M

Show Problems panel

F8

Go to next error or warning

↑ Shift + F8

Go to previous error or warning

Ctrl + ↑ Shift + ⭾ Tab

Navigate editor group history

Ctrl + -

Go back

Ctrl + ↑ Shift + -

Go forward

Ctrl + ↑ Shift + M

Toggle Tab moves focus

⌘ Cmd + F

Find

⌥ Option + ⌘ Cmd + F

Replace

⌘ Cmd + G

Find next

↑ Shift + ⌘ Cmd + G

Find previous

⌥ Option + ⤶ Enter

Select all occurences of Find match

⌘ Cmd + D

Add selection to next Find match

⌘ Cmd + K then ⌘ Cmd + D

Move last selection to next Find match

How To Create Project In Visual Studio Mac

⌥ Option +

Insert cursor

⌥ Option + ⌘ Cmd + ↑ ↓

Insert cursor above / below

⌘ Cmd + U

Undo last cursor operation

↑ Shift + ⌥ Option + I

Insert cursor at end of each line selected

⌘ Cmd + I

Select current line

↑ Shift + ⌘ Cmd + L

Select all occurrences of current selection

⌘ Cmd + F2

Select all occurrences of current word

Ctrl + ↑ Shift + ⌘ Cmd +

Expand selection

Ctrl + ↑ Shift + ⌘ Cmd +

Shrink selection

↑ Shift + ⌥ Option +

Column (box) selection

↑ Shift + ⌥ Option + ⌘ Cmd + ← →

Column (box) selection left/right

Shift + Option + Command + Page Up

Column (box) selection page up

Shift + Option + Command + Page Down

Column (box) selection page down

Ctrl + Space

Trigger suggestion

↑ Shift + ⌘ Cmd + Space

Trigger parameter hints

↑ Shift + ⌥ Option + F

Format document

⌘ Cmd + K then ⌘ Cmd + F

Format selection

F12

Go to Definition

⌥ Option + F12

Peek Definition

⌘ Cmd + K then F12

12 Open Definition to the side

⌘ Cmd + .

Quick Fix

↑ Shift + F12

Show References

F2

Rename Symbol

⌘ Cmd + K then ⌘ Cmd + X

Trim trailing whitespace

⌘ Cmd + K then M

M Change file language

⌘ Cmd + W

Close editor

⌘ Cmd + K then F

F Close folder

⌘ Cmd +

Split editor

⌘ Cmd + 1

Focus into first group

⌘ Cmd + 2

Focus into second group

⌘ Cmd + 3

Focus into third group

⌘ Cmd + K then ⌘ Cmd + ← →

Focus into previous/next editor group

⌘ Cmd + K then ↑ Shift + ⌘ Cmd +

Move editor left

⌘ Cmd + K then ↑ Shift + ⌘ Cmd +

Move editor right

⌘ Cmd + K then ← →

ht Move active editor group

Mac
⌘ Cmd + N

New File

⌘ Cmd + O

Open File

⌘ Cmd + S

Save

↑ Shift + ⌘ Cmd + S

Save As

⌥ Option + ⌘ Cmd + S

Save All

⌘ Cmd + W

Close

⌘ Cmd + K then ⌘ Cmd + W

Close All

Ctrl + ↑ Shift + T

Reopen closed editor

⌘ Cmd + K then ⤶ Enter

er Keep preview mode editor open

Control + ⭾ Tab

Open next

Control + ↑ Shift + ⭾ Tab

Open previous

⌘ Cmd + K then P

P Copy path of active file

⌘ Cmd + K then R

R Reveal active file in Explorer

⌘ Cmd + K then O

O Show active file in new window/instance

Control + ⌘ Cmd + F

Toggle full screen

⌥ Option + ⌘ Cmd + 1

Toggle editor layout (horizontal/vertical)

⌘ Cmd + =

Zoom in

↑ Shift + ⌘ Cmd + -

Zoom out

⌘ Cmd + B

Toggle Sidebar visibility

↑ Shift + ⌘ Cmd + E

Show Explorer / Toggle focus

↑ Shift + ⌘ Cmd + F

Show Search

Control + ↑ Shift + G

Show Source Control

↑ Shift + ⌘ Cmd + D

Show Debug

↑ Shift + ⌘ Cmd + X

Show Extensions

↑ Shift + ⌘ Cmd + H

Replace in files

↑ Shift + ⌘ Cmd + J

Toggle Search details

↑ Shift + ⌘ Cmd + U

Show Output panel

↑ Shift + ⌘ Cmd + V

Open Markdown preview

⌘ Cmd + K then V

V Open Markdown preview to the side

⌘ Cmd + K then Z

Z Zen Mode (Esc Esc to exit)

Keyboard Shortcut For Commenting In Visual Studio Mac
F9

Toggle breakpoint

F5

Start/Continue

↑ Shift + F5

Stop

F11

Step into

↑ Shift + F11

Step out

F10

Step over

⌘ Cmd + K then ⌘ Cmd + I

Show hover

Control + `

Show integrated terminal

Control + ↑ Shift + `

Create new terminal

⌘ Cmd + C

Copy selection

⌘ Cmd + ↑ ↓

Scroll up/down

Page Up

Scroll page up

Page Down

Scroll page down

⌘ Cmd + Home

Scroll to top

⌘ Cmd + End

Scroll to bottom