如何转换源代码文件中的缩进量?

发布于 2024-09-03 03:30:57 字数 1539 浏览 2 评论 0原文

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(5

∞琼窗梦回ˉ 2024-09-10 03:30:57

这取决于你使用的是什么。例如,在最新版本的 Visual Studio 中,ctrl-kctrl-d 将格式化整个文档你正在努力。

Vim 中的几个快速命令会将文档中的所有制表符转换为空格。

在命令行中, indent 将重新格式化 C 源代码。

It depends on what you're using. In recent versions of Visual Studio, for instance, ctrl-k,ctrl-d will format the entire document you're working on.

A couple quick commands in Vim will convert all the tabs in a document to spaces.

At the command line, indent will reformat C source code.

第几種人 2024-09-10 03:30:57

UltraEdit 是一个文本编辑器,具有出色的搜索/替换功能,此外您还可以切换空白字符的可见性。将 4 个空格转换为制表符很容易,反之亦然。然而,您可能不希望经常使用它来转换文件,它更像是一个增强型文本编辑器,而不是仅用于制表符/空格重构目的的工具。

UltraEdit is a text editor that has some excellent search/replace capability, plus you can toggle the visibility of whitespace characters. It's easy to convert 4 spaces to a tab, and vice versa. However, it's not something you would probably want to convert files in often, it's more of a text editor on steroids than a tool for just tab/space refactoring purposes.

对不⑦ 2024-09-10 03:30:57

对于C、C++、C#和Java代码,您可以使用艺术风格(astyle)来美化/风格化根据您的喜好设置代码。制表符与空格(以及多少个空格)是许多可用选项之一。

For C, C++, C#, and Java code, you can use Artistic Style (astyle) to beautify/stylize the code according to your preferences. Tabs vs. spaces (as well as how many spaces) are one of many available options.

属性 2024-09-10 03:30:57

你没有说你用哪种语言开发,但我以前用过 Java 的 jalopy 和 Perl 的 perltidy 。

这两个工具都可以设置缩进量和大括号样式等。

You don't say which language your developing in but I've used jalopy for Java and perltidy for Perl before.

Both of these tools you can set indent amount and brace style etc.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文