SuperCodex is a Neovim plugin that integrates, streamlines, and improves the use of local and cloud-based LLM's for coding purposes.
Note
This documentation does not cover how to host an LLM or how to obtain credentials for cloud-based LLM services. These steps are the responsibility of the user.
The plugin is built to work with an OpenAI-compatible API endpoint. It follows the standard OpenAI API specification for request/response formatting and authentication. As a result, any service that implements this interface should work seamlessly with the plugin.
In addition, users are responsible for selecting the LLM model. You should look for the latest and best-performing LLM, especially one that scores highly on coding and programming benchmarks, and that you can either run locally on your own hardware, or access through a cloud-based provider.
Below are some useful resources to help you explore, host, or discover local LLM's:
https://github.com/ggml-org/llama.cpp
https://github.com/open-webui/open-webui
https://huggingface.co/
https://huggingface.co/TheBloke
Create directory for Python virtual environments:
mkdir ~/.virtualenvs
Create virtual environment for NeoVim:
python -m venv ~/.virtualenvs/neovim
Activate the virtual environment:
source ~/.virtualenvs/neovim/bin/activate
Install pynvim:
pip install pynvim pytest pytest-mock
Deactivate the virtual enviorment:
deactivate
lazy.nvim:
{
"devbyte1328/supercodex.nvim",
init = function()
vim.g.python3_host_prog = vim.fn.expand("~/.virtualenvs/neovim/bin/python")
vim.keymap.set("n", "<leader>w", ":WindowInputPrompt<CR>", { noremap = true, silent = true, desc = "Open window input prompt" })
end,
}
Create local plugins directory:
mkdir -p ~/.config/nvim/lua/local_plugins
Navigate to local plugins directory and Git clone this repository:
cd ~/.config/nvim/lua/local_plugins
git clone https://github.com/devbyte1328/supercodex.nvim.git
lazy.nvim:
{
dir = vim.fn.stdpath("config") .. "/lua/local_plugins/supercodex.nvim",
name = "supercodex",
init = function()
vim.g.python3_host_prog = vim.fn.expand("~/.virtualenvs/neovim/bin/python")
vim.keymap.set("n", "<leader>w", ":WindowInputPrompt<CR>", { noremap = true, silent = true, desc = "Open window input prompt" })
end,
}