A general formalism for constructing configuration localized states for one-dimensional potentials is presented. It allows the evaluation of accurate approximations to the vibrational matrix elements of the momentum operator and of arbitrary functions of the coordinate. The formalism is applied to three potentials of interest in molecular physics: the harmonic oscillator, Morse, and Pöschl-Teller potentials. Quadratures specifically designed for each potential are used. The infrared vibrational spectrum of 12C16O is studied as a way to test the results obtained for different potentials in connection with their ability to model the anharmonicity.