Femtosecond laser pulse shaping techniques have been restricted to propagating transverse electromagnetic waves. We present a scheme for pulse shaping of optical near fields based on the excitation of longitudinal electromagnetic fields with polarization-shaped light pulses. By solving Maxwell's equations for a model nanostructure, i.e., a scanning tunneling microscope tip, with help from the boundary-element method, we demonstrate that the electric field vector oscillates in a complex yet controllable fashion in three dimensions. Many applications are envisioned because literally another dimension in the optimal control of light-matter interaction is accessible.