Skip to content

Instantly share code, notes, and snippets.

@schlueter
Created August 22, 2025 15:04
Show Gist options
  • Select an option

  • Save schlueter/eecf15ed82f99277edd843f035f70f8e to your computer and use it in GitHub Desktop.

Select an option

Save schlueter/eecf15ed82f99277edd843f035f70f8e to your computer and use it in GitHub Desktop.
zsh copilot
FROM node:alpine
RUN apk add --no-cache git neovim zsh
RUN git clone --depth=1 https://github.com/github/copilot.vim.git \
~/.config/nvim/pack/github/start/copilot.vim
ENV EDITOR=nvim
RUN cat <<@ >> ~/.zshrc
autoload -z edit-command-line
zle -N edit-command-line
bindkey -M vicmd v edit-command-line
@
CMD ["zsh"]
@schlueter
Copy link
Author

Build and run this container with the Dockefile or using:

docker build -t zshcopilot . -f - <<!
FROM node:alpine
RUN apk add --no-cache git neovim zsh
RUN git clone --depth=1 https://github.com/github/copilot.vim.git \
  ~/.config/nvim/pack/github/start/copilot.vim
ENV EDITOR=nvim
RUN cat <<@ >> ~/.zshrc
autoload -z edit-command-line
zle -N edit-command-line
bindkey -M vicmd v edit-command-line
@
CMD ["zsh"]
!
docker run -it zshcopilot

From the container's shell, type and you should be put into nvim. Run :Copilot setup and hit enter. Your browser will not open as it suggests because you are in a container, this is fine. Goto https://github.com/login/device in your browser and enter the code from the nvim session in the container. Copilot should now be activated, enter function and space and it should make a suggestion.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment