vim: generalize compose buffer function further