ChestSort can automatically sort every chest, barrel, etc. after you have used it. Every player can enable or disable this feature if desired with the simple command /sort (or /chestsort)
The chest contents are sorted by category and/or alphabetically and stackable things will be stacked. By default, items will be put before blocks. Automatic sorting will work with chests, enderchests, shulker boxes, barrels, minecarts with chest and player inventories. The same applies to using hotkeys.