Camera From Viewport
Source: Youtube video by Brandon's Drawings
Press N for the sidebar (on the right). Select View. Toggle Camera To View.
Select Camera view (numpad 0, or use the view menu at the top)
Then as you move the view , the camera moves.