Edit the ~/.config/nvim/lua/plugins/init.lua file and add the following in the array:

  {
    "github/copilot.vim",
    lazy = false
  },

Then start nvim and enter :Lazy to bring up the lazy.nvim dashboard, and press ā€˜Iā€™ to install the missing package(s). Press ā€˜qā€™ to exit the lazy dashboard. Now enter :Copilot setup to set Copilot up.

By the way, GitHub Copilot requires a recent version of NodeJS. The easiest way to install a recent version of NodeJS is to use nvm:

$ curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash
$ nvm list-remote
$ nvm install v22.1.0