用于比较/差异视图的 Eclipse 键盘快捷键?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/907195/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Eclipse keyboard shortcuts for compare/diff view?
提问by David Wolever
When I am comparing two files in Eclipse (using, for example, "Compare With" --> "Local History"), what keyboard shortcuts are available?
当我在 Eclipse 中比较两个文件时(例如,使用“比较”-->“本地历史”),有哪些键盘快捷键可用?
I would like to be able to go to the next/previous diff and copy the selected diff left without having to click the tiny little buttons.
我希望能够转到下一个/上一个差异并将选定的差异复制到左侧,而无需单击微小的按钮。
Thanks!
谢谢!
采纳答案by Artem Barger
Actually you can define whatever you want to be a short cut for this. Preferences->General->Editors->Keys. EDIT: For some reason I don't see that option appears there. O_o
实际上,您可以定义任何您想要的捷径。首选项-> 常规-> 编辑器-> 键。编辑:出于某种原因,我没有看到该选项出现在那里。o_o
回答by VonC
To complete Artem's answer, after Preferences->General->Editors->Keys
, search for:
要完成Artem的回答,在 之后Preferences->General->Editors->Keys
,搜索:
- Select next change
- Select previous change
- Copy from Left to Right
- Copy from Right to Left
- 选择下一个更改
- 选择上一个更改
- 从左到右复制
- 从右到左复制
All those keys in the "Compare
" section have no shortcut assign by default, so you can add the ones of your choice.
Compare
默认情况下,“ ”部分中的所有键都没有分配快捷方式,因此您可以添加您选择的键。
回答by Jeremy D Turpin
Set your own keys as instructed by @Artem and @VonC.
In Eclipse Galileo, however, the path is Window > Preferences > General > Keys
.
按照@Artem 和@VonC 的指示设置您自己的密钥。
然而,在 Eclipse Galileo 中,路径是Window > Preferences > General > Keys
.
For each command you wish to set:
对于您希望设置的每个命令:
Click on the Command Name
TIP: Sort by "Category" to group all "Compare" commands.Click on the "Binding" textbox
Then, select the keys you wish to use, Eclipse will record them for you.
TIP: You can enter a sequence of keys in addition to key combination(s).Set "When" drop down box to "Comparing in an Editor."
TIP: This setting will limit your hot key(s) to only be activate in the chosen context.
单击命令名称
提示:按“类别”排序可将所有“比较”命令分组。单击“绑定”文本框
然后,选择您要使用的键,Eclipse 将为您记录它们。
提示:除了组合键之外,您还可以输入一系列键。将“何时”下拉框设置为“在编辑器中进行比较”。
提示:此设置将限制您的热键仅在所选上下文中激活。
Intuitive Hot Key settings: (my recommendations, not from a standard)
直观的热键设置:(我的建议,不是来自标准)
- Copy All from Left to Right Ctrl+Shift+Left, Ctrl+Shift+Right
- Copy All from Right to Left Ctrl+Shift+Right, Ctrl+Shift+Left
- Copy from Left to Right Ctrl+Left, Ctrl+Right
- Copy from Right to Left Ctrl+Right, Ctrl+Left
- Select next change Ctrl+Down
- Select previous change Ctrl+Up
- 全部从左到右复制Ctrl+Shift+Left,Ctrl+Shift+Right
- 全部从右到左复制Ctrl+Shift+Right,Ctrl+Shift+Left
- 从左到右复制 Ctrl+Left,Ctrl+Right
- 从右到左复制Ctrl+Right,Ctrl+Left
- 选择下一个更改 Ctrl+Down
- 选择上一个更改 Ctrl+Up
回答by zatenzu
With eclipse, when you are in a window and you have a button to do a action but this button doesn't have a tooltip to show you his shortcut, go to Navigate
menu.
The most of time, shortcuts are shown there.
使用 Eclipse,当您在一个窗口中并且有一个按钮可以执行操作但此按钮没有工具提示来显示他的快捷方式时,请转到Navigate
菜单。大多数情况下,快捷方式会显示在那里。
回答by Piotr Dobrogost
There is a catch. There are no Next Difference
and Previous Difference
entries in the key bindings editor. These two buttons in a compare window are bind to Next
and Previous
entries in the key bindings editor. See Is there a key binding for Next Difference and Previous Difference in Eclipse Compare Editor?
有一个问题。键绑定编辑器中没有Next Difference
和Previous Difference
条目。在比较窗口这两个按钮结合Next
和Previous
条目的键绑定编辑器。请参阅Eclipse 比较编辑器中的下一个差异和上一个差异是否有键绑定?
I raised a bug at https://bugs.eclipse.org/bugs/show_bug.cgi?id=401129which can be voted on.
我在https://bugs.eclipse.org/bugs/show_bug.cgi?id=401129提出了一个可以投票的错误。