  We propose a field theoretic framework for calculating the dependence of
R\'enyi entropies on the shape of the entangling surface in a conformal field
theory. Our approach rests on regarding the corresponding twist operator as a
conformal defect and in particular, we define the displacement operator which
implements small local deformations of the entangling surface. We identify a
simple constraint between the coefficient defining the two-point function of
the displacement operator and the conformal weight of the twist operator, which
consolidates a number of distinct conjectures on the shape dependence of the
R\'enyi entropy. As an example, using this approach, we examine a conjecture
regarding the universal coefficient associated with a conical singularity in
the entangling surface for CFTs in any number of spacetime dimensions. We also
provide a general formula for the second order variation of the R\'enyi entropy
arising from small deformations of a spherical entangling surface, extending
Mezei's results for the entanglement entropy.
