简体   繁体   中英

Eclipse Organize Imports shortcut not working on Mac

I'm using Eclipse (STS version 3.9.0) on macOS Sierra. I have a fresh install of STS. Organize Imports (Cmd + Shift + O) is defined out of the box. I can get this function to work by going through the menu entry Source > Organize Imports, but the key combination does nothing.

Additionally, the shortcut combination is not shown next to the menu item, while other menu items do have shortcut combinations shown.
缺少菜单快捷方式

What can I do to get this functionality via keystroke?

I have seen this happen on two different machines.

I have checked there are no other conflicting keybindings by sorting by the binding:

属性|按键

In Preferences > General > Keys > Filter the keys for ⇧⌘O

By changing the When from In Windows to Editing Java Source , the shortcut key started to work for me.

I've seen the answer on the comments above but it wasn't easy to see, that's why I'm writing it right here for more clarity. Thanks Paul for the question & answer.

Try the following steps:

  1. Go to Windows -> Preferences-> General -> Keys on STS Menu
  2. Click "Filters..." on the Keys page and uncheck all.
  3. Enter "⇧+⌘+O" to search the command list for + + O .
  4. You can see the command list, and then unbind commands other than "Organize Imports".
  5. Click "Apply".

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