One-dimensional carbon chains are expected to show outstanding optical and mechanical properties. But synthesis of the compounds containing one-dimensional carbon chains is a challenging work, because of the difficulty in saturating the dangling bonds of carbon atoms. Recently, the transition from the Immm phase to the Cmcm one at a transition pressure 5 GPa has been predicted for Li2C2 by density-functional theory calculations. In Cmcm-Li2C2, there are one-dimensional zigzag carbon chains caged by lithium atoms. Under ambient pressure, the electronic structure of Cmcm-Li2C2 is as follows: The hybridization among 2s, 2py, and 2pz orbitals of carbon atoms results in three sp2-hybridized orbitals that are coplanar with the zigzag chains of these carbon atoms, denoted as the y-z plane. The sp2-hybridized orbitals along y-axis (perpendicular to the zigzag chain) overlap with each other and form one πup-bonding band and one πup ^*-antibonding band. Likewise, the 2p_x orbitals of carbon atoms will provide also one πup-bonding band and one π*-antibonding band. These two π*-antibonding bands cross the Fermi level and contribute to the metallicity of Cmcm-Li2C2. The other two sp2-hybridized orbitals will give two σ-bonding bands, whose band tops are about 5 eV below the Fermi energy level. These two fully occupied σ bands are the framework of the zigzag carbon chains. The changes in electronic structure of Cmcm-Li2C2 under 5 GPa are negligible, compared with that in case of ambient pressure. To our best knowledge, there is no report upon the superconductivity for compounds containing one dimensional carbon chains. We choose Cmcm-Li2C2 as a model system to investigate its electron-phonon coupling and phonon-mediated superconductivity. To determine the phonon-mediated superconductivity, the electron-phonon coupling constant λ and logarithmic average frequency ωlog are calculated based on density functional perturbation theory and Eliashberg equations. We find that λ and ωlog are equal to 0.63 and 53.8 meV respectively at ambient pressure for Cmcm-Li2C2. In comparison, both the phonon density of states and the Eliashberg spectral function α2F(ω) are slightly blue-shifted at a pressure of 5 GPa. Correspondingly, λ and ωlog are calculated to be 0.56 and 58.2 meV at 5 GPa. Utilizing McMillian-Allen-Dynes formula, we find that the superconducting transition temperatures (Tc) for Cmcm-Li2C2 are 13.2 K and 9.8 K, respectively, at ambient pressure and 5 GPa. We also find that two phonon modes B1g and Ag at Γ point have strong coupling with π* electrons. Among lithium carbide compounds, the superconductivity is only observed in LiC2 below 1.9 K. Besides LiC2, theoretical calculations also predicted superconductivity in mono-layer LiC6, with Tc being 8.1 K. So if the superconductivity of Cmcm-Li2C2 is confirmed by experiment, it will be the first superconducting compound containing one dimensional carbon chains and its Tc will be the highest one among lithium carbide compounds. Thus experimental research to explore the possible superconductivity in Cmcm-Li2C2 is called for.