Recently an interesting mechanochemical effect was found showing a possibility to produce longer copper atomic chains in nitrogen atmospheres [Amorim and da Silva, Phys. Rev. B 82, 153403 (2010)]. This work presents a systematic and comparative study of the effect of doping with H, B, C, N, O, S, and N 2 impurities to the electronic structure of copper nanowires. It was performed by means of ab initio total energy calculations based on density functional theory, using local density and generalized gradient approximations. All impurities show a sd z 2 bond, boron makes a σ pd yz bond, while carbon, oxygen, and sulfur have a strong σ pd z 2 and π pd yz bond. These impurities modify the metallic chain structure of the nanowire and change chain distances in the way that can be observed in electron microscopy experiments. Nitrogen and N 2 also have a strong σ pd z 2 and make a π pd xz bond that is stronger than the other impurities enhancing the size of atomic chains. Small spin anisotropy is introduced through carbon, oxygen, nitrogen, and sulfur doping. Remarks about the electronic states around the Fermi level are presented.