A Vim plugin to interact with LLMs for inline edits and chat.
choose one of the following two options:
using vim-plug:
Plug 'srikanthmalla/vim-tgi-plugin'
NOTE: update and port in API_URL="http://<url>:8080/v1/chat/completions"
in .vim/plugged/vim-tgi-plugin/python/config.py
Copy this repo under .vim
and add this below line to .vimrc
set runtimepath+=~/.vim/vim-tgi-plugin
NOTE: update and port in API_URL="http://<url>:8080/v1/chat/completions"
in vim-tgi-plugin/python/config.py
fzf.vim
for interactive selection of files/ctags
sudo apt install universal-ctags
to generate tags to functions and classes for easy finding them with fzf
- Sends the selected range or current buffer to the LLM.
- If
@file
is provided, the current file content or the specified file (tab after @file) content will be included in the prompt. - If
@tag
is provided, the ctag content (tab after @tag) is shown to select and will be included in the prompt. - If
@buf
is provided, you can select vim buffer that is standard or terminal.
- Opens a split window for chatting with the LLM.
- Stops the ongoing chat interaction.
Keybinding | Command |
---|---|
<Leader>ie |
:InlineEdit <args text> , :[range] InlineEdit <args text> |
<Leader>a |
:AcceptSuggestion |
<Leader>gt |
:call GenerateCtags() |
<Leader>sc |
:StartChat <args text> |
<Leader>ss |
:StopChat |
- Send Current File to LLM:
:InlineEdit write sum function in python
need to to tab after @file or @tag or @buf to select other files or functions/classes or vim(terminal/standard) buffers respectively
- Chat Interaction:
:StartChat What is the difference between Vim and Neovim?
- Vim compiled with
+python3
.