Udostępnij za pośrednictwem


How to: Create Custom Aliases for Visual Studio Commands

Visual Studio commands provide a means of interacting with the integrated development environment (IDE) from the keyboard. Dialog boxes, windows, and other items within the IDE have a command equivalent that you can type into the Command Window or the Find/Command Box to display and, in some cases, execute the item. You can create custom names, or aliases, for complete command names to help you remember and enter the commands more easily.

To create an alias for a Visual Studio command

  1. Open the Command window or place the focus in the Find/Command box.

  2. Type >alias, then the name for the alias, followed by the command you want to create an alias for. For example:

    >alias MyAlias File.NewFile MyFile
    
  3. Press ENTER.

    The status bar displays the text "Alias <aliasname> created". The new alias now appears in the auto-completion list for commands.

To delete an alias for a Visual Studio command

  1. Open the Command window or place the focus in the Find/Command box.

  2. Type >alias, then the name of the alias, followed by /delete. For example:

    >alias myalias /delete
    
  3. Press ENTER.

    The status bar displays the text "Alias <aliasname> deleted".

To view a list of all current aliases and their definitions

  • In the Command window, type >alias and press ENTER.

    A list of the current Visual Studio command aliases appears, including the definitions for the aliases. You can then print the contents of the Command window.

    Tip

    To clear the contents of the Command window, type >cls.

To view the definition for a single alias

  • In the Command window, type >alias followed by the alias name.

See Also

Reference

Visual Studio Commands and Switches

Predefined Visual Studio Command Aliases

Immediate Window

Alias Command

Other Resources

Customizing the Development Environment