Solving Repeatative Problem with Vim
This is the third article about NeoVim tips, if you are interested in other part of this, please check here and here
Motivation: The need for a clean and organized environment file.
Quite often in a project, a developer will have to deal with a lot of environment variables and/or environment files. However, they could also be the part that's least maintained in the entire codebase. As an example, sometimes, a feature flag could be added to the environment file, but when the feature goes live, people would fail to remove them. As time gets by, there will be A LOT of this kind of variables in the environment file.
As it is the end of the year, and I really couldn't finish much dev work with the amount of time left for the new year, I opt to deal with this issue with the intention to create a clean and organized environment file.
Overview: What's in an environment file
Before I get into the problem I'm trying to solve, it is important to understand the problem we are trying to solve. For the project I'm working on, we have two kinds of environment files, one of which is only used locally, the other one is used by the Kubernetes platform and is used at runtime. Here's an example of what they look like: