Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/tom-doerr/vim_codex
Supercharge your Vim editor with AI-powered code completion using OpenAI Codex. Boost productivity and save time with intelligent suggestions.
https://github.com/tom-doerr/vim_codex
ai codex vim
Last synced: 26 days ago
JSON representation
Supercharge your Vim editor with AI-powered code completion using OpenAI Codex. Boost productivity and save time with intelligent suggestions.
- Host: GitHub
- URL: https://github.com/tom-doerr/vim_codex
- Owner: tom-doerr
- License: mit
- Created: 2021-08-27T14:28:07.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2024-03-28T02:09:53.000Z (9 months ago)
- Last Synced: 2024-11-09T07:40:32.923Z (about 1 month ago)
- Topics: ai, codex, vim
- Language: Python
- Homepage:
- Size: 4.84 MB
- Stars: 259
- Watchers: 10
- Forks: 29
- Open Issues: 11
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-vim-llm-plugins - tom-doerr/vim_codex
- awesome-codex - Vim Codex - Enables access to Codex from within Vim
README
🤖 Vim Codex
An AI plugin that does the work for you.
This is a simple plugin for Vim that will allow you to use OpenAI Codex.
To use this plugin you need to get access to OpenAI's [Codex API](https://openai.com/blog/openai-codex/).## Installation
The easiest way to install the plugin is to install it as a bundle.
For example, using [Pathogen](https://github.com/tpope/vim-pathogen):1. Get and install [pathogen.vim](https://github.com/tpope/vim-pathogen). You can skip this step
if you already have it installed.2. `cd ~/.vim/bundle`
3. `git clone [email protected]:tom-doerr/vim_codex.git`
Bundle installs are known to work fine also when using [Vundle](https://github.com/gmarik/vundle). Other
bundle managers are expected to work as well.After installing the plugin, you need to install the openai package::
```
pip3 install openai
```After running `:CreateCompletion` once, the file `~/.config/openaiapirc` is created where you need to enter your OpenAI authentication information.
You can find your authentication information on the [website](https://beta.openai.com/account/api-keys).## Usage
The plugin provides a `CreateCompletion` command which you can call by default using the mapping
`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 :CreateCompletion
inoremap liul:CreateCompletion
```## Updating
### Manually
In order to update the plugin, go to its bundle directory and use
Git to update it:1. `cd ~/.vim/bundle/vim_codex`
2. `git pull`
### With Vundle
Use the `:BundleUpdate` command provided by Vundle, for example invoking
Vim like this::
```
% vim +BundleUpdate
```-------------------------------------------------------------------
[Traffic Statistics](https://tom-doerr.github.io/github_repo_stats_data/tom-doerr/vim_codex/latest-report/report.html)