\usepackage{listings}
\lstset{
  breaklines=true,
  breakatwhitespace=false,
  basicstyle=\ttfamily\small,
  columns=fullflexible
}

\usepackage{xcolor}
\usepackage{hyperref}
\hypersetup{
  colorlinks=true,      % enable colored links
  linkcolor=blue,       % color of internal links
  citecolor=purple,     % color of citations
  urlcolor=teal         % color of external links
}