ContextPilot Plugin for NeoVim
May 18, 2025 ยท View on GitHub
ContextPilot helps you quickly find contextually relevant files based on your current file, line, or selection in Neovim. It leverages fuzzy searching and indexing to improve your workflow.
๐ฆ Installation
Using lazy.nvim:
{
"krshrimali/context-pilot.nvim",
dependencies = {
"nvim-telescope/telescope.nvim",
"nvim-telescope/telescope-fzy-native.nvim"
},
config = function()
require("contextpilot")
end
}
โ๏ธ Pre-requisites
Install the ContextPilot server:
brew install krshrimali/context-pilot/context-pilot
OR if using AUR, refer: https://aur.archlinux.org/packages/contextpilot.
In case you are not using either of the package managers above, follow the commands below: (cargo installation is must)
git clone https://github.com/krshrimali/context-pilot-rs && cd context-pilot-rs
cargo build --release
cp ./target/release/contextpilot ~/.local/bin/
Feel free to replace the binary path to /usr/local/bin based on your system.
๐ Getting Started
- (Optional, for faster query results) Start indexing your workspace from Neovim:
:ContextPilotStartIndexing
- (Optional, for faster query results) OR Index some selected repositories:
:ContextPilotIndexSubDirectory
Choose the subdirectories you want to index (hitting Tab) and let the indexing finish.
- Use any of the following commands to retrieve relevant files:
:ContextPilotRelevantCommitsRange- Fetch relevant commits for selected range of lines.:ContextPilotRelevantFilesWholeFileโ Fetch contextually relevant files for the current file.:ContextPilotRelevantFilesRangeโ Fetch relevant files for a selected range of lines.
๐ Tips
- Re-index your project whenever significant codebase changes occur.