Go to this website: https://github.com/github/copilot.vim
Add this config to your ~/.config/nvim/lua/plugins/init.lua:
{
"github/copilot.vim",
lazy=false,
config=function() -- Mapping tab is already used by NvChadvim.g.copilot_no_tab_map=true;
vim.g.copilot_assume_mapped=true;
vim.g.copilot_tab_fallback="";
-- The mapping is set to another key, see custom/lua/mappings-- or run <leader>ch to see Copilot mapping sectionend
},
Add this for autocompletion to you ~/.config/nvim/lua/mappings.lua