Eclipse HotKey:如何在选项卡之间切换?
如何在 Eclipse 中打开的窗口之间切换?有 Ctrl+F6,但它问我想要哪一个,但我想像浏览器中的选项卡或操作系统中的窗口一样切换它(Cmd/Win+Tab),无需从列表中选择文件。如何在 Eclipse 中完成这个简单的事情?
我尝试为事件分配热键:
- 转发
- 历史记录
- 下一页
,但它不能按我想要的方式工作。
How can I switch between opened windows in Eclipse? There is Ctrl+F6, but it's asking me which one I want, but I want switch it like tabs in browser or window in operating system (Cmd/Win+Tab) without file-selection from the list. How to do this easy thing in Eclipse?
I've tried to assign hotkey for events:
- forward
- forward history
- next page
but it doesn't work the way I want.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(24)
您可以为“下一个编辑器”键分配另一个快捷键。
是两个官方快捷方式,但它们都涉及显示列表。
CTRL+Page Up / CTRL+Page Down 可以在编辑器之间循环而不显示列表。
最后一组快捷键的有趣之处在于:
它们未在要定义的 Eclipse Keys 快捷键中列出。
它们可能是从多页编辑器继承的,使它们成为操作系统特定的快捷方式。
关于 Mac OS (OSX) 上的快捷方式,Matt Ball 在 2011 年 9 月抱怨无法重新映射CTRL+向上翻页/CTRL+向下翻页:
好吧,2012 年 3 月,Arthur 回复道:
马特·鲍尔确认:
他导出的首选项可在此处供您尝试。
导入后,您应该看到所有相关类型的文档:
You can assign another shortcut to the 'Next Editor' key.
are the two official shortcuts, but they both involve a list being displayed.
CTRL+Page Up / CTRL+Page Down can cycle through editors without displaying a list.
What is interesting with that last set of shortcuts is:
they are not listed in the Eclipse Keys shortcuts to be defined.
They may be inherited from the multipage editor, making them an OS specific shortcut.
Regarding shortcuts on Mac OS (OSX), Matt Ball complained in Sept. 2011 to not being able to remap CTRL+Page Up/CTRL+Page Down:
Well, in March 2012, Arthur replied:
Matt Ball confirms:
His exported preferences are available here for you to try.
Once imported, you should see, for all the relevant types of document:
如果您进入首选项(例如窗口→首选项)并查看常规→按键
,然后搜索“下一个选项卡”和“上一个选项卡”,您可以重新映射它们。
If you go to Preferences (e.g. Window→Preferences) and view General→Keys
and then search for “Next Tab” and “Previous Tab”, you can remap them.
在操作系统中像Windows一样切换(转到最后一个获得焦点的窗口)
CTRL-F6在Eclipse中,就像< strong>ALT-TAB(在 Windows 上),显示可用选项卡/窗口的列表(如果您保留 CTRL< /kbd> / ALT 键被按下)并突出显示当您放开此键时将跳转到的位置。您不必选择该窗口。如果您想一次遍历多个选项卡,请按住 CTRL 按钮并点击 TAB 按钮。这与 Windows 上的 ALT-TAB 行为相同。
从这个意义上来说,eclipse中的CTRL-SHIFT-F6就是ALT-SHIFT-TAB 模拟。就我个人而言,我将 Eclipse 中的这些绑定更改为与 Visual Studio 类似。即 CTRL-TAB 和 CTRL-SHIFT- TAB,我这样做:
Window>Preferences>General>Keys
然后设置“Next Editor”=Ctrl+Tab 和“上一个编辑器”=Ctrl+Shift+Tab。在设置新绑定之前,不要忘记单击“取消绑定命令”。
像浏览器一样切换(转到当前选项卡右侧的选项卡)
这是CTRL-PageDown向右转, CTRL-PageUp 向左移动。令人沮丧的是,当您到达选项卡列表的末尾(例如最右边的选项卡)然后尝试再次向右移动时,Eclipse 不会像大多数浏览器那样循环到第一个选项卡(最左边)。
Switch like Windows in OS (go to window which last had focus)
CTRL-F6 in Eclipse, like ALT-TAB (on windows), brings up a list of tabs/windows available (if you keep the CTRL / ALT key depressed) and highlights the one you will jump to when you let go of this key. You do not have to select the window. If you want to traverse several tabs at once hold down the CTRL button and tap the TAB button. This is identical behaviour to ALT-TAB on Windows.
In this sense, CTRL-SHIFT-F6 in eclipse is the ALT-SHIFT-TAB analog. Personally, I change these bindings in Eclipse to be like Visual Studio. I.e. CTRL-TAB and CTRL-SHIFT-TAB and I do it like this:
Window>Preferences>General>Keys
Then set "Next Editor"=Ctrl+Tab and "Previous Editor"=Ctrl+Shift+Tab. Don't forget to click "Unbind Command" before setting the new binding.
Switch like browser (go to tab on the right of current tab)
This is CTRL-PageDown to go right, CTRL-PageUp to go left. Frustratingly, when you get to the end of the list of tabs (say far right hand tab) and then try to go right again Eclipse does not cycle round to the first tab (far left) like most browsers would.
您可以使用 ALT+向左 转到上一个选项卡,或使用 ALT+向右 前进。不过,此方法使用像历史记录一样的选项卡切换,因此它将转到您打开的上一个选项卡,如果您“后退”一次或多次,则它将前进。我知道有点奇怪,但它确实有效。您始终可以通过单击每个选项卡一次来“重置”历史记录。
You can use ALT+Left to go to your previous tab, or ALT+Right to go to forward. This method is using tab-switching like history, though, so it will go to the previous tab you had open, and forward if you've gone "back" once or more. A bit weird, I know, but it works. You can always "reset" the history by clicking through every tab once.
右
侧移动:Ctrl + 向下翻页左
侧移动: CTRL + 向上翻页其他
Eclipse 其他快捷方式
Right
side move : Ctrl + page DownLeft
side move : CTRL + page UpAdditional
Eclipse others Short Cuts
CTRL + F6 很好用。如果您想切换到下一个/上一个选项卡,您需要执行 CTRL+Page Down / CTRL+Page Up kbd>。
CTRL + F6 is good to use. If you want to switch to next/previous tab, you need to do CTRL+Page Down / CTRL+Page Up.
默认为 Ctrl + F6。您可以通过转到窗口首选项来更改它。我通常将其更改为 Ctrl + Tab,这与我们在浏览器和其他内容中切换选项卡时使用的相同。
The default is Ctrl + F6. You can change it by going to Window preferences. I usually change it to Ctrl + Tab, the same we use in switching tabs in a browser and other stuff.
返回上一个选项卡的快捷键
Alt + LeftArrow 返回。
Shortcut key to back to the previous tab
Alt + LeftArrow to go back.
第二次按 CTRL + TAB 打开
使用 RCP Eclipse 关闭另一个编辑器并关闭以前的编辑器。
M1 表示 CTRL
M2 表示 SHIFT
you press CTRL + TAB second time to open
another editor and close previous editor using RCP Eclipse.
M1 means CTRL
M2 means SHIFT
3 行 AutoHotKey 脚本(无论如何,在 Windows 上):
将其放入启动文件夹中(另存为 *.ahk,必须安装 AutoHotKey),Eclipse 选项卡现在将像 Chrome 或 Firefox 一样工作。
3 line AutoHotKey script (on Windows, anyway):
Put this in your startup folder (save it as *.ahk, must have AutoHotKey installed) and Eclipse tabs will now work like Chrome or Firefox.
解决了!!
将方案更改为 Microsoft Visual Studio
窗口 > 首选项 > 常规 > 键
查找方案下拉列表
我的 eclipse 版本:
适用于 Web 开发人员的 Eclipse Java EE IDE。
版本:Juno 服务版本 1
内部版本号:20120920-0800
Solved!!
Change Scheme to Microsoft Visual Studio
Window>Preferences>General>Keys
Look for Schemes dropdown
My eclipse version:
Eclipse Java EE IDE for Web Developers.
Version: Juno Service Release 1
Build id: 20120920-0800
没有人会读我的答案,但无论如何......如果您使用的是 Mac OS X,您会喜欢在 Eclipse 中进行历史导航的多点触摸手势:
Nobody will ever read my answer, but anyway... If you are on Mac OS X you will love multi touch gestures for history navigation in Eclipse: http://sourceforge.net/apps/mediawiki/eclipsemultitch/
在 Windows 上,如果您有 5 键鼠标,则可以使用前进和后退来代替 ALT+Left 和 ALT+Right。
On windows if you have a 5 button mouse, you can use forward and back in lieu of ALT+Left and ALT+Right.
从右到左:ctrl+ shift + 9 或 ctrl + shift + < kbd>Page Up 或 ctrl + Page Up
从左到右:ctrl + shift + < kbd>3 或 ctrl + shift + Page Down 或 ctrl + Page Down
Right to left : ctrl+ shift + 9 or ctrl + shift + Page Up or ctrl + Page Up
Left to right : ctrl + shift + 3 or ctrl + shift + Page Down or ctrl + Page Down
一种方法是使用 VI 插件,然后你只需执行 :n (和 :N) 在文件之间切换。
这就是我所做的。
One way to do it is to use the VI Plugin, and then you just do :n (and :N) to go between files.
That's what I do.
您可以在“首选项”->“热键”中设置热键。一般->键(或者只需在“首选项”对话框顶部的筛选字段中键入“键”。
选择“键”部分后,找到“下一个选项卡”和“上一个选项卡”,然后通过单击“绑定”字段然后键入来为它们分配您自己的热键 点击“应用”或“确定”
即可完成该过程。
You can set the hotkeys in Preferences -> General -> Keys (or just type "keys" into the filter field at the top of the Preferences dialog.
Once the Keys section is selected, find Next Tab and Previous Tab and assign them your own hotkey by clicking in the "Binding" field and then typing your hotkeys.
Hit Apply or OK to finish the process.
如果您只想在当前和以前的选项卡选择之间切换,请使用 CTRL + F6 来来回切换。要导航到历史记录中更早的选项卡,您需要在编辑器窗口打开时使用 UP / DOWN 键。这适用于 Helios (Eclipse 3.6);不确定旧版本的 Eclipse 是否也是如此。
If you want to simply switch between your current and your previous tab selections, using CTRL + F6 will switch you back and forth. To navigate to a tab further back in your history, you need to use the UP / DOWN keys while the Editors window is open. This works with Helios (Eclipse 3.6); not sure if this is true for older versions of Eclipse.
我引用 VonC 的回复,补充一些内容。
加上,都有Bug 206299 打开请求使用 Ctrl+Tab 来切换选项卡而不是 Ctrl+< kbd>PgUp(PgDn)。
如果不满意,您可以为自己分配键绑定,从 Window >首选项>一般>钥匙。
I quote VonC response, adding something.
Plus, there is Bug 206299 open to request using Ctrl+Tab for switching tabs instead of Ctrl+PgUp(PgDn).
If not satisfied, you can assign yourself the Key Binding, from Window > Preferences > General > Keys.
由于某种原因,我的 Eclipse 设置已损坏,因此我必须手动编辑文件 /.plugins/org.eclipse.e4.workbench/workbench.xmi
我之前必须设置过 Ctrl+Tab 到类似于浏览器的选项卡切换,甚至重置 Eclipse 首选项中的所有键绑定也不会摆脱快捷方式(它们也没有显示在任何地方)。我打开上述文件并删除了与不起作用的快捷方式相关的标有
type:user
的
元素。For some reason my Eclipse settings were corrupted so I had to manually edit the file /.plugins/org.eclipse.e4.workbench/workbench.xmi
I must have previously set Ctrl+Tab to Browser-like tab switching, and even resetting all key bindings in Eclipse preferences wouldn't get rid of the shortcuts (they were not displayed anywhere either). I opened the above mentioned file and removed the
<bindings>
elements marked with<tags>type:user</tags>
related to the non-functioning shortcuts.按住 CTRL 并按 F6 直到到达所需的编辑器,然后松开。 UI 不如窗口选择那么漂亮,但功能是相同的。
Hold CTRL and press F6 until you reached the editor you want, then release. The UI is not as pretty as the window selection, but the functionality is the same.
在 SLES12 计算机上,默认情况下,您可以使用 Ctrl+PageUp 和 Ctrl+PageDown 在选项卡之间导航。您始终可以通过浏览“常规”类别下的“按键”部分,从“首选项”窗口更改这些按键。
上面 Victor 和 VonC 很好地解释了这个过程。
On a SLES12 machine you can use Ctrl+PageUp and Ctrl+PageDown to navigate between tabs by default. You can always change these keys from Preferences window by browsing through "keys" section under "General" category.
This process is well explained by Victor and VonC above.
CTRL+F7 中打开的窗口之间进行切换 - Eclipse Photon on Windows。
CTRL+F7 works here - Eclipse Photon on Windows.
由于某种原因,仅添加新绑定似乎不起作用(eclipse 2021-06)。
相反:
复制命令
克隆下一个选项卡
和上一个选项卡
在Windows中
应用并关闭
@Gillfish 在另一个答案的评论中提到了这一点,但我认为最好明确地显示解决方案。
For some reason, just adding a new binding doesn't seem to work (eclipse 2021-06).
Instead:
Copy Command
to cloneNext Tab
andPrevious Tab
In Windows
Apply and Close
@Gillfish mentioned this in a comment on another answer, but i thought its better to surface the solution explicitly.
2022-03 之前的 Eclipse 版本过去使用 CTRL + Tab 按 LRU 顺序在编辑器之间切换,与 CTRL + 相同E - 我相信它具有相同的功能。从 2022 版本开始,不再出现这种情况,使用 CTRL + Tab 而是使用移动到不同的窗格(即从编辑器移动到底部窗格,或从底部窗格到侧栏之一)。
在任何一种情况下, CTRL + Tab 都不会在 Windows-> 首选项 -> 常规 -> 键配置对话框中显示为已使用的绑定 - 看起来进行硬编码。
这真的让我很恼火,因为我非常习惯使用 CTRL + Tab 在多选项卡应用程序中切换选项卡,无论如何,它是比 CTRL + E。
我的解决方案是进入按键配置对话框并将“快速切换编辑器”快捷方式从 CTRL + E 替换为 CTRL + 选项卡。
“快速切换编辑器”基本上就是我所需要的——按一次然后快速释放,你就回到之前使用的编辑器;按一次并按住修饰符 - 您将看到一个菜单,您可以在其中按 LRU 顺序导航到不同的编辑器。
Versions of Eclipse up to 2022-03 used to have CTRL + Tab switch between editors in an LRU order, same as CTRL + E - I believe it was the same functionality. Starting with the 2022 versions, this was no longer the case with CTRL + Tab instead using to move to a different pane (i.e. move from the editor to the bottom pane, or from the bottom pane to the one of the side bars).
In either case, the CTRL + Tab isn't shown as a used binding in the Windows->Preferences->General->Keys configuration dialog - it seems to be hard-coded.
It really annoyed me because I'm very used to using CTRL + Tab to switch tabs in a multi-tab application and regardless, it is a much easier shortcut than CTRL + E.
My solution was to go into the keys configuration dialog and replace the "Quick Switch Editor" shortcut from CTRL + E to CTRL + Tab.
The "Quick Switch Editor" is basically what I need - press once and quickly release, and you go back to the previously used editor; press once and hold the modifier - you get a menu where you can navigate to a different editor in LRU order.