Sortloot

Sortloot is a patch that sorts items by name in your inventory and on the ground. The patch was written by Jeroen Demeyer and Jukka Lahtinen and can be found here.

The sortloot configuration option has three different options: none (to disable any effects of the patch), loot (sort only items on the ground, never those in your inventory), and full (sort items on the ground and in your inventory).

While sortloot understands that a blessed wand of digging should be near an uncursed wand of digging, it doesn't group potions of (un)holy water together. It also ignores wand/tool charges.

nethack.alt.org has the sortloot patch installed.