AI大模型教程
一起来学习

nvim (setup copilot)for code assit

4. Work with Neo Vim
4-1. Install Neo Vim (0.9.5 or higher)
neovim/neovim: Vim-fork focused on extensibility and usability (github.com)
~ $ curl -LO https://github.com/neovim/neovim/releases/latest/download/nvim-linux64.tar.gz
~ $ sudo rm -rf /opt/nvim
~ $ sudo tar -C /opt -xzf nvim-linux64.tar.gz
~ $ export PATH=”$PATH:/opt/nvim-linux64/bin”
4-2. Install Node JS
Nodesource Node.js DEB
~ $ curl -fsSL https://deb.nodesource.com/setup_20.x | sudo bash –
~ $ sudo apt-get install -y nodejs
4-3. Install plugins
CopilotC-Nvim/CopilotChat.nvim: Chat with GitHub Copilot in Neovim
Put the files in the right place
~ $ mkdir -p ~/.config/nvim/pack/copilotchat/start
~ $ cd ~/.config/nvim/pack/copilotchat/start
~ $ git clone https://github.com/github/copilot.vim.git
~ $ git clone https://github.com/nvim-lua/plenary.nvim
~ $ git clone -b canary https://github.com/CopilotC-Nvim/CopilotChat.nvim
Add to your configuration(e.g. ~/.config/nvim/init.lua)
vim.g.copilot_proxy = ”
vim.g.copilot_proxy_strict_ssl = false
require(“CopilotChat”).setup {
debug = true, — Enable debugging
proxy = ”,
allow_insecure = true,
— See Configuration section for rest
}

4-4. Start Neo Vim
Start Neo Vim and invoke “:Copilot setup”


You will see the following prompt:


Visit “https://github.com/login/device” with your authorized GitHub Copilot account, and enter the one-time code


Once your device is activated, you will see the following prompts

Then you can write some random comments and invoke :Copilot to see if the copilot is working


Once Copilot is working properly, CopilotChat should also be working properly, please restart Neo Vim and use “:CopilotChat” to open a new window to communicate with CopilotChat

4-5. Docker image
I’ve pushed a simple docker image with all the configurations, after you create the container you just need to
do step 4-4 to use Copilot.
Pull the Docker image
~ $ docker pull mirrors.sdc.sercomm.com:5000/neovim-copilot:latest
Start the container
~ $ docker run -it –network host –rm -v :/wor

文章来源于互联网:nvim (setup copilot)for code assit

相关推荐: 跟《经济学人》学英文:2024年08月03日这期 GPT, Claude, Llama? How to tell which AI model is best

GPT, Claude, Llama? How to tell which AI model is best Beware model-makers marking their own homework 原文: When Meta, the parent co…

赞(0)
未经允许不得转载:5bei.cn大模型教程网 » nvim (setup copilot)for code assit
分享到: 更多 (0)

AI大模型,我们的未来

小欢软考联系我们