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 = '<your proxy server>'
vim.g.copilot_proxy_strict_ssl = false
require("CopilotChat").setup {
debug = true, -- Enable debugging
proxy = '<your proxy server>',
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 <your workspace>:/wor

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值