一个漂亮的打印机“全部统治" [英] one pretty printer "to rule them all"

查看:81
本文介绍了一个漂亮的打印机“全部统治"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在寻找一种可以用尽可能多的语言漂亮地打印(又称整洁或美化)源代码的工具.我特别热衷的对象包括:

I'm looking for a tool that can pretty-print (AKA tidy or beautify) source code in as many languages as possible. Those I'm particularly keen on include:

  • Java
  • JSP
  • HTML
  • JavaScript
  • SQL
  • JSON
  • XML

理想情况下,该工具应该能够就地更新源文件,并且一次可以格式化多个文件.如果它可以格式化包含多种语言的文件(例如,包含HTML,Java和JavaScript源代码的JSP),那将是很好的选择,但这可能会要求很多.

Ideally, the tool should be able to update source files in-place and be able to format more than a single file at-a-time. It would be great if it could format files containing multiple languages (e.g. a JSP containing HTML, Java, and JavaScript source code), but that's probably asking for a bit much.

我已经找到了一个商业工具,该工具似乎涵盖了许多语言,但是是免费的会更好:)

I've already found a commercial tool that seems to cover a lot of languages, but a free one would be even better :)

顺便说一句,我知道有一种漂亮的打印机可用于大多数语言,但是我要寻找的是一站式商店".

BTW, I know there is a pretty printer available for most languages, but what I'm looking for is a "one-stop shop".

干杯, 唐

推荐答案

我一直使用Vim进行此操作.它不能很好地处理HTML,但其他语言则可以.使用Vim命令可以很容易地在多个文件上自动运行它.

I use Vim to do this all the time. It doesn't handle HTML very well, but it does the others. It's easy to use the Vim commands to automate running it on a number of files.

这篇关于一个漂亮的打印机“全部统治"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