如何在 VIm 中使用 Eclipse 格式化程序配置文件?

发布于 2024-09-14 19:57:03 字数 81 浏览 0 评论 0原文

我的团队有一个标准的 Eclipse 代码格式化程序配置文件。我更喜欢与 VIm 一起工作。有什么办法可以转换这个文件并将其与 VIm 一起使用吗?

My team has a standard Eclipse code formatter profile. I prefer to work with VIm. Is there any way I can convert this file and use it with VIm?

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

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

发布评论

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

评论(1

随梦而飞# 2024-09-21 19:57:03

您可能只需将 vim 配置为在写入文件时自动运行格式化程序。

从命令行调用格式化程序(google)

<path-to-eclipse>\eclipse.exe -vm <path-to-vm>\java.exe -application
org.eclipse.jdt.core.JavaCodeFormatter -verbose -config
<path-to-config-file>\org.eclipse.jdt.core.prefs
<path-to-your-source-files>\*.java

提示:使用expand("%:p"),您可以获得文件的完整路径...

我希望这有帮助!

You could probably just configure vim to run the formatter automatically when writing your files.

Formatter invocation from the commandline (google):

<path-to-eclipse>\eclipse.exe -vm <path-to-vm>\java.exe -application
org.eclipse.jdt.core.JavaCodeFormatter -verbose -config
<path-to-config-file>\org.eclipse.jdt.core.prefs
<path-to-your-source-files>\*.java

Tip: with expand("%:p") you can get the full path to your file...

I hope this helps!

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