How to develop jinja2 templates using an ide

I’m currently typing jinja2 code in an emacs text buffer and copying it it to server:8123/developer-tools/template for debugging. Is this how you do it or what am I missing?

I type my templates directly in developer tools.

When I create or test a new template, I type it directly into the developer tools, too.
After everything is working as expected I copy it back to my IDE.