简体   繁体   English

如何在Visual Studio 2008中使格式文档快捷方式适用于C源文件?

[英]How can I make the format document shortcut work for C source files in Visual Studio 2008?

How can I make Ctrl + K + D work in a pure C file? 如何让Ctrl + K + D在纯C文件中工作? I really enjoy the auto formatting in C#, and I would like to have the same functionality in C as well. 我真的很喜欢C#中的自动格式化,我也想在C中使用相同的功能。

I am using Visual Studio 2008, but it would probably be helpful if this worked in Visual Studio 2005 as well. 我正在使用Visual Studio 2008,但如果在Visual Studio 2005中也可以使用它可能会有所帮助。

In Visual Studio 2003, Ctrl + K , Ctrl + F let you format a selection. 在Visual Studio 2003中, 按Ctrl + KCtrl + F可以设置选择的格式。 This and other key combinations to format text can be found in menu EditAdvanced . 可以在菜单编辑高级中找到格式化文本的此组合和其他组合键。

In Visual Studio 2010 and 2008 - the formatting of a selection can be achieved by CTRL+E CTRL+F.. 在Visual Studio 2010和2008中 - 可以通过CTRL + E CTRL + F来实现选择的格式。

I suppose since C/C++ can be peppered with loads of preprocessor directives and defines and such - formatting the entire document would be too difficult to process.. 我想,因为C / C ++可以充满大量的预处理器指令和定义等 - 整个文档的格式化将难以处理。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何使用make file选项在Visual Studio 2005中链接* .c文件? - How can I link *.c files in Visual Studio 2005 using make file option? 如何在 C(visual studio 代码)中运行多个文件? - How can i run multiple files in C (visual studio code)? 我可以在同一个项目 (Visual Studio 19) 中有多个 C 源文件吗? - Can i have multiple C source files in the same project (Visual Studio 19)? 如何使用visual studio 2008重新初始化静态C库中的所有全局变量? - How can I reinitialize all global variables in a static C library using visual studio 2008? 如何使用Visual Studio在C中引用/包括外部源文件/库? - How to reference/including external source files/libraries in C with Visual Studio? 如何在Visual Studio 2008中使用.a lib文件? - How to use .a lib files with Visual Studio 2008? 如何将Visual Studio 2008 Express Edition配置为c89 / c90 / c99? - How can I configure Visual Studio 2008 Express Edition to c89/c90/c99? 如何在Visual Studio 2008中编译C代码? - How to compile C code in Visual Studio 2008? 如何在visual studio c中打印■? - How can I print ■ in visual studio c? 如何将用C编写的源代码从另一个项目包含到我自己的Visual Studio C ++项目中 - How can I include source code written in C from another project into my own project in C++ in Visual Studio
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM