Very much a work in progress still.
External dependencies: curl
" Using vim-plug:
Plug 'juliusolson/gpt.nvim'
-- using lazy
require("lazy").setup({
"juliusolson/gpt.nvim"
})
You also need to have an OpenAI API key accessible as an env variable
# .bashrc/.bash_profile
export OPENAI_API_KEY="<your-key>"
- Highlight text in visual mode
- Run
:GPTEDIT <instruction>
- The edited text replaces the highlighted text
- Run
:GPTGEN <prompt-here>
- The generated text is inserted at the cursors current location
- Run
:GPTCOMP
- All text in the buffer up until the current cursor position is sent to the model and is used to generate a completion.
- The completion is inserted at the cursors current location