{"id":27644885,"url":"https://github.com/danbradbury/copilot-chat.vim","last_synced_at":"2025-04-24T00:58:57.823Z","repository":{"id":282628587,"uuid":"948907116","full_name":"DanBradbury/copilot-chat.vim","owner":"DanBradbury","description":"Copilot Chat for Vim","archived":false,"fork":false,"pushed_at":"2025-04-21T06:38:41.000Z","size":66,"stargazers_count":35,"open_issues_count":4,"forks_count":6,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-04-24T00:58:52.643Z","etag":null,"topics":["ai","chatbot","copilot","vim","workflow"],"latest_commit_sha":null,"homepage":"","language":"Vim Script","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/DanBradbury.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-03-15T08:21:21.000Z","updated_at":"2025-04-23T23:01:31.000Z","dependencies_parsed_at":null,"dependency_job_id":"ec8d3936-7266-4c56-803e-715d7f9535d0","html_url":"https://github.com/DanBradbury/copilot-chat.vim","commit_stats":null,"previous_names":["danbradbury/copilot-chat.vim"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DanBradbury%2Fcopilot-chat.vim","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DanBradbury%2Fcopilot-chat.vim/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DanBradbury%2Fcopilot-chat.vim/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DanBradbury%2Fcopilot-chat.vim/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DanBradbury","download_url":"https://codeload.github.com/DanBradbury/copilot-chat.vim/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250540991,"owners_count":21447427,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ai","chatbot","copilot","vim","workflow"],"created_at":"2025-04-24T00:58:57.263Z","updated_at":"2025-04-24T00:58:57.800Z","avatar_url":"https://github.com/DanBradbury.png","language":"Vim Script","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n\n# Copilot Chat for Vim\n\n[![Vint](https://github.com/DanBradbury/copilot-chat.vim/actions/workflows/lint.yml/badge.svg)](https://github.com/DanBradbury/copilot-chat.vim/actions/workflows/lint.yml) [![Test](https://github.com/DanBradbury/copilot-chat.vim/actions/workflows/test.yml/badge.svg)](https://github.com/DanBradbury/copilot-chat.vim/actions/workflows/test.yml)\n\nCopilot Chat functionality without having to leave Vim.\n\nNvim folks will be able to use [CopilotChat.nvim](https://github.com/CopilotC-Nvim/CopilotChat.nvim) for a similar experience.\n\n![copilotChat](https://github.com/user-attachments/assets/0cd1119d-89c8-4633-972e-641718e6b24b)\n\u003c/div\u003e\n\n## Requirements\n\n- [Vim](https://github.com/vim/vim)\n- [NerdFonts](https://www.nerdfonts.com) (Optional for pretty icons)\n\n## Installation\n\nUsing [Vundle](https://github.com/VundleVim/Vundle.vim), [Pathogen](https://github.com/tpope/vim-pathogen) [vim-plug](https://github.com/junegunn/vim-plug), Vim 8+ packages, or any other plugin manager.\n\n### vundle\n\nAdd into `.vimrc` configuration.\n```vim\ncall vundle#begin()\nPlugin 'DanBradbury/copilot-chat.vim'\ncall vundle#end()\n\nfiletype plugin indent on\n```\n\n### Pathogen\n\nClone repository.\n```bash\ngit clone https://github.com/DanBradbury/copilot-chat.vim.git ~/.vim/bundle\n```\n\nAdd into `.vimrc` configuration.\n```vim\ncall pathogen#infect()\nsyntax on\nfiletype plugin indent on\n```\n\n### vim-plug\n\nAdd into `.vimrc` configuration.\n```vim\ncall plug#begin()\nPlug 'DanBradbury/copilot-chat.vim'\ncall plug#end()\n\nfiletype plugin indent on\n```\n\n### Vim 8+ packages\nClone repository.\n```bash\ngit clone https://github.com/DanBradbury/copilot-chat.vim.git ~/.vim/pack/plugins/start\n```\n\nAdd into `.vimrc` configuration.\n```vim\nfiletype plugin indent on\n```\n\n## Setup\n1. Run `:CopilotChatOpen` to open a chat window. You will be prompted to setup your device on first use.\n2. Write your prompt under the line separator and press `\u003cEnter\u003e` in normal mode.\n3. You should see a `Waiting for response..` in the buffer to indicate work is being done in the background.\n4. 🎉🎉🎉\n\n## Commands\n| Command | Description |\n| ------- | ----------- |\n| `:CopilotChat \u003cinput\u003e` | Launches a new Copilot chat with your input as the initial prompt |\n| `:CopilotChatOpen` | Opens a new Copilot chat window (default vsplit right) |\n| `:CopilotChatFocus` | Focuses the currently active chat window |\n| `:CopilotChatReset` | Resets the current chat window |\n| `:CopilotChatConfig` | Open `config.json` for default settings when opening a new CopilotChat window |\n| `:CopilotChatModels` | View available modes / select active model |\n| `:CopilotChatSave \u003cname\u003e?` | Save chat history (uses timestamp if no name provided) |\n| `:CopilotChatLoad \u003cname\u003e?` | Load chat history (shows list of saved histories if no name provided) |\n| `:CopilotChatList` | List all saved chat histories |\n| `:CopilotChatSetActive \u003cbufnr\u003e?` | Sets the active chat window to the buffer number provided (default is the current buffer) |\n\n## Plugin Keys\n| Key | Description |\n| ------- | ----------- |\n| `\u003cPlug\u003eCopilotChatAddSelection` | Copies selected text into active char buffer |\n\n## Default Key Mappings\n| Location | Insert | Normal | Visual | Action |\n| ---- | ---- | ---- | ---- | ---- |\n| Chat window| - | `\u003cCR\u003e` | - | Submit current prompt |\n| Models list | - | `\u003cCR\u003e` | - | Select the model on the current line for future chat use |\n\n## User Key mappings\nThe plugin avoids adding any default vim key mappings to prevent conflict with\nother plugins and the users' own mappings.\n\nHowever, to easily work with the Copilot Chat plugin, the user might want to\nsetup his own vim key mappings. See example configuration below:\n\n```vim\n\" Open a new Cpilot Chat window\nnnoremap \u003cleader\u003ecc :CopilotChatOpen\u003cCR\u003e\n\n\" Add visual selection to copilot window\nvmap \u003cleader\u003ea \u003cPlug\u003eCopilotChatAddSelection\n```\n## Features\n\n### Model Selection\n`:CopilotChatModels` brings up a buffer for of all the available models for you to choose from. Simply press `\u003cEnter\u003e` in normal mode on the model you would like to use. New chats will use the selected model.\n\n### Add Selection to Chat\nBy default, this is configured to `\u003cLeader\u003ea` when in visual mode.\n- Adds the selection to the active chat window inside of a `\u0026filetype` named codeblock\n![](https://private-user-images.githubusercontent.com/2555073/423367966-e1aac0e2-0e95-4fdb-81d1-b92bb4b7cbf7.gif?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NDIxOTg4MTIsIm5iZiI6MTc0MjE5ODUxMiwicGF0aCI6Ii8yNTU1MDczLzQyMzM2Nzk2Ni1lMWFhYzBlMi0wZTk1LTRmZGItODFkMS1iOTJiYjRiN2NiZjcuZ2lmP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI1MDMxNyUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNTAzMTdUMDgwMTUyWiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9MjUyMTlmNDAxMjYyNzc5MjcwNmVlNTUwMDY2N2Q0NGVlMzY5OGUyM2U1MjgxMmQzOGI5ZTEwZDg2OGMzNzJkYiZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QifQ.hckZ7Swx9wszWWgdduqTRnwtrqvUPMVhqSyoSdwTny4)\n\n### Chat History\nSave and restore your chat conversations with Copilot:\n\n#### Saving Chat History\n- Use `:CopilotChatSave \u003cname\u003e` to save the current chat history\n- If no name is provided, a timestamp will be used automatically\n- History files are stored in `~/.vim/copilot-chat/history/` as JSON files\n\n#### Loading Chat History\n- Use `:CopilotChatLoad \u003cname\u003e` to load a previously saved chat\n- If no name is provided, a list of available chat histories will be shown\n- You can also view all saved histories with `:CopilotChatList`\n\n### Prompt Templates\nCopilot Chat supports custom prompt templates that can be quickly accessed during chat sessions. Templates allow you to save frequently used prompts and invoke them with a simple syntax.\n\n#### Using Prompts\n- In the chat window, start a line with `\u003e PROMPT_NAME`\n- The `PROMPT_NAME` will be automatically replaced with the template content before sending to Copilot\n- Example: `\u003e explain` would expand to the full explanation template\n\n#### Managing Prompts\n1. Open the config with `:CopilotChatConfig`\n2. Add prompts to the `prompts` object in `config.json`:\n```json\n{\n  \"model\": \"gpt-4\",\n  \"prompts\": {\n    \"explain\": \"Explain how this code works in detail:\",\n    \"refactor\": \"Suggest improvements and refactoring for this code:\",\n    \"docs\": \"Generate documentation for this code:\"\n  }\n}\n```\n\n#### Example Usage\n```\n\u003e explain\n\nfunction validateUser() {\n  // code to validate\n}\n```\nThis will send the full template text + your code to Copilot.\n\n## Contributing\nPlease see the [contribution guide](./CONTRIBUTING.md) for more information.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdanbradbury%2Fcopilot-chat.vim","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdanbradbury%2Fcopilot-chat.vim","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdanbradbury%2Fcopilot-chat.vim/lists"}