…I can’t think of a “privacy-focused code editor” because code editors are generally not known for having telemetry/tracking/anything privacy-invasive in the first place? A “privacy-respecting” code editor is just a normal one. Use whatever you like. Vim is great. Maybe Kate if you want a GUI.
Do you have a Ryzen CPU by any chance? I had an issue like this for ages and it turns out it was a faulty Ryzen power state that was disabled by default on Windows, but not on Linux. If this happens to be your issue, there are ways you can disable the power state in software: https://wiki.archlinux.org/title/Ryzen#Soft_lock_freezing