Joplin + Syncthing is great, as other people suggested.
I keep it even more simple: I write stuff in markdown, share my .md files with Syncthing and edit them with markdown editors.
The best I’ve tried so far for Android is Markor, while on Linux I either use Ghostwriter (on KDE) or Marker (on Gnome)