Around water, a lanyard can be a good idea, and that is when I have used lanyards on handguns. In my usual urbanized environment, I use lanyards routinly on some lights and other items, but rarely on handguns. Two of my pistols, a G17 and P229, have lanyard attachment points.
In the coming year, I plan to start messing about in boats much more often, so I am likely to increase my use of a lanyard attached to a pistol, and may even acquire a designated canoeing pocket pistol, probably a G26.