@alloydflanagan wrote this up here:https://schpet.com/note/editing-shell-commands-in-editor
so happy to figure this out