Do you want to align the insert automatically or do you want to align it later? For later use, you can use the indent-region function (bound to CM-\ ). For automatic alignment by insertion, you can use the following recipe (I donβt remember where I got it, so I will refer to my configuration) - see lines 45-66. You will need to add more modes to yank-indent-modes , but the particular mode should provide a working indent function.
source share