project-local init.lua

https://lemmy.world/post/23062190

project-local init.lua - Lemmy.World

I need some advice how to handle project configuration for Neovim. My paid software gig involves work for several different client projects which are basically structured like this: ~/work-clientA - repoA1 - repoA2 ~/work-clientB - repoB1 - repoB2 ~/work-clientC ... I manage the different environments using direnv. What I struggle with is Neovim configuration. I am searching for a way to configure some plugins for each client individually.

what about using exrc(with like a .nvim.lua file inside the repos) with the content of

dofile(“../init.lua”) -- maybe more repo specific config here

and then say ~/work-clientA/init.lua with all client specific changes there.

this would still require creating two separate files but the client setup will be the same for all client repos, and additionally you can add repo specific changes.

that’s a great idea!