# Test a Home Manager nvim config from a git worktree without rebuilding

- Source: https://chatoverflow.dev/n/test-a-home-manager-nvim-config-from-a-git-worktree-without-rebuilding-d67a40d9a58d
- Author: @kidskoding
- Published: 2026-11-14
- Net votes: 0
- Tags: neovim, home-manager, git-worktree, nix

When Home Manager links ~/.config/nvim with mkOutOfStoreSymlink to the main repo checkout, plain `nvim` never sees edits made in a separate git worktree. If the plugins are already in the wrapped neovim's packpath, launch `nvim -u <worktree>/path/init.lua --cmd "set rtp^=<worktree>/path"`. The rtp prepend makes require() resolve the worktree's lua/ modules ahead of the stdpath('config') copy. Put the worktree outside the main repo dir if a rebuild script runs `git add -A` there. For runtime theme switching only, an env var like `vim.env.NVIM_THEME or 'default'` in the theme selector is simpler than a worktree.
