简体   繁体   English

Eclipse HotKey:如何切换标签页?

[英]Eclipse HotKey: how to switch between tabs?

How can I switch between opened windows in Eclipse?如何在 Eclipse 打开的 windows 之间切换? 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.Ctrl + F6 ,但它问我想要哪个,但我想像浏览器中的选项卡或操作系统中的 window ( Cmd / Win + Tab ) 一样切换它,而不需要从列表中选择文件。 How to do this easy thing in Eclipse?如何在 Eclipse 中完成这件简单的事情?

I've tried to assign hotkey for events:我试图为事件分配热键:

  • forward向前
  • forward history转发历史
  • next page下一页

but it doesn't work the way I want.但它不按我想要的方式工作。

  • CTRL + E (for a list of editor) CTRL + E (用于编辑器列表)
  • CTRL + F6 (for switching to the next editor through a list) CTRL + F6 (用于通过列表切换到下一个编辑器)
    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. CTRL + Page Up / CTRL + Page Down可以在不显示列表的情况循环浏览编辑器。

What is interesting with that last set of shortcuts is:最后一组快捷方式的有趣之处在于:
they are not listed in the Eclipse Keys shortcuts to be defined.它们未列在要定义的 Eclipse Keys 快捷方式中。
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 :关于 Mac OS (OSX) 上的快捷方式, Matt Ball在 2011 年 9 月抱怨无法重新映射CTRL + Page Up / CTRL + Page Down

It drives me nuts to not be able to flip through open tabs as I can in pretty much every other tabbed program in OS X ( - Left and - Right ).它让我发疯,无法像在 OS X 中的几乎所有其他选项卡式程序( - Left - Right )中那样翻阅打开的选项卡。

Well, in March 2012, Arthur replied:好吧,在 2012 年 3 月,亚瑟回答说:

, I've just downloaded the latest version of Eclipse (3.7+). ,我刚刚下载了最新版本的 Eclipse (3.7+)。 I've been able to bind "Previous/Next tab" to ( - Left and - Right ) when in Editor, which I'm pretty sure I couldn't do before.在编辑器中时,我已经能够将“上一个/下一个选项卡”绑定到( - Left - Right ),我很确定我以前做不到。
So I guess they heard you.所以我猜他们听到了你的声音。
It works just as you expect, tabs going from left to right and vice-versa, not on a history basis or some nonsense like that.它按您的预期工作,标签从左到右,反之亦然,而不是基于历史或类似的废话。

Matt Ball confirms:马特鲍尔确认:

oh wow, selecting "Editing Java Source" actually worked !哦,哇,选择“编辑 Java 源代码”确实有效
Now, unfortunately this means that I'm SOL if I nav into a non-Java file (JSP, XML, JS, etc.).现在,不幸的是,这意味着如果我导航到非 Java 文件(JSP、XML、JS 等),我就是 SOL。
The fix for this is to "copy command" for this pair, and select all the "whens" that I want .对此的解决方法是为此对“复制命令”,并选择我想要的所有“时间”
So far it's at least working beautifully for Java and JSP files.到目前为止,它至少对 Java 和 JSP 文件工作得很好。
This is a major PITA to set up, but it's just a one-time thing.这是一个主要的 PITA 设置,但这只是一次性的事情。

His exported preferences are available here for you to try.导出的首选项可在此处获得,供您试用。
Once imported, you should see, for all the relevant types of document:导入后,您应该会看到所有相关类型的文档:

Mac Os 键绑定

If you go to Preferences (eg Window→Preferences) and view General→Keys如果您转到首选项(例如窗口→首选项)并查看常规→键

and then search for “Next Tab” and “Previous Tab”, you can remap them.然后搜索“下一个标签”和“上一个标签”,您可以重新映射它们。

Eclipse 首选项中的 Next Tab 命令,在重新绑定之前

