I used to map Caps Lock to Escape just because I never use Caps Lock at all. Recently I was interested in hhkb layout, with the CTRL key at the position of Caps Lock. And then I found this repo:
https://github.com/rvaiya/keyd
Basically, it allows mapping Caps Lock to CTRL/Escape at the same time. When hitting CAPS, it becomes ESC but when using CAPS in conjuction with other keys (like when we use CTRL-C, CTRL-V) then CAPS become CTRL.
Absolutely fantastic tool.