Then after spending a few years in employment, the environment getting more and more toxic (and less and less about technical excellency and more and more about dirty politics), you can lose sight of how that stress gradually eats away at you. Ultimately, I just couldn't work anymore, I couldn't focus. I started having panic attacks. I was completely lifeless, fatigued all the time. I would later find out that my endocrine system had become completely out of whack. Long story short, it took me well over an year to get to be barely functioning again. I had a lot of anxiety symptoms, and clearly fit 100% most technical descriptions of burnout (but don't put too much weight to it, after all burnout is just a label attached to a set of symptoms). But worst of all, you become very cynical. Your brain gradually gets rewired to model the world as a cold, harsh, evil environment, where most everyone is against you. You end up in a state of learned helplessness, you fall victim to avoidant behavior to sooth this permanent state of doom that you're feeling.
The way out is learning to relax. Learning to rewire your brain, to have fun again. Learning to solve your anxiety problem. Following the steps from a book like "Anxiety & Phobia Workbook" by Edmund-Bourne is almost mandatory. Exercising regularly is mandatory. Depending on how deep you are in the hole, how much social support you have, this may be one of the hardest thing you achieve in your life (keep in mind that most drug addicts never make it out alive - see "In the Realm of Hungry Ghosts" by Gabor Mate).
In short, it may be that you stress yourself too much. Life can and should be a joy. What I've described above is my experience, which is closer to one end of the spectrum, but even if your issues are much more minor, the same rules apply. But again, the chances are small that anxiety is the source of your issues, given the limited information in your post.
The office environment just isn't a place for good flow. Too many distractions, emails, slack, meetings, people, commuting, etc. This isn't to say that I don't get some work done at work, but it's certainly not efficient. Sadly most people I have worked with don't care that I'm not being efficient, they care that I'm working on whatever they want me to work on (which may or may not be the right thing).
My suggestions on this are to try to automate your tools, like writing scripts, and writing notes about your development procedure, even if they are only for you. I have a alias for a file that has all sorts of commandlines that can run anywhere and really helps me remember what it is I needed to run.
Many times, these notes have eventually gotten pushed to something like confluence, and are useful for other people, so they love them. They aren't copious, or descriptive, but the bare minimum to help me remember what I need to do.
Context switching can also make you associate your work environment with being distracted. Then even when you aren't being interrupted every 15 minutes you worry you might be, which becomes a problem of itself.
Despite what every growth hacker / struggle porn story tells you, you don't need to have side projects or after work projects to be successful. They are supposed to grow out of interesting things you care and have passion for, not be another job on the side. Don't worry about that at all. Spend that time to de-stress and enjoy life.
And if you’re using many different editors, then maybe learn VIM and use a vim plugin in all of them.
Looks like you answered your own question. The more you do something, the more fluid it becomes.
For example I try to stick to the Idea suite of IDE’s. I use it for java, ruby, Go, Rust, JavaScript, and some others. This way my editor and shortcuts are always the same, debugging is mostly the same, etc.
I've found Anki flashcards useful too.