Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Key bindings for most common commands? #14

Closed
KieranConlon opened this issue Jan 18, 2023 · 10 comments
Closed

Key bindings for most common commands? #14

KieranConlon opened this issue Jan 18, 2023 · 10 comments
Labels
documentation Improvements or additions to documentation

Comments

@KieranConlon
Copy link

Having just installed and configured the CoPilotForXcode extension all works great but my experience is that I had to always select the menu options to get CoPilot suggestions/actions (maybe I did not setup everything correctly??).

Could creating some default keybindings help with this?
For some, keybindings are a very personal choice as they are often customised but I found these worked pretty well and did not conflict with any existing/standard Xcode keybindings.

CoPilot -> Get Suggestions: ⌥?
CoPilot -> Accept Suggestion: ⌥}
CoPilot -> Reject Suggestion: ⌥{
CoPilot -> Next Suggestion: ⌥>
CoPilot -> Previous Suggestion: ⌥<

Essentially using ⌥⇧ as the "access" key combination for all bindings.

Xcode-CoPilot_KeyBindings_Settings

Xcode-CoPilot_KeyBindings

@intitni intitni added the documentation Improvements or additions to documentation label Jan 22, 2023
@intitni
Copy link
Owner

intitni commented Jan 22, 2023

Thanks for sharing, I don't think we can add default key bindings to commands, but will add this recommendation to readme.

@intitni
Copy link
Owner

intitni commented Jan 22, 2023

A key binding section is added to README.md with your recommendation.

@intitni intitni closed this as completed Jan 22, 2023
@icezohu
Copy link

icezohu commented Mar 2, 2023

Snipaste_2023-03-02_19-09-16

Suggesting another set of key bindings...

@KieranConlon
Copy link
Author

KieranConlon commented Mar 27, 2023

With the recent addition of the OpenAI chat feature, I suggest a couple of key bindings for the chat-specific feature.

CoPilot -> Chat with Selection: ⌥"
CoPilot -> Explain Selection: ⌥|

Again, using ⌥⇧ as the "access" key combination for these bindings.

The rationale for these bindings...
Chat: Using the 'quote' symbol for starting an OpenAI chat session has an analogy to starting a conversation with OpenAI where the initial question is about the selected (or quoted) text.
Explain: Using the 'pipe' symbol for starting an OpenAI session to explain the selected code has an analogy with command line tools (e.g. grep) for 'piping' text to another command so that additional processing of the code/selection can happen.

image

These bindings do not seem to conflict with standard key bindings used on Xcode.

image

I am using an English-UK keyboard layout, so the keys used may not be suitable for all languages/regions.

@intitni Do you think this could be added to the README?

@WingCH
Copy link

WingCH commented Apr 15, 2023

i think add this key bindings is very helpful for me, thanks @KieranConlon and hope can add into README

@intitni
Copy link
Owner

intitni commented Apr 15, 2023

They are now added to readme

@13088992520
Copy link

13088992520 commented Dec 16, 2023

xcode setting did not show the CoPilot key bindings. Anyone know Why? and my codeium works well , i just cant search copilot in setting keybindings

@intitni
Copy link
Owner

intitni commented Dec 16, 2023

@13088992520 Please make sure you have enabled the source editor extension https://github.com/intitni/CopilotForXcode#enable-the-extension

@lisbonc1987
Copy link

Hey guys! Just installed copilot for Xcode. I followed the recommended key bindings but whenever I use option + shift + }, it gives me a single quote. I have an external keyboard but it has a Mac toggle if that makes a difference. Thank you for any tips! I am new to the Mac world to learn swift so I am not sure if I am doing something wrong haha. Windows user most of my life.

@KieranConlon
Copy link
Author

@lisbonc1987 Make sure that you have setup the shortcuts in Xcode's Key Bindings as that will override the default key press.
To be honest, it doesn't matter if you have an external keyboard (I use an external keyboard 99% of the time with my MacBook Pro).

BTW welcome to developing with a Mac. As they say, once you go Mac you never go back!
Next thing you will discover Homebrew and get all the command line tools and libraries that you never knew you needed!!! :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

6 participants