Hedgedoc is fantastic. If you’re okay with your notes app being web-only (without an app or even a PWA) and you don’t need canvas notes or multi-note queries, you should check it out.
First, every note is Markdown, but it supports a ton of things natively. It has native Vim, Emacs, and Sublime (the default) editors and it’s built to be great for collaboration (if you want).
It also has
syntax highlighting for a ton of languages
Mermaid.js support
LaTeX support
easy drag and drop image uploads
a solid mobile interface (for a webapp in your browser, at least)
built in revision history
support for other diagram tools, like graphviz, flowchart.js
a bunch of other little Markdown enhancements that make using it feel oddly intuitive
And best of all, they have a Hedgehog for the icon! (I may be biased.)