RAG-ing the neovim lua API and docs! #93
Davidyz
started this conversation in
Show and tell
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
A typical installation of our favourite text editor comes with various plain-text runtime files, including vimscript/lua source code for built-in functions and APIs, as well as corresponding documentation for them. On my system (Arch Linux, btw), the runtime can be found at
/usr/share/nvim/runtime
. Conveniently, VectorCode provides a--project_root
flag, which allows you to operate on a project without being in that directory (or without having a.git
or.vectorcode
to mark a project root). Therefore, you can do the following:This will create a collection for the neovim runtime, containing embeddings for Neovim Lua source code and documentation:
Now, if you open a codecompanion chat and ask the LLM to use the

@vectorcode
tool to answer neovim-related questions, it'll be able to query from the collection that we created for/usr/share/nvim/runtime
and provide accurate answers!The only thing you'd need to take care of is that you need to re-vectorise when you upgrade neovim. This wouldn't happen very often for stable users, but for people who chase the nightly build of neovim, this could be a little bit inconvenient.
Beta Was this translation helpful? Give feedback.
All reactions