Switch like Windows in OS ( go to window which last had focus )像操作系统中的 Windows 一样切换(转到最后具有焦点的窗口

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. CTRL - F6在 Eclipse 中,就像ALT - TAB (在 Windows 上)一样,会显示可用的选项卡/窗口列表(如果您按住 CTRL / ALT键)并突出显示当您松开此键时将跳转到的那个. 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.如果您想一次遍历多个选项卡,请按住CTRL按钮并点击TAB按钮。 This is identical behaviour to ALT - TAB on Windows.这与 Windows 上的ALT - TAB 的行为相同。

In this sense, CTRL - SHIFT - F6 in eclipse is the ALT - SHIFT - TAB analog.从这个意义上说,Eclipse 中的CTRL - SHIFT - F6ALT - SHIFT - TAB模拟。 Personally, I change these bindings in Eclipse to be like Visual Studio.就个人而言,我将 Eclipse 中的这些绑定更改为类似于 Visual Studio。 Ie CTRL - TAB and CTRL - SHIFT - TAB and I do it like this:CTRL - TABCTRL - SHIFT - TAB和我这样做:

Window>Preferences>General>Keys窗口>首选项>常规>键

Then set "Next Editor"= Ctrl + Tab and "Previous Editor"= Ctrl + Shift + Tab .然后设置 "Next Editor"= Ctrl + Tab和 "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.这是CTRL - PageDown向右走, CTRL - PageUp向左走。 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.令人沮丧的是,当您到达选项卡列表的末尾(比如最右侧的选项卡)然后尝试再次向右移动时,Eclipse 不会像大多数浏览器那样循环到第一个选项卡(最左侧)。

You can use ALT + Left to go to your previous tab, or ALT + Right to go to forward.您可以使用ALT + Left转到上一个选项卡,或使用ALT + Right前进。 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.您始终可以通过单击每个选项卡一次来“重置”历史记录。

  • Right side move : Ctrl + page Down Right移动: Ctrl + page Down
  • Left side move : CTRL + page Up Left移动: CTRL +向上翻页

Additional额外的

  • get list of open tabs : Ctrl + F6获取打开的标签列表: Ctrl + F6

Eclipse others Short Cuts Eclipse 其他快捷方式

CTRL + F6 is good to use. CTRL + F6很好用。 If you want to switch to next/previous tab, you need to do CTRL + Page Down / CTRL + Page Up .如果要切换到下一个/上一个选项卡,则需要执行CTRL + Page Down / CTRL + Page Up

The default is Ctrl + F6 .默认为Ctrl + F6 You can change it by going to Window preferences .您可以通过转到Window 首选项来更改它。 I usually change it to Ctrl + Tab , the same we use in switching tabs in a browser and other stuff.我通常将其更改为Ctrl + Tab ,这与我们在浏览器和其他东西中切换选项卡时使用的相同。

Custom KeyBinding sequence example : CTRL + TAB to switch between visilble Modules or Editors Forward direction using Eclipse RCP.自定义键绑定序列示例: CTRL + TAB使用 Eclipse RCP 在可见模块或编辑器前向方向之间切换。

you press CTRL + TAB second time to open another editor and close previous editor using RCP Eclipse.您第二次按CTRL + TAB以打开另一个编辑器并使用 RCP Eclipse 关闭上一个编辑器。

package rcp_demo.Toolbar;

import org.eclipse.core.commands.AbstractHandler;
import org.eclipse.core.commands.ExecutionEvent;
import org.eclipse.core.commands.ExecutionException;
import org.eclipse.ui.IEditorReference;
import org.eclipse.ui.IWorkbenchPage;
import org.eclipse.ui.IWorkbenchWindow;
import org.eclipse.ui.PartInitException;
import org.eclipse.ui.handlers.HandlerUtil;
import rcp_demo.Editor.EmployeeEditor;
import rcp_demo.Editor.EmployeeEditorInput;
import rcp_demo.Editor.ProductEditor;
import rcp_demo.Editor.ProductEditorInput;
import rcp_demo.Editor.UserEditor;
import rcp_demo.Editor.UserEditorInput;

public class Forward_Editor extends AbstractHandler{

    static String Editor_name;  //  Active Editor name store in Temporary 
    static int cnt;             //  close editor count this variable
    @Override
    public Object execute(ExecutionEvent event) throws ExecutionException {

        IWorkbenchWindow window = HandlerUtil.getActiveWorkbenchWindow(event);
        IWorkbenchPage page = window.getActivePage();

        UserEditorInput std_input = new UserEditorInput();
        EmployeeEditorInput emp_input=new EmployeeEditorInput();
        ProductEditorInput product_input=new ProductEditorInput();

        IEditorReference[] editors = page.getEditorReferences();

        //Blank Editor Window to execute..
        if(editors.length==0)
        {
            //First time close editor can open Student_Editor
            if(cnt==1 && Editor_name.equals("Student_Editor"))
            {
                try {
                    page.openEditor(emp_input, EmployeeEditor.Id);
                    cnt=1;
                    Editor_name=page.getActiveEditor().getTitle();
                    System.out.println("EMP>>Len:: "+editors.length+"..EDi::"+Editor_name);
                } catch (PartInitException e) {
                    e.printStackTrace();
                }       
            }
            //First time close editor can open Employee_Editor
            else if(cnt==1 && Editor_name.equals("Employee_Editor"))
            {
                try {
                    page.openEditor(product_input,ProductEditor.ID);
                    cnt=1;
                    Editor_name=page.getActiveEditor().getTitle();
                    System.out.println("PRO>>Len:: "+editors.length+"..EDi::"+Editor_name); 
                } catch (PartInitException e) {e.printStackTrace();
                }
            }
            //First time close editor can open Product_Editor
            else if(cnt==1 && Editor_name.equals("Product_Editor"))
            {
                try {
                    page.openEditor(std_input, UserEditor.ID);
                    System.out.println("student Editor open");
                    cnt=1;
                    Editor_name=page.getActiveEditor().getTitle();
                    System.out.println("Close::"+Editor_name);
                } catch (PartInitException e) {
                    e.printStackTrace();
                }
            }
            //First Time call // empty editors 
            else{
                try {
                    page.openEditor(std_input, UserEditor.ID);
                    System.out.println("student Editor open");
                    Editor_name=page.getActiveEditor().getTitle();
                } catch (PartInitException e) {
                    e.printStackTrace();
                }
            }
        }//End if condition

        //AvtiveEditor(Student_Editor) close to open Employee Editor
        else if(page.getActiveEditor().getTitle().equals("Student_Editor"))
        {
            try {
                //page.closeAllEditors(true);
                page.closeEditor(page.getActiveEditor(), true);
                page.openEditor(emp_input, EmployeeEditor.Id);
                cnt=1;
                Editor_name=page.getActiveEditor().getTitle();
                System.out.println("EMP>>Len:: "+editors.length+"..EDi::"+Editor_name);
            } catch (PartInitException e) {
                e.printStackTrace();
            }
        }
        //AvtiveEditor(Employee_Editor) close to open Product Editor
        else if(page.getActiveEditor().getTitle().equals("Employee_Editor"))
        {
            try {
                page.closeAllEditors(true);
                page.openEditor(product_input,ProductEditor.ID);

                cnt=1;
                Editor_name=page.getActiveEditor().getTitle();
                System.out.println("PRO>>Len:: "+editors.length+"..EDi::"+Editor_name);

            } catch (PartInitException e) {
                e.printStackTrace();
            }
        }
        //AvtiveEditor(Product_Editor) close to open Student Editor
        else if(page.getActiveEditor().getTitle().equals("Product_Editor"))
        {
            try {
                page.closeAllEditors(true);
                page.openEditor(std_input, UserEditor.ID);
                cnt=1;
                Editor_name=page.getActiveEditor().getTitle();
                System.out.println("stud>>Len:: "+editors.length+"..EDi::"+Editor_name);
            } catch (PartInitException e) {
                e.printStackTrace();
            }
        }
        //by default open Student Editor
        else 
        {
            try {
                page.closeAllEditors(true);
                page.openEditor(std_input, UserEditor.ID);
                cnt=1;
                Editor_name=page.getActiveEditor().getTitle();
                System.out.println("stud_else>>Len:: "+editors.length+"..EDi::"+Editor_name);
            } catch (PartInitException e) {
                e.printStackTrace();
            }
        }
        return null;
    }
}

>Custom KeyBinding sequence example : <kbd> SHIFT + TAB </kbd> to switch between visilble Modules or Editors **Backword** direction using Eclipse RCP.


package rcp_demo.Toolbar;

import org.eclipse.core.commands.AbstractHandler;
import org.eclipse.core.commands.ExecutionEvent;
import org.eclipse.core.commands.ExecutionException;
import org.eclipse.ui.IEditorReference;
import org.eclipse.ui.IWorkbenchPage;
import org.eclipse.ui.IWorkbenchWindow;
import org.eclipse.ui.PartInitException;
import org.eclipse.ui.handlers.HandlerUtil;
import rcp_demo.Editor.EmployeeEditor;
import rcp_demo.Editor.EmployeeEditorInput;
import rcp_demo.Editor.ProductEditor;
import rcp_demo.Editor.ProductEditorInput;
import rcp_demo.Editor.UserEditor;
import rcp_demo.Editor.UserEditorInput;

public class Backword_Editor extends AbstractHandler{

    static String Editor_name;   // Active Editor name store in Temporary 
    static int cnt;

    @Override
    public Object execute(ExecutionEvent event) throws ExecutionException {

        IWorkbenchWindow window = HandlerUtil.getActiveWorkbenchWindow(event);
        IWorkbenchPage page = window.getActivePage();
        //Three object create in EditorInput 
        UserEditorInput std_input = new UserEditorInput();
        EmployeeEditorInput emp_input=new EmployeeEditorInput();
        ProductEditorInput product_input=new ProductEditorInput();

        IEditorReference[] editors = page.getEditorReferences();
        System.out.println("Length : "+editors.length);

        if(editors.length==0)
        {
            //First time close editor can open Student_Editor
            if(cnt==1 && Editor_name.equals("Product_Editor"))
            {
                try {
                    page.openEditor(emp_input, EmployeeEditor.Id);
                    cnt=1;
                    Editor_name=page.getActiveEditor().getTitle();
                    System.out.println("EMP>>Len:: "+editors.length+"..EDi::"+Editor_name);
                } catch (PartInitException e) {
                    e.printStackTrace();
                }               
            }
            //First time close editor can open Employee_Editor
            else if(cnt==1 && Editor_name.equals("Employee_Editor"))
            {
                try {
                    page.openEditor(std_input, UserEditor.ID);
                    cnt=1;
                    Editor_name=page.getActiveEditor().getTitle();
                    System.out.println("Student>>Len:: "+editors.length+"..student::"+Editor_name);

                } catch (PartInitException e) {
                    e.printStackTrace();
                }
            }
            //First time close editor can open Product_Editor
            else if(cnt==1 && Editor_name.equals("Student_Editor"))
            {
                        try {
                            page.openEditor(product_input,ProductEditor.ID);
                            cnt=1;
                            Editor_name=page.getActiveEditor().getTitle();
                            System.out.println("PRO>>Len:: "+editors.length+"..EDi::"+Editor_name);

                        } catch (PartInitException e) {
                            e.printStackTrace();
                        }
            } 
            //First Time or empty editors to check this condition
            else{
                try {
                    page.openEditor(product_input,ProductEditor.ID);
                    System.out.println("product Editor open");
                } catch (PartInitException e) {
                    e.printStackTrace();
                }
            }
        }
        //AvtiveEditor(Product_Editor) close to open Employee Editor
        else if(page.getActiveEditor().getTitle().equals("Product_Editor"))
        {
            System.out.println("Product:: "+page.getActiveEditor().getTitle());
            try {
                page.closeAllEditors(true);
                page.openEditor(emp_input, EmployeeEditor.Id);
                cnt=1;
                Editor_name=page.getActiveEditor().getTitle();
                System.out.println("Employee Editor open");
            } catch (PartInitException e) {
                e.printStackTrace();
            }
        }
        //AvtiveEditor(Employee_Editor) close to open Student Editor
        else if(page.getActiveEditor().getTitle().equals("Employee_Editor"))
        {
            System.out.println("Emp:: "+page.getActiveEditor().getTitle());
            try {
                page.closeAllEditors(true);
                page.openEditor(std_input, UserEditor.ID);
                cnt=1;
                Editor_name=page.getActiveEditor().getTitle();
                System.out.println("student Editor open");
            } catch (PartInitException e) {
                // TODO Auto-generated catch block
                e.printStackTrace();
            }
        }
        //AvtiveEditor(Student_Editor) close to open Product Editor
        else if(page.getActiveEditor().getTitle().equals("Student_Editor"))
        {
            System.out.println("Product:: "+page.getActiveEditor().getTitle());
            try {
                page.closeAllEditors(true);
                page.openEditor(product_input,ProductEditor.ID);
                cnt=1;
                Editor_name=page.getActiveEditor().getTitle();
                System.out.println("product Editor open");
            } catch (PartInitException e) {
                // TODO Auto-generated catch block
                e.printStackTrace();
            }
        }
        //by default open Student Editor
        else 
        {
            try {
                page.closeAllEditors(true);
                page.openEditor(product_input,ProductEditor.ID);
                cnt=1;
                Editor_name=page.getActiveEditor().getTitle();
                System.out.println("product Editor open");
            } catch (PartInitException e) {
                // TODO Auto-generated catch block
                e.printStackTrace();
            }
        }
        return null;
    }
}

Custom KeyBinding sequence example : SHIFT + TAB to switch between visilble Modules or Editors Backword direction using Eclipse RCP.自定义 KeyBinding 序列示例: SHIFT + TAB使用 Eclipse RCP 在可见模块或编辑器Backword方向之间切换。

package rcp_demo.Toolbar;

import org.eclipse.core.commands.AbstractHandler;
import org.eclipse.core.commands.ExecutionEvent;
import org.eclipse.core.commands.ExecutionException;
import org.eclipse.ui.IEditorReference;
import org.eclipse.ui.IWorkbenchPage;
import org.eclipse.ui.IWorkbenchWindow;
import org.eclipse.ui.PartInitException;
import org.eclipse.ui.handlers.HandlerUtil;
import rcp_demo.Editor.EmployeeEditor;
import rcp_demo.Editor.EmployeeEditorInput;
import rcp_demo.Editor.ProductEditor;
import rcp_demo.Editor.ProductEditorInput;
import rcp_demo.Editor.UserEditor;
import rcp_demo.Editor.UserEditorInput;

public class Backword_Editor extends AbstractHandler{

    static String Editor_name;   // Active Editor name store in Temporary 
    static int cnt;

    @Override
    public Object execute(ExecutionEvent event) throws ExecutionException {

        IWorkbenchWindow window = HandlerUtil.getActiveWorkbenchWindow(event);
        IWorkbenchPage page = window.getActivePage();
        //Three object create in EditorInput 
        UserEditorInput std_input = new UserEditorInput();
        EmployeeEditorInput emp_input=new EmployeeEditorInput();
        ProductEditorInput product_input=new ProductEditorInput();

        IEditorReference[] editors = page.getEditorReferences();
        System.out.println("Length : "+editors.length);

        if(editors.length==0)
        {
            //First time close editor can open Student_Editor
            if(cnt==1 && Editor_name.equals("Product_Editor"))
            {
                try {
                    page.openEditor(emp_input, EmployeeEditor.Id);
                    cnt=1;
                    Editor_name=page.getActiveEditor().getTitle();
                    System.out.println("EMP>>Len:: "+editors.length+"..EDi::"+Editor_name);
                } catch (PartInitException e) {
                    e.printStackTrace();
                }               
            }
            //First time close editor can open Employee_Editor
            else if(cnt==1 && Editor_name.equals("Employee_Editor"))
            {
                try {
                    page.openEditor(std_input, UserEditor.ID);
                    cnt=1;
                    Editor_name=page.getActiveEditor().getTitle();
                    System.out.println("Student>>Len:: "+editors.length+"..student::"+Editor_name);

                } catch (PartInitException e) {
                    e.printStackTrace();
                }
            }
            //First time close editor can open Product_Editor
            else if(cnt==1 && Editor_name.equals("Student_Editor"))
            {
                        try {
                            page.openEditor(product_input,ProductEditor.ID);
                            cnt=1;
                            Editor_name=page.getActiveEditor().getTitle();
                            System.out.println("PRO>>Len:: "+editors.length+"..EDi::"+Editor_name);

                        } catch (PartInitException e) {
                            e.printStackTrace();
                        }
            } 
            //First Time or empty editors to check this condition
            else{
                try {
                    page.openEditor(product_input,ProductEditor.ID);
                    System.out.println("product Editor open");
                } catch (PartInitException e) {
                    e.printStackTrace();
                }
            }
        }
        //AvtiveEditor(Product_Editor) close to open Employee Editor
        else if(page.getActiveEditor().getTitle().equals("Product_Editor"))
        {
            System.out.println("Product:: "+page.getActiveEditor().getTitle());
            try {
                page.closeAllEditors(true);
                page.openEditor(emp_input, EmployeeEditor.Id);
                cnt=1;
                Editor_name=page.getActiveEditor().getTitle();
                System.out.println("Employee Editor open");
            } catch (PartInitException e) {
                e.printStackTrace();
            }
        }
        //AvtiveEditor(Employee_Editor) close to open Student Editor
        else if(page.getActiveEditor().getTitle().equals("Employee_Editor"))
        {
            System.out.println("Emp:: "+page.getActiveEditor().getTitle());
            try {
                page.closeAllEditors(true);
                page.openEditor(std_input, UserEditor.ID);
                cnt=1;
                Editor_name=page.getActiveEditor().getTitle();
                System.out.println("student Editor open");
            } catch (PartInitException e) {
                // TODO Auto-generated catch block
                e.printStackTrace();
            }
        }
        //AvtiveEditor(Student_Editor) close to open Product Editor
        else if(page.getActiveEditor().getTitle().equals("Student_Editor"))
        {
            System.out.println("Product:: "+page.getActiveEditor().getTitle());
            try {
                page.closeAllEditors(true);
                page.openEditor(product_input,ProductEditor.ID);
                cnt=1;
                Editor_name=page.getActiveEditor().getTitle();
                System.out.println("product Editor open");
            } catch (PartInitException e) {
                // TODO Auto-generated catch block
                e.printStackTrace();
            }
        }
        //by default open Student Editor
        else 
        {
            try {
                page.closeAllEditors(true);
                page.openEditor(product_input,ProductEditor.ID);
                cnt=1;
                Editor_name=page.getActiveEditor().getTitle();
                System.out.println("product Editor open");
            } catch (PartInitException e) {
                // TODO Auto-generated catch block
                e.printStackTrace();
            }
        }
        return null;
    }
}

Key Sequence按键顺序

M1 means CTRL M1 表示CTRL

M2 means SHIFT M2 表示SHIFT

plugin.xml插件文件


<extension point="org.eclipse.ui.commands">
        <command
                defaultHandler="rcp_demo.Toolbar.Forward_Editor"
                id="RCP_Demo.Toolbar.Forward_editor_open_cmd"
                name="Forward_Editor">
        </command>
        <command
                defaultHandler="rcp_demo.Toolbar.Backword_Editor"
                id="RCP_Demo.Toolbar.backwards_editor_open_cmd"
                name="Backword_Editor">
        </command>
    </extension>
<extension point="org.eclipse.ui.bindings">
        <key
                commandId="RCP_Demo.Toolbar.Forward_editor_open_cmd"
                schemeId="org.eclipse.ui.defaultAcceleratorConfiguration"
                sequence="M1+TAB">
        </key>  
        <key
                commandId="RCP_Demo.Toolbar.backwards_editor_open_cmd"
                schemeId="org.eclipse.ui.defaultAcceleratorConfiguration"
                sequence="M2+TAB">
        </key>              
</extension>

3 line AutoHotKey script (on Windows, anyway): 3 行 AutoHotKey 脚本(无论如何在 Windows 上):

#IfWinActive ahk_class SWT_Window0
^+Tab::^PgUp
^Tab::^PgDn

Put this in your startup folder (save it as *.ahk, must have AutoHotKey installed) and Eclipse tabs will now work like Chrome or Firefox.将它放在您的启动文件夹中(另存为 *.ahk,必须安装 AutoHotKey),Eclipse 选项卡现在可以像 Chrome 或 Firefox 一样工作。

Shortcut key to back to the previous tab返回上一个选项卡的快捷键

Alt + LeftArrow to go back. Alt + LeftArrow返回。

Solved!!解决了!!

Change Scheme to Microsoft Visual Studio将方案更改为 Microsoft Visual Studio

Window>Preferences>General>Keys窗口>首选项>常规>键

Look for Schemes dropdown查找 Schemes 下拉菜单

My eclipse version:我的日食版本:

Eclipse Java EE IDE for Web Developers.面向 Web 开发人员的 Eclipse Java EE IDE。

Version: Juno Service Release 1 Build id: 20120920-0800版本:Juno Service Release 1 版本号:20120920-0800

没有人会读我的答案,但无论如何......如果你在 Mac OS X 上,你会喜欢 Eclipse 中用于历史导航的多点触控手势: http : //sourceforge.net/apps/mediawiki/eclipsemultitch/

在 Windows 上,如果您有 5 键鼠标,则可以使用 forward 和 back 代替ALT+LeftALT+Right

For some reason my Eclipse settings were corrupted so I had to manually edit the file /.plugins/org.eclipse.e4.workbench/workbench.xmi由于某种原因,我的 Eclipse 设置已损坏,因此我不得不手动编辑文件/.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).我之前一定已经将Ctrl + Tab设置为类似浏览器的选项卡切换,即使在 Eclipse 首选项中重置所有键绑定也不会摆脱快捷方式(它们也没有显示在任何地方)。 I opened the above mentioned file and removed the <bindings> elements marked with <tags>type:user</tags> related to the non-functioning shortcuts.我打开了上面提到的文件并删除了用<tags>type:user</tags>与不起作用的快捷方式相关的<bindings>元素。

