Surround the lines to keep sorted with keep-sorted start and keep-sorted end in comments. For example, in Java: Alternatively, block=yes is an opt-in way to handle more complicated blocks of code, ...