Skip to content

naripok/vim_codex

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

65 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

This is a simple plugin for Vim that will allow you to use OpenAI Codex. To use this plugin you need to have access to OpenAI's Codex API.

Installation

TODO add path config

Create the file ~/.openai/credentials.json and add your credentials to is like so:

{
  "organizationId": "",
  "secretKey": ""
}

TODO auto install package?

You alse need to have python openai present in your nvim python provider environment.

Install the pluguin with packer:

use {
  `naripok/vim_codex`
}

Usage

The plugin provides a CreateCompletion command which you can call by default using the mapping <Leader>co. You can give the CreateCompletion command the number of tokens it should produce as an argument, e.g. CreateCompletion 1000. If you want to just complete the current line, run CreateCompletionLine.

To complete the current text from insert and normal mode using Ctrl+x, you can add the following lines to your .vimrc::

nnoremap  <C-x> :CreateCompletion<CR>
inoremap  <C-x> <Esc>li<C-g>u<Esc>l:CreateCompletion<CR>

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 81.2%
  • Vim Script 18.8%