Unfocuss editor to trigger live preview

When typing larger code blocks (e.g. templates, mermaid) I have to move my cursor out of the block to get a preview. Then when I want to continue to edit I have to move the cursor to the position I was typing at again.

It could be useful to have a button mapped to ‘unfocussing’ the editor such that the live preivew is shown. Any non-shortcut input could then focus the editor again, with the cursor at the position it was last in. That way it’s easy to quickly preview and then continue modifying.

Instinctively I tried doing this with the escape key, so maybe that’s a nice key for this?

Are you aware of the markdown preview feature (default bind ctrl-p) that shows a live updating rendered version of the page side by side with the markdown? It’s not very pretty but it can be useful for just this kind of use case.

1 Like

I did not know that! That does help a lot, thanks!

My proposal could still be useful for smaller screens and for people that really like monospace fonts :stuck_out_tongue_winking_eye: