简体   繁体   中英

How to get Find Next to work on non-standard extensions in Eclipse?

I have to edit some files in Eclipse with extensions like .page and .component. Everything seems to work ok in the editor, expect Find Next does not respond to F3. In fact, the menu doesn't even list the shortcut whenI am editing a .page or .component file (screenshot below).

So how do I make Eclipse do Find Next on F3 for these extensions?

在此处输入图片说明

From the Eclipse FAQ :

To see the current key configuration and its keyboard shortcuts, choose the Window > Preferences menu command to open the Eclipse workbench Preferences. Select the General > Editor > Keys page. This page displays the currently active Scheme (key configuration) and the keyboard shortcuts it defines. Emacs is a set of keyboard shortcuts that emulates emacs. Similarly, Microsoft Visual Studio defines a set of shortcuts that emulates that IDE. The native configuration for Eclipse is Default.

There are no APIs for defining key-binding configurations programmatically, but you can create them in a plug-in by using the org.eclipse.ui.commands extension point. First, you need to define your new configuration:

 <keyConfiguration name="My Configuration" parent="org.eclipse.ui.defaultAcceleratorConfiguration" description="This is a simple configuration" id="org.eclipse.faq.sampleConfiguration"> </keyConfiguration> 

By specifying a parent, you are saying that your configuration should inherit key bindings from the parent unless they are explicitly set in your configuration. When key bindings are defined, they will refer to the configuration they belong to. If you write your own configuration, you'll also need to define new key bindings for all the commands that you want to belong to your configuration.

See also How do I provide a keyboard shortcut for my action?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM