Optimal analyses using the 2-point functions of large-scale structure probes require accurate covariance matrices. A covariance matrix of the 2-point function comprises the disconnected part and the connected part. While the connected covariance only becomes important on small scales, the disconnected covariance is dominant on large scales, where the survey window has a significant impact. In this work, we develop an analytical method to compute the disconnected covariance, accounting for the window effect. Derived under the flat-sky approximation, our formalism is applicable to wide surveys by swapping in the curved-sky window functions. Our method works for both the power spectrum and the correlation function, and applies to the covariances of various probes including the multipoles and the wedges of 3D clustering, the angular and the projected statistics of clustering and shear, as well as the cross covariances between different probes. We verify the analytic covariance against the sample covariance from the galaxy mock simulations in two test cases: (1) the power spectrum multipole covariance, and (2) the joint covariance of the projected correlation function and the correlation function multipoles. Our method achieve good agreement with the mocks, while at a negligible computational cost. Unlike mocks, our analytic covariance is free of sampling noise, which often leads to numerical problems and the need to inflate the errors. In addition, our method can use the best-fit power spectrum as input, in contrast to the standard procedure of using a fiducial model that may deviate significantly from the truth. We also show that a naive diagonal power spectrum covariance underestimates the signal-to-noise ratio compared to our analytic covariance. The code that accompanies this paper is available at https://github.com/eelregit/covdisc. arXiv:1811.05714v2 [astro-ph.CO]