Change hotkey for autocomplete selection

前端 未结 4 2072
甜味超标
甜味超标 2021-02-08 06:02

In Eclipse, I find it pretty annoying that Enter is the hotkey that selects an item from the Content Assist/Autocomplete list. Especially in PyDev where there is no end-of-line

相关标签:
4条回答
  • 2021-02-08 06:32

    The autocompletion selection key(s) is editor specific. For instance in Aptana Studio, you could define set of keys for proposal selection. See e.g. Preferences/Aptana Studio/Editors/JavaScript. Since PyDev shares some code with Aptana Studio, it has similar capabilities. See "Preferences/PyDev/Editor/Code Completion/Apply completion on *" checkboxes.

    Speaking of the Tab key as a selector, it doesn't seem possible w/o extra coding since it has special meaning to focus into proposals window. For these who interested could find Tab handling at org.eclipse.jface.text.contentassist.CompletionProposalPopup.verifyKey(VerifyEvent)

    Cheers, Max

    0 讨论(0)
  • 2021-02-08 06:33

    All key bindings in Eclipse are defined in Window -> Preferences -> General -> Keys. I don't think you can change what is used to select stuff from the autocomplete list, but you can use space to select and then Enter for new line.

    0 讨论(0)
  • 2021-02-08 06:38

    Unfortunately it's not really possible to use tab instead of enter to auto-complete in PyDev (nor in Eclipse itself).

    So, what I do in these cases is use Shift-Enter to go to a new line: note that in this case, you can press Shift+Enter from any place in your line and it'll mimic a 'go to end of line, press enter' (which is a nice thing for me).

    Implementation note: as Max pointed out, the '\t' and '\r,'\n' cases are actually hard-coded in Eclipse at: org.eclipse.jface.text.contentassist.CompletionProposalPopup.verifyKey(VerifyEvent) so, to fix that, you'd need a patch which changed that at Eclipse itself (so, if you feel it's worthwhile, create a bug-request in Eclipse itself to ask for that feature).

    0 讨论(0)
  • 2021-02-08 06:46

    If you have a Mac, you can download the Better Touch Tool(BTT) and change the hotkey to tab. Just tried and it worked, however if you do this you can't use the tab-key to tab regularly with the text. Which is pretty good to be able to bo. I changed it to shift+space.

    In BTT, select Keybord in the menu between Trackpads and Apple remote. Add eclipse with the + sign on the left side. Then press +Add new shortcut. In keybord shortcut press the hotkey or combination you want. In Trigger Other keybord Shortkey press ctrl+space and you are done! Just be sure that the new shortcut is enabled in the right corner.

    http://www.bettertouchtool.net/

    0 讨论(0)
提交回复
热议问题