You can set the hotkeys in Preferences -> General -> Keys (or just type "keys" into the filter field at the top of the Preferences dialog.您可以在 Preferences -> General -> Keys 中设置热键(或者在 Preferences 对话框顶部的过滤器字段中输入“keys”。

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.点击应用或确定以完成该过程。

One way to do it is to use the VI Plugin , and then you just do :n (and :N) to go between files.一种方法是使用VI Plugin ,然后您只需执行 :n (和 :N)即可在文件之间切换。

That's what I do.我就是做这个的。

I quote VonC response, adding something.我引用 VonC 的回应,添加一些内容。

  • Ctrl + PgUp ( PgDn ) to switch between tabs in the current stack (both editors and view) Ctrl + PgUp ( PgDn ) 在当前堆栈中的选项卡之间切换(编辑器和视图)
  • Ctrl + E to switch between tabs in the current stack, using a filtered list Ctrl + E使用过滤列表在当前堆栈中的选项卡之间切换
  • Ctrl + F6 to switch between editors, no matter which stack Ctrl + F6在编辑器之间切换,无论哪个堆栈
  • Ctrl + F7 to switch between views, no matter which stack Ctrl + F7在视图之间切换,无论是哪个堆栈

Plus, there is Bug 206299 open to request using Ctrl + Tab for switching tabs instead of Ctrl + PgUp ( PgDn ).另外,还有错误 206299可以请求使用Ctrl + Tab来切换选项卡而不是Ctrl + PgUp ( PgDn )。

  • As this would break accessibility, the user should set a preference for this.由于这会破坏可访问性,因此用户应该为此设置首选项。 Perhaps there should be a question in the Welcome Questionnaire during to the Oomph installs.也许在 Oomph 安装期间,欢迎问卷中应该有一个问题。

If not satisfied, you can assign yourself the Key Binding, from Window > Preferences > General > Keys .如果不满意,您可以从Window > Preferences > General > Keys 为自己分配键绑定。

If you want to simply switch between your current and your previous tab selections, using CTRL + F6 will switch you back and forth.如果您只想在当前和以前的选项卡选择之间切换,使用CTRL + F6将来回切换。 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);这适用于 Helios(Eclipse 3.6); not sure if this is true for older versions of Eclipse.不确定这对于旧版本的 Eclipse 是否适用。

Right to left : ctrl + shift + 9 or ctrl + shift + Page Up or ctrl + Page Up从右到左: ctrl + shift + 9ctrl + shift + Page Upctrl + Page Up

Left to right : ctrl + shift + 3 or ctrl + shift + Page Down or ctrl + Page Down从左到右: ctrl + shift + 3ctrl + shift + Page Downctrl + Page Down

Hold CTRL and press F6 until you reached the editor you want, then release.按住CTRL并按F6直到到达所需的编辑器,然后松开。 The UI is not as pretty as the window selection, but the functionality is the same. UI 不像窗口选择那么漂亮,但功能是一样的。

On a SLES12 machine you can use Ctrl + PageUp and Ctrl + PageDown to navigate between tabs by default.在 SLES12 机器上,默认情况下您可以使用Ctrl + PageUpCtrl + PageDown在选项卡之间导航。 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.上面的 Victor 和 VonC 很好地解释了这个过程。

How can I switch between opened windows in Eclipse如何在 Eclipse 中打开的窗口之间切换

CTRL+F7 works here - Eclipse Photon on Windows. CTRL+F7 在这里工作 - Windows 上的 Eclipse Photon。

For some reason, just adding a new binding doesn't seem to work (eclipse 2021-06).出于某种原因,仅添加新绑定似乎不起作用(eclipse 2021-06)。

Instead:反而:

  • use Copy Command to clone Next Tab and Previous Tab使用Copy Command克隆Next TabPrevious Tab
  • change "When" to In Windows将“何时”更改为In Windows
  • add your new binding添加您的新绑定
  • Apply and Close

eclipse按键映射截图

@Gillfish mentioned this in a comment on another answer, but i thought its better to surface the solution explicitly. @Gillfish 在对另一个答案的评论中提到了这一点,但我认为最好明确提出解决方案。

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. Eclipse 到 2022-03 的版本曾经以 LRU 顺序在编辑器之间进行CTRL + Tab切换,与CTRL + E相同 - 我相信这是相同的功能。 Starting with the 2022 versions, this was no longer the case with CTRL + Tab instead using to move to a different pane (ie move from the editor to the bottom pane, or from the bottom pane to the one of the side bars).从 2022 版本开始, CTRL + Tab不再是这种情况,而是用于移动到不同的窗格(即从编辑器移动到底部窗格,或从底部窗格移动到其中一个侧栏)。

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.在任何一种情况下, CTRL + Tab都不会在 Windows->Preferences->General->Keys 配置对话框中显示为已使用的绑定 - 它似乎是硬编码的。

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 .这真的让我很恼火,因为我非常习惯使用CTRL + Tab在多选项卡应用程序中切换选项卡,无论如何,它是一个比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 .我的解决方案是 go 进入键配置对话框并将“快速切换编辑器”快捷方式从CTRL + E替换为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; “快速切换编辑器”基本就是我需要的——按一次快速松开,你go回到之前用过的编辑器; press once and hold the modifier - you get a menu where you can navigate to a different editor in LRU order.按一次并按住修改器 - 你会得到一个菜单,你可以在其中导航到 LRU 顺序中的不同编辑器。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Eclipse HotKey:如何在基于空格的缩进级别之间切换? - Eclipse HotKey: How to switch between indenting levels based with spaces? 是否有Eclipse热键来切换标签,就像浏览器切换标签一样? - Is there an Eclipse hotkey to switch tabs in the same way a browser switches tabs? 如何在Eclipse中的“源”,“预览”和“源和预览”选项卡之间切换 - How do I switch between “Source”, “Preview” and “Source and preview” tabs in Eclipse Eclipse快捷方式:如何在Mac OS x中的Chrome,Firefox等选项卡之间切换? - Eclipse shortcuts: How to switch between tabs like Chrome, Firefox in Mac OS x? 如何在Eclipse插件之间切换? - How to switch between Eclipse plugin? 如何使用eclipse在python和java之间切换 - How to switch between python and java using eclipse Eclipse:如何在控制台窗口和编辑器之间切换? - Eclipse: how to switch between console window and editor? 如何在android sdk图形布局中的选项卡之间切换或更改? - How to switch or change between the tabs in android sdk graphical layout? 如何为Eclipse中的菜单项分配热键? - How to assign a hotkey to a menu item in Eclipse? 在eclipse中快速更改或切换到不同的编辑器? (不是标签) - Change or switch to different editor quickly in eclipse ? ( not tabs)
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM