Markdown and plaintext files is really perfect. I start writing without formating and then organize later.
Plaintext file is great to copy / paste snippet code (wich is more complicated with handwriting notes ).
Finally for mindmap, Dot graph [1] does job
[1]: https://en.wikipedia.org/wiki/DOT_(graph_description_languag...