root_swapper.nvim

January 8, 2026 ยท View on GitHub

This is a tiny plugin that sets up an autocommand to lcd to detected root directories when switching buffers.

Supports oil.nvim buffers - when navigating directories in oil, your lcd will update to the appropriate project root based on the current directory.

๐Ÿ“ฆ Installation

Lazy.nvim minimal installation:

return {
    "cosmicbuffalo/root_swapper.nvim",
}

โš™๏ธ Customizable Configuration

opts = {
    root_indicators = { ".git", "Gemfile", "Makefile" } -- An array of filenames indicating root directories
}