Disclaimer: This is not a medical diagnosis. You should see a doctor. That said,

> Am I in danger of injuring my hands?

Yes. Look into "repetitive strain injury" and "carpal tunnel syndrome". If you google "carpal tunnel syndrome guitar", you'll find many relevant articles, such as [this one](https://www.carpalrx.com/carpal-tunnel-from-guitar). 

[This M.S. thesis states](https://mds.marshall.edu/etd/1328/):

> Musicians spend hours perfecting their trade, often leading to overuse injuries of the hand; of specific concern to musicians is carpal tunnel syndrome (CTS).

On the other hand, there are articles [such as this one](https://www.worldscientific.com/doi/abs/10.1142/9781848162693_0023) that claim that "surprisingly" musicians are **less** likely to have it. (It could be a selection bias though: people prone to carpal tunnel tend to not end up as professional musicians, I imagine)


> so I want to take the best measures

Use an ergonomic keyboard. Don't use Emacs (with its native keybindings).