This plugin brings chat gpt to Vim and NVim The purpose of this pugin is to assist you for your various development tasks.
- Chat with GPT (currently gpt3.5-turbo-16k) in a separate buffer. The output is in markdown.
- GPT can recall previous messages from the current session.
- GPT can execute Python and Lua code and interact with the editor.
- GPT can search the web (google, ddg, wikipedia) and read web pages content.
- Selected text/code is appended to the prompt.
- GPT is aware of the language of your current buffer.
- Multiple sessions. You can save a session and continue the conversation later if needed.
Requirement can be installed using the following command:
pip3 install -r requirements.txt
Plug 'kamou/gpt-vim'
:call gpt#Assist(0)<cr> # Launch the prompt
:'<,'>call gpt#Assist(1)<cr> # Launch the prompt and append the current selection
:call gpt#List()<cr> # List saved conversations
nmap <silent> gpa <Plug>(gpt-vim-assist)
xmap <silent> gpa <Plug>(gpt-vim-assist-vis)
vmap <silent> gpa <Plug>(gpt-vim-assist-vis)
nmap <silent> gpl <Plug>(gpt-vim-conversations)
You may update it in you .vimrc file.
r
reset current session memory, GPT will forget everything, the buffer will be cleared.q
close gpt buffer. Memory is kept untouched, gpt will recall previous (most recent) messages.s
save the current session history.L
list previously saved sessions (press enter to load selected session).c
Cancel the current stream. (The answer will be lost, and not saved in the database)B
Enter Block Mode.
j
Cycle down to next fenced code block.k
Cycle up to next fenced code block.y
Copy current block and leave Block Mode.
q
close the listd
delete the session under the cursor<cr>
select the session under the cursors
: Open the conversation under the cursor in a horizontal split.v
: Open the conversation under the cursor in a vertical split.