Extending the Enter behaviour to keep format in new line

The default binding for Enter tries newlineInCode, createParagraphNear, liftEmptyBlock, splitBlock, in that order. So using that but replacing splitBlock with splitBlockKeepMarks should get you quite far. It sounds like you also had splitListItem in there (possibly via example-setup). Replacing that one with a mark-preserving variant is a bit more tricky, since no such command is provided by the library and it’s quite a tricky function, but maybe you can wrap splitListItem in a command that follows up the transaction it creates with some extra code.