yaroslavyaroslav / OpenAI-sublime-text

First class Sublime Text AI assistant with GPT-o1 and ollama support!
MIT License
198 stars 15 forks source link

Linux and MacOS support for Keybindings #18

Closed rorymullen closed 1 year ago

rorymullen commented 1 year ago

Thank you yaroslavyaroslav for this fantastic package, it's great to have ChatGPT access without leaving sublime text. I'm following up on an issue with keybindings that was mentioned in a comment: https://github.com/yaroslavyaroslav/OpenAI-sublime-text/issues/12#issuecomment-1537469918 .

I'm running macOS, I havn't been able to get the OpenAI: New Message and OpenAI: Show output panel keybindings to work.

The OpenAI: Show output panel keybinding does appear in the settings file that you've provided under OpenAI completion -> Key Bindings, but the keybinding doesn't work for me (no response when pressed), and I see no key binding for OpenAI: New Message. I have gotten keybindings to work successfully for the insertion and edition commands, they are great.

[
    //     {
    //     "keys": [
    //         "super+shift+;"
    //     ],
    //     "command": "show_panel",
    //     "args": {
    //         "panel": "output.OpenAI"
    //     }
    // },
    // {
    //     "keys": [
    //         "super+shift+'"
    //     ],
    //     "command": "openai",
    //     "args": {
    //         "mode": "completion"
    //     }
    // },
    // {
    //     "keys": [
    //         "super+shift+'"
    //     ],
    //     "command": "openai",
    //     "args": {
    //         "mode": "edition"
    //     }
    // },
    // {
    //     "keys": [
    //         "super+shift+'"
    //     ],
    //     "command": "openai",
    //     "args": {
    //         "mode": "insertion"
    //     }
    // },
]

Even without the keybindings, this package is amazing. If you set up GitHub sponsoring for this project, I would 100% sponsor it. Not a talented programmer, but would be very happy to help with testing :)

Thank you again!

rorymullen commented 1 year ago

Okay, for New Message I was able to figure it out from the open_worker.py file. This works for me on MacOS:

    {
        "keys": [
            "super+shift+'"
        ],
        "command": "openai",
        "args": {
            "mode": "chat_completion"
        }
    },

Thank you again!!!

rorymullen commented 1 year ago

Okay, and this also works to show the chat history :)

    {
        "keys": [
            "super+shift+;"
        ],
        "command": "openai",
        "args": {
            "mode": "refresh_output_panel"
        }
    }
yaroslavyaroslav commented 1 year ago

Thank your for kind words!

Yeah, I've recently found out that I forgot to add those new bindings in default file (got bind them in my local one).

Could you please check that file in the last develop branch commit if it's ok for now, as I believe that I've added them there but haven't been released new version yet since the lack of time for now.

Anyway if you'd find some issues within the latest version of the keybinding file ping me out here, I'll check it additionally at release time.

UPD: Nevermind, had released patch with a proper binding just yet.

yaroslavyaroslav commented 1 year ago

And speaking about showing output panel keys, this one is more reliable, since it's just toggle panel on and off, and the one that you've mentioned earlier is redrawing all output from a cache (it's from the very least develop commit):

{
    //     "keys": [
    //         "super+shift+;"
    //     ],
    //     "command": "show_panel",
    //     "args": {
    //         "panel": "output.OpenAI Chat"
    //     }
    // },
yaroslavyaroslav commented 1 year ago

Fixed in https://github.com/yaroslavyaroslav/OpenAI-sublime-text/releases/tag/2.0.4

rorymullen commented 1 year ago

I've started using this package in earnest now, GPT 4 is working great for me, it's a massive upgrade from constantly toggling between MacGPT and SublimeText, which is what I had been doing. Thank you for this!

One small update on this issue of key bindings, and perhaps this belongs in it's own thread (EDIT: discussion started here), but the OpenAI: Refresh Chat action (and the associated key binding) bring up the chat window in a default position showing the oldest part of the chat, rather than the newest part of the chat.

In a short chat, that's no problem. In a longer chat, it can be a bit cumbersome to scroll all the way to the bottom in order to show GPT's most recent reply. I wonder if the chat window could default to opening at the bottom of the chat rather than the top?

I've attached two screenshots. The first, showing "message 1," is the default position of the chat window after OpenAI: Refresh Chat is activated, the second, showing "message 3," is the position that IMHO would be most useful.

I hope I've been able to describe the issue relatively clearly...

Thanks again for this package, I hope it takes off and gets a large user base, it's fantastic!

Screenshot 2023-09-17 at 9 18 44 AM Screenshot 2023-09-17 at 9 18 57 AM