Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Visual Studio Format entire file?

Is there a way to issue a key command to properly format an entire file in VS2008 with CodeRush Express?

like image 222
RCIX Avatar asked Sep 16 '09 21:09

RCIX


People also ask

How do I format all files in Visual Studio Code?

VS Code has great support for source code formatting. The editor has two explicit format actions: Format Document (Ctrl+Shift+I) - Format the entire active file. Format Selection (Ctrl+K Ctrl+F) - Format the selected text.

What is shortcut formatting the entire document in Visual Studio?

In an existing project, open the document that you want to format, right-click inside the document, and select Format Document. In the default configuration for Visual Studio Code, the command can be run using the shortcut Alt+Shift+F.

How do I tidy up code in Visual Studio?

Right-click on the project or solution name in Solution Explorer, select Analyze and Code Cleanup, and then select Run Code Cleanup.

How do I format a .CS file?

You can open and edit CS files with Visual C#, a Microsoft Visual Studio component. You can also edit the files with various other source code editors that feature syntax highlighting, such as the cross-platform Microsoft Visual Studio Code.


1 Answers

Use Ctrl+K+Ctrl+D to format document keystroke

Use Ctrl+K+Ctrl+F to format selection keystroke

It's also possible to set your own keystrokes by opening Options... dialog (select Tools->Options from the menu). In Options dialog select Environment->Keyboard form the tree and set your own shortcuts for Edit.FormatDocument.

like image 61
Vadim Avatar answered Sep 25 '22 03:09

Vadim