Currently I'm using Dropbox Paper, but it's getting to be quite slow for longer or more complex documents, with a lag of several seconds between when I enter a keystroke and when it appears on the screen.
- Code blocks with syntax highlighting (coloring)
- Can easily emphasize parts of code, e.g., with bold or highlighting (not to be confused with syntax highlighting), as conveniently as selecting the text and pressing a button or keyboard shortcut.
- Notes sync across devices, at least on Windows
- Minimal lag in typing and formatting
- Automatic language detection for syntax highlighting
- Formatting from pasted in text is carried over to some extent (such as being bold or in a code block)
- Under $10
This answer from Stack Overflow suggests using
<pre><code>, within which you can use
<b>, but there's a comment saying "Note: You cannot use
<pre lang="..."> AND
<b>. The syntax highlighting will take precedence!" so I'm not sure it actually works. Testing it on Stack Exchange, it doesn't seem like there's any syntax highlighting even with the lang tag. In any case, I don't consider typing
</b> around the text to be convenient enough. It's possible that there is a Markdown editor that both supports syntax highlighting within
<pre><code> and has a keyboard shortcut for adding and removing
<b> around selected text. If AutoHotKey can allow you to select text and add
</b> around it with a keyboard shortcut, that's also fine.
Just Windows or just web is fine. Android and iOS would be nice but not necessary.