从命令行打开 JEdit JDiff-Plugin
我使用 JEdit 和 JDiff 插件进行文件比较。现在我想使用命令行参数从另一个工具打开 JDiff 插件。这可能吗?到目前为止,我只能在 JEdit 中打开我想要比较的 2 个文件。
I am using JEdit with the JDiff plugin for file compares. Now I would like to open the JDiff plugin from another tool using command line parameters. Is this possible? So far I was only able to open the 2 files i want to compare in JEdit.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
这几乎有效......我只是无法让宏在加载其他文件后执行...
将此宏放入文件中。
如果您使用的是 Linux 或 Mac,请将其放入
~/.jedit/macros/split_wins_and_jdiff.bsh
中。如果您使用的是 Windows,请将其放在某个地方...(c:/split_wins_and_jdiff.bsh
也许?)然后运行:
问题是,我无法让宏在之后运行 初始化,因此该方法会导致错误。如果您可以执行两步过程,那么您可以执行以下操作:
安装
~/.jedit/macros
, mac)如何 使用
每当您想要快速 jdiff 两个文件时 :
* 打开这两个文件:
没有宏
顺便说一句,如果您为 JDiff 创建快捷方式,则无需宏即可完成所有这些操作(对我来说是 ctrl+shift+ d, d)
打开两个文件:
java -jar jedit.jar -noserver -norestore file_on_left file_on_right
垂直分割屏幕
ctrl+3
右屏幕(现在在分割后被选中),使用 ctrl+page-up 循环到另一个缓冲区。
使用快捷键打开 JDiff(对我来说 ctrl+shift+d、d)
) jedit 非常简单。您只需记录它们,它们就会在新的缓冲区中弹出,您可以在其中查看实际的宏代码。这就是我创建宏所做的事情。尝试探索宏菜单和宏用法。
This almost works..... I just can't get the macro to execute after the other files are loaded...
Put this macro in a file.
If you on Linux or Mac, put it in
~/.jedit/macros/split_wins_and_jdiff.bsh
. If you're on Windows, put it someplace... (c:/split_wins_and_jdiff.bsh
maybe?)Then run:
The problem is, I can't get the macro to run after initialization, so that method results in an error. If you're ok with doing a two step process, then you could do:
Setup
~/.jedit/macros
for linux, mac)How to Use
Whenever you want to quickly jdiff two files:
* Open the two files:
Without Macros
Btw, you can do all this without the macro, if you create a shortcut for JDiff ( for me it is ctrl+shift+d, d)
Open the two files:
java -jar jedit.jar -noserver -norestore file_on_left file_on_right
Split the screens vertically
ctrl+3
On the right screen ( which is now selected after the split), cycle to the other buffer with ctrl+page-up.
Turn on JDiff with your shortcut ( for me ctrl+shift+d, d)
Creating macros in jedit is dead simple. You can simply record them and they'll popup in a new buffer where you can view the actual macro code. This is what I did to create the macro. Try exploring the macro menu and macro usage.
我意识到这是一个老问题,但前几天我遇到了这个问题。我建立在运行豆壳脚本的想法之上,就像罗斯的回答一样。我相信我已经让一切正常工作(无需手动运行宏),并且我想在这里做出贡献来表示“感谢”引导我走向正确的方向。
这是我让 jEdit 从命令行进行 diff 的整个设置,其中包括使用 jEdit 作为Git 的“difftool”。
PS:我想让这是罗斯答案的后续,但我是新来的,并没有意识到我需要货币来评论答案。
I realize this is an old question, but I ran into this the other day. I built on the idea of running a beanshell script like in Ross' answer. I believe I got everything to work (without having to manually run the macro), and thought I'd contribute here to say "thanks" for steering me in the right direction.
Here's my whole setup for getting jEdit to diff from the command line, and it includes using jEdit as the "difftool" for Git.
PS: I wanted to make this a follow-up to Ross' answer, but I'm new here, and didn't realize I needed currency to comment on an answer.