Visual Studio Format entire file?

前端 未结 8 1750
小鲜肉
小鲜肉 2021-01-31 08:58

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

相关标签:
8条回答
  • 2021-01-31 09:06

    Ctrl+K,Ctrl+D

    This question with answers has a lot of handy tips.

    0 讨论(0)
  • 2021-01-31 09:11

    If Ctrl+E+Ctrl+D or Ctrl+K+Ctrl+D or Ctrl+K+Ctrl+F doesn't work for you, try to set below settings:
    Tools->Options -> Text Editor ->C# ->Tabs,
    make sure `Keep tabs is selected.
    Then, go back to your text editor, re-try formatting.

    I was really annoyed before, and steps above works for me. hope it works for you guys..

    0 讨论(0)
  • 2021-01-31 09:13

    You could always go to Tools -> Options -> Keyboard and give the Edit.FormatDocument a new shortcut.

    Update You can also see what the Shortcuts mapped to this command are this way.

    0 讨论(0)
  • 2021-01-31 09:15

    Just select all content of page by Ctrl + A then click Ctrl + K and Ctrl + D. The whole page tag format.

    For example see this link: Format the content

    0 讨论(0)
  • 2021-01-31 09:17

    Shortcut in visual studio to format the whole document is Ctrl + E, D

    0 讨论(0)
  • 2021-01-31 09:18

    I just use built-in Visual Studio formatting command: Ctrl+A, Alt+F8

    0 讨论(0)
提交回复
热议问题