We solve a generalized nonautonomous nonlinear Schrödinger equation analytically by performing the Darboux transformation. The precise expressions of the soliton's width, peak, and the trajectory of its wave center are investigated analytically, which symbolize the dynamic behavior of a nonautonomous soliton. These expressions can be conveniently and effectively applied to the management of soliton in many fields.