The adaptive immune system generates a specific response to a vast spectrum of antigens. This remarkable property is achieved by lymphocytes that each express single and unique antigen receptors. During lymphocyte development, antigen receptor coding elements are assembled from widely dispersed gene segments. The assembly of antigen receptors is controlled at multiple levels, including epigenetic marking, nuclear location, and chromatin topology. Here, we review recently uncovered mechanisms that underpin long-range genomic interactions and the generation of antigen receptor diversity.