This documentation is archived and is not being maintained.

Editing Text, Code, and Markup

The Visual Studio Code Editor provides a number of features designed to help you write and edit code. The exact features and their locations vary somewhat, depending upon your development language and your active settings.


The dialog boxes and menu commands you see might differ from those described in Help depending on your active settings or edition. To change your settings, choose Import and Export Settings on the Tools menu. For more information, see Working with Settings.

There are various ways to open a file in the Code Editor:

  • Select a form or module in Solution Explorer and click the View Code button.

  • With a form open in a Design view editor, choose Code from the View menu.

  • Right-click on any control on a Design view surface and choose View Code from the shortcut menu.

  • On the File menu, choose Open File or New File and open a source code file for editing.

The Code Editor also serves as the Source view editor for the HTML Designer and XML Designer, among other.

As you edit Visual Basic, Visual C#, or Visual C++ files in the Code Editor, the language service offers suggestions on how to complete the statements you are writing via IntelliSense. When you open a text document or add a new document to a blank solution, the Code Editor acts as a plain text editor.

When designing applications to run on the UNIX or Macintosh platforms, you can save project files in platform-appropriate document formats. To do this, choose Save As from the File menu, select Save With Encoding from the Save button, and then under Line Endings choose Unix or Macintosh.

Caution noteCaution

If you share files with developers at remote sites who use site-specific encoding, specify an appropriate Unicode encoding page as you save your files. This action helps ensure that your files remain readable to all users. For more information, see How to: Manage File Storage.

Each topic introduces procedures on configuring and using the Code Editor.

Code and Text Editor

Reference topics on the Code Editor, the Bookmarks and Code Definition windows, and the Code Snippet Inserter and Code Snippets Manager.

Editor Convenience Commands and Features

How to manipulate text and code in the editor.

Visual Basic and C# Default Shortcut Keys

Describes the default keyboard shortcut combinations that Visual Basic and C# users can use to perform actions without using a mouse.

How to: Select and Change Text

Information on how to use column mode and continuous stream mode as well as basic text selection information.

How to: Move, Copy, or Store Text

How to use the Toolbox to temporarily store code and controls.

How to: Outline and Hide Code

How to expand and collapse sections of code to increase visibility in the editor.

How to: Debug Code in the Editor

Procedures for tracking errors in code.

How to: Print Code in the Editor

How to use the print options specific to the IDE, such as printing line numbers, retaining collapsed regions, and setting print-only colors to text.

How to: Use Unicode Surrogate Pairs in the Editor

How to enable Unicode surrogates used to display languages such as Chinese and Japanese in the editor.

Line-Break Characters in the Editor

Describes which characters Visual Studio interprets as line breaks.

Using Macros in the Editor

Basic information about using macros to automate tasks in the editor.

These topics provide further guidance on how to use and customize the Code Editor.

Viewing Classes, Members, and Symbols

Describes the keyboard shortcuts for Visual Studio commands according to the user's settings.

Editing Resources

Information about how to use various resource editors when working in Visual C++ code.

Customizing the Editor

Options and settings that adjust the appearance and position of text and code.

Coding Aids

Describes IntelliSense, the Toolbox, Class View, and the Object Browser.