Remix.run Logo
wafflemaker 2 days ago

I'm not on level as power users here, but have one good tip on having good and clean configuration.

Just like config.d dir in ~.ssh/, you can have a 'load' instruction in your emacs.el/init.el file and a separate directory for configs. This way you can easily do see what does what (by name) and have even more comments in the beginning of files.

So even if you added some modification late at night/under influence of substances, you can still tell that you were thinking and easily switch it off or improve it.

Edit: and love your question, even tho I used Emacs for over 10 years, I've learned a lot in here.

wyclif 2 days ago | parent [-]

You mean the `Include` directive, right? Not "load"...but I guess that's just shorthand for the concept.

So you split your main ~/.ssh/config file into smaller, reusable files stored in a subdirectory like ~/.ssh/config.d/. The main config file then "includes" (loads) these modular files automatically. So for instance, you might have:

~/.ssh/config.d/10-general.conf

~/.ssh/config.d/20-work.conf

~/.ssh/config.d/30-github.conf

Can confirm this works great in teams or on multi-host setups, as it keeps things organized without cluttering a single massive config file and it works across tools like ssh, scp, rsync, etc.

wafflemaker 12 hours ago | parent [-]

It also makes automation easier. I have a script auto adding vagrant VMs under known names when working on a project with vagrant. And had to go at great lengths to avoid nuking the main config file.

And same for for Emacs: it's much easier to vibe code some changes (don't know ELisp that well). And then when knowledge of the language matures I can look at fixes and at least know what was the idea behind them.