Visual Studio For Mac Key Bindings



  1. Visual Studio Code For Mac
  2. Emacs Key Bindings Visual Studio
  3. Visual Studio Keybinds

Emmet Keybindings for VS Code. Practical keybindings for Emmet on VS Code. Balance (Outward/Inward) Balance (Outward / Inward): Mac: Cmd + M O / Cmd + M I. Issue Type: Feature Request You can set Visual Studio on mac to use same key bindings as Visual Studio on windows. It would be nice if you could configure Visual Studio Code on mac + windows to use the same key bindings as Visual Studio.

Visual studio mac keyboard shortcutsMac

Working with code, there are some operations that are repeated many times every day, hour or even minute. Knowing (and creating) shortcut keys for those operations not only saves time, but keeps focus on the code. Reaching for the mouse might not take much longer time, but it switches the brain over to mouse-control mode and when doing that, some of the code context kept in mind is lost.

These are my favourite key bindings, both standard and non standard.

  • Global go to file/symbol on Ctrl+,. Brings up a small search box in the current windows for quick navigation to any source file, class or method in the solution. With VS2013 this got considerable better as it no longer brings up a large dialog box.
  • Go to current file in solution explorer on Ctrl+´, S. A somewhat awkward chord, but really useful to quickly get to the current file in the solution explorer. This is also the fastest and best way to do a rename of a class. Select the file in solution explorer, hit F2 to rename the file and Visual Studio will automatically prompt you about renaming the class and all references to it.
  • When coding, I usually split the window into two vertical tab groups, to view two code files at the same time. Most of the time one is the current test case and the other is the implementation (yes I’m a TDD fan). Two custom bindings that I use a lot with the split window are Ctrl+Alt+Left and Ctrl+Alt+Right to move the active windows to the previous or the next tab group.

Did I mention that I love TDD? That means that the key bindings related to running tests are among those I use most.

  • Ctrl+R, A runs all the tests in the current solution.
  • Ctrl+R, T runs all the tests in the current context. Place the caret in a test method and hit his chord to run the test. Place the caret in a test class, but not inside any of the test methods, to run all tests in that class.
  • Ctrl+R, Ctrl+T debugs all the tests in the current context. Typically used when a test case fails in an unexpected way. Place the caret in the failing test, hit this chord and you’re debugging the right piece of code immediately.
  • Last but not least among the test related is the custom Ctrl+§, T that I use to bring up the test explorer. Doing TDD the test explorer is of course one of the most important windows and it has to be easily accesible. The standard meaning of this binding is to bring up the task list but 1. I never use the task list and 2. It is bound to Ctrl+§, Ctrl+T too.
-->

You can identify keyboard shortcuts for Visual Studio commands, customize those shortcuts, and export them for others to use. Many shortcuts always invoke the same commands, but the behavior of a shortcut can vary based on the following conditions:

  • Which default environment settings you choose the first time that you open Visual Studio—for example, General Development or Visual C#. (For information about changing or resetting your settings, see Environment settings.)

  • Whether you've customized the shortcut's behavior.

  • Which context you're in when you choose the shortcut. For example, the F2 shortcut invokes the Edit.EditCell command if you're using the Settings Designer and it invokes the File.Rename command if you're using Team Explorer.

Regardless of settings, customization, and context, you can always find and change a keyboard shortcut in the Options dialog box. You can also look up the default keyboard shortcuts for several dozen commands in Popular keyboard shortcuts. For a complete list of all default shortcuts (based on the General Development settings), see All keyboard shortcuts.

If a shortcut is assigned to a command in the Global context and no other contexts, that shortcut will always invoke that command. But a shortcut can be assigned to one command in the Global context and a different command in a specific context. If you use such a shortcut when you're in the specific context, the shortcut invokes the command for the specific context, not the Global context.

Visual Studio Code For Mac

Note

Your settings and edition of Visual Studio might change the names and locations of menu commands and the options that appear in dialog boxes. This page is based on the General Development settings profile.

Identify a keyboard shortcut

  1. On the menu bar, choose Tools > Options.

  2. Expand Environment, and then choose Keyboard.

  3. In the Show commands containing box, enter all or part of the name of the command without spaces.

    For example, you can find commands for solutionexplorer.

  4. In the list, choose the correct command.

    For example, you can choose View.SolutionExplorer.

  5. If the command has a keyboard shortcut, it appears in the Shortcut(s) for selected command list.

Customize a keyboard shortcut

  1. On the menu bar, choose Tools > Options.

  2. Expand Environment, and then choose Keyboard.

  3. Optional: Filter the list of commands by entering all or part of the name of the command, without spaces, in the Show commands containing box.

  4. In the list, choose the command to which you want to assign a keyboard shortcut.

    In the Use new shortcut in list, choose the feature area in which you want to use the shortcut.

    For example, you can choose Global if you want the shortcut to work in all contexts. You can use any shortcut that isn't mapped (as Global) in another editor. Otherwise, the editor overrides the shortcut.

    Note

    You can't assign the following keys as part of a keyboard shortcut in Global:

    • Enter, Tab, Caps Lock
    • Print Scrn/Sys Rq, Scroll Lock, Pause/Break
    • Insert, Home, End, Page Up, Page Down
    • The Windows logo key, the Application key, any of the Arrow keys
    • Num Lock, Delete, or Clear on the numeric keypad
    • The Ctrl+Alt+Delete key combination
  5. In the Press shortcut key(s) box, enter the shortcut that you want to use.

    Note

    You can create a shortcut that combines a letter with the Alt key, the Ctrl key, or both. You can also create a shortcut that combines the Shift key and a letter with the Alt key, the Ctrl key, or both.

    If a shortcut is already assigned to another command, it appears in the Shortcut currently used by box. In that case, choose the Backspace key to delete that shortcut before you try a different one.

  6. Choose the Assign button.

    Note

    If you specify a different shortcut for a command, click Assign, and then click Cancel to close the dialog box, the shortcut you assigned is not reverted.

Share custom keyboard shortcuts

You can share your custom keyboard shortcuts by exporting them to a file and then giving the file to others so that they can import the data.

To export only keyboard shortcuts

  1. On the menu bar, choose Tools > Import and Export Settings.

  2. Choose Export selected environment settings, and then choose Next.

  3. Under What settings do you want to export?, clear the All Settings check box, expand Options, and then expand Environment.

  4. Select the Keyboard check box, and then choose Next.

  5. In the What do you want to name your settings file and Store my settings file in this directory boxes, either leave the default values or specify different values, and then choose Finish.

By default, your shortcuts are saved in a file in the %USERPROFILE%DocumentsVisual Studio 2017Settings folder. The name of the file reflects the date when you exported the settings, and the extension is .vssettings.

Emacs Key Bindings Visual Studio

By default, your shortcuts are saved in a file in the %USERPROFILE%DocumentsVisual Studio 2019Settings folder. The name of the file reflects the date when you exported the settings, and the extension is .vssettings.

To import only keyboard shortcuts

Visual Studio Keybinds

Visual studio for mac os
  1. On the menu bar, choose Tools > Import and Export Settings.

  2. Choose the Import selected environment settings option button, and then choose Next.

  3. Choose the No, just import new settings, overwriting my current settings option button, and then choose Next.

  4. Under My Settings, choose the file that contains the shortcuts that you want to import, or choose the Browse button to locate the correct file.

  5. Choose Next.

  6. Under Which settings do you want to import?, clear the All Settings check box, expand Options, and then expand Environment.

  7. Select the Keyboard check box, and then choose Finish.

See also