You can edit the file you see in less by pressing
v. From the man page:
v Invokes an editor to edit the current file being viewed. The
editor is taken from the environment variable VISUAL if defined,
or EDITOR if VISUAL is not defined, or defaults to "vi" if nei‐
ther VISUAL nor EDITOR is defined. See also the discussion of
LESSEDIT under the section on PROMPTS below.