Zoom behavior: numpad "." when nothing is selected/Edit Mode

This addon seems to do what you want.

https://blenderartists.org/t/neltulz-smart-frame-1-0-16-blender-2-81/1184065