Coder Social home page Coder Social logo

openai.vim's Introduction

openai.vim

A vim plugin for auto-completing a line of text with OpenAI's GPT-3 API.

NOTE: This was more like a fun experiment if you are looking for fully functional AI-powered completion check out Codata's TabNine Vim Plugin.

Table of Contents

Installation

This plugin follows the standard runtime path structure. Below are some helper lines for popular package managers:

  • Vim 8 packages
    • git clone https://github.com/jessfraz/openai.vim.git ~/.vim/pack/plugins/start/openai.vim
  • Pathogen
    • git clone https://github.com/jessfraz/openai.vim.git ~/.vim/bundle/openai.vim
  • vim-plug
    • Plug 'jessfraz/openai.vim'
  • Vundle
    • Plugin 'jessfraz/openai.vim'

You must have curl and jq installed locally, as well as OPENAI_API_KEY set in your environment.

Usage

With your cursor on a line of text, or a selection of text in visual mode, :OpenAIComplete will send the line of text or selection to the OpenAI API and append the result in the lines following.

Or you can use whatever your <Leader> key is + o to complete the selection or line.

As seen in the gif below this is better for written words than code.

demo

openai.vim's People

Contributors

github-actions[bot] avatar jessfraz 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

Watchers

 avatar  avatar  avatar  avatar

openai.vim's Issues

I get an error when trying to run :OpenAIComplete

Hello! I've installed your pluggin with Plug as you tell us to do, but when I write a little bit and try to run :OpenAIComplete, the following error mesage is print in my document:

zsh:1: no matches found: (i.e. Authorization: Bearer YOUR_KEY),
zsh:8: no matches found: .choices[0].text

What do you think could be the problem, @jessfraz ?
I would be very happy to be able to use your project, what a nice iniciative! Thank you :D

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.