Coder Social home page Coder Social logo

ai.vim's People

Contributors

aduros avatar chunleng avatar mennovf avatar tpai avatar zzhirong avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ai.vim's Issues

openai.lua:83: Expected comma or object end but found T_END

    8 ||  /home/kamil/.vim/plugged/ai.vim/lua/_ai/openai.lua:14: in function </home/kamil/.vim/plugged/ai.vim/lua/_ai/openai.lua:13>
    7 || Error executing vim.schedule lua callback: /home/kamil/.vim/plugged/ai.vim/lua/_ai/openai.lua:83: Expected comma or object end but found T_END           at character 205
    6 || stack traceback:
    5 ||  [C]: in function 'decode'                                                                                                                    
    4 ||  /home/kamil/.vim/plugged/ai.vim/lua/_ai/openai.lua:83: in function 'on_stdout_chunk'                                                         
    3 ||  /home/kamil/.vim/plugged/ai.vim/lua/_ai/openai.lua:14: in function </home/kamil/.vim/plugged/ai.vim/lua/_ai/openai.lua:13>                   

Some ideas...

Great plugin, this is really cool! Here are some suggestions how to make it even better:

Have a setup/config that allows to set things like:

  • Check filetype and if it's go for example, add "in golang" to AI requests automatically.
  • Which model(s) should be used for the different kind of requests
  • Specify different keybinding than CTRL+A which is already mapped by default
  • Choose between column-icon or virtual-text when waiting for response (maybe allow specifying the icon/text)
  • Have option to read the API key from a file like ~/.openai or whatever as exporting isn't the most secure/best option especially for those who got public dotfiles.

Conversation-Mode where one can go back and forth with ChatGPT in a floating window and at the end have the last response parsed into the buffer.

Vim support

Is it possible to support vim (non-neovim)?

question: use a keymapping that accepts AI input

how can i create a key mapping that asks for an input? For instance I have added this:

map("n", "<Leader>a", ":AI<CR>")
but the command should be :AI <type a question here>
I want to have the AI plugin input mode when I press <leader>A

Remap <CTRL-A>

<CTRL-A> is widely used in vim (e.g. incrementing numbers). I think this is not a good default.

ai.vim: You exceeded your current quota

Installed successfully; OPENAI_API_KEY is set.

When running :AI in vim, I get the following error:

ai.vim: You exceeded your current quota, please check your plan and billing details.

Everything works fine using the same account in a browser. I encountered the same error in a browser on occasion, but it was fixed by refreshing the window. Not sure how to accomplish the same here?

JSON file error

Error executing vim.schedule lua callback: ...unov/.local/share/nvim/plugged/ai.
vim/lua/_ai/openai.lua:83: Expected comma or object end but found T_END at chara
cter 336
stack traceback:
[C]: in function 'decode'
...unov/.local/share/nvim/plugged/ai.vim/lua/_ai/openai.lua:83: in funct
ion 'on_stdout_chunk'
...unov/.local/share/nvim/plugged/ai.vim/lua/_ai/openai.lua:14: in funct
ion <...unov/.local/share/nvim/plugged/ai.vim/lua/_ai/openai.lua:13>

I get this error after running <control + a>

Also is it possible to use gpt-4 if I pay for it with this?

ChatGPT Hard-Fork

Hey there love this plugin ๐Ÿ”ฅ

I've spun off a hard-fork here that is based on ChatGPT and removes some functionality that you have here (diverges quite a bit from this main)

Changes introduced:

  • Streaming completions with cancelling
  • ChatGPT-only calls for completions & edits
  • Removed some settings and loading state indicators that are no longer needed

Let me know if you'd like me to open a PR to merge those changes in ๐Ÿ™Œ

FR: Custom location of file with OpenAI API Key

Being able to define a custom location of a file containing the API key would be useful for those of us who made their dotfiles public.

The workaround right now is to set it via vim.env outside of the dotfiles repo, and symlink that file into the nvim config, which is unnecessarily many hoops to jump through just to get it set up.

Update to gpt-3.5-turbo?

Hello, could the plugin be update to use gpt-3.5-turbo?

thanks in advance, great tool you have here :)

Add Lua API

The excommand interface is easy to use, but having a more powerful API could open up more advanced use cases.

Editing text removes empty lines

When editing text by selecting and running with a prompt, it looks like the returned result has empty lines stripped out. This seems to be an issue in the plugin text replacement and not OpenAI.

Stop the completion with ctrl+c or some other shortcut

If I am not interested anymore in the completion, or it has done its thing, I have no way to stop it. Would be great to be able to stop it, for example with ctrl+c. Would also be great not to have two concurrent completions running at the same time. Amazing plugin, thanks.

FR: diff with hunkwise accept / reject like cursor.so

It's a large feature request but playing with https://cursor.so it seems very powerful.

AI refactoring, but instead of just making the editing having to undo / redo to figure out if it is what you want, the editor shows you an interactive diff where you can "accept all", "accept only this chunk" and their reject equivalents.

What do you think?

nvim_buf_set_extmark bug.

When using :AI from visual mode:

Error executing Lua callback: .../ygg/.local/share/nvim/lazy/ai.vim/lua/_ai/indicator.lua:41: Invalid 'end_col': out of range
stack traceback:
        [C]: in function 'nvim_buf_set_extmark'
        .../ygg/.local/share/nvim/lazy/ai.vim/lua/_ai/indicator.lua:41: in function 'create'
        ...e/ygg/.local/share/nvim/lazy/ai.vim/lua/_ai/commands.lua:52: in function 'ai'
        /home/ygg/.local/share/nvim/lazy/ai.vim/plugin/ai.lua:2: in function </home/ygg/.local/share/nvim/lazy/ai.vim/plugin/ai.lua:1>
Press ENTER or type command to continue

Allow received text to be updated in the event of timeout

We currently have virtual text to show the response of ChatGPT in realtime and in the event of timeout, these received text are disposed of. It might be useful to retain, in the case where user don't have time to wait indefinitely for the entire response.

Feature Request: Timeout

As title, sometimes ai.vim takes a really long time and returns error, sometimes it seems to break out of the loop and return a really long but repetitive result which I cannot use.

However, I might have already proceed on to other stuff and most likely do not need the result anymore, so I timeout with the user's preference might help a lot with the situation.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.