From 2b850b8edd220884a264ebbbf6cf1ae17c1663d0 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Mon, 5 Feb 2024 08:06:43 +0800 Subject: [PATCH 01/12] chore(main): release 1.2.1 (#61) --- CHANGELOG.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 20d5a900..0ccfe4ef 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## [1.2.1](https://github.com/jellydn/CopilotChat.nvim/compare/v1.2.0...v1.2.1) (2024-02-05) + + +### Reverts + +* **ci:** add release workflow back ([81a9d81](https://github.com/jellydn/CopilotChat.nvim/commit/81a9d818b1369d41108c46da477e4ea5cec0a525)) + ## [1.2.0](https://github.com/jellydn/CopilotChat.nvim/compare/v1.1.0...v1.2.0) (2024-02-04) ### Features From 4694b66538605bd57cec0f9355bab8f36a1f0ccb Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Mon, 5 Feb 2024 00:07:01 +0000 Subject: [PATCH 02/12] chore(doc): auto generate docs --- doc/CopilotChat.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/CopilotChat.txt b/doc/CopilotChat.txt index 89d6c082..a9462e8e 100644 --- a/doc/CopilotChat.txt +++ b/doc/CopilotChat.txt @@ -1,4 +1,4 @@ -*CopilotChat.txt* For NVIM v0.8.0 Last change: 2024 February 04 +*CopilotChat.txt* For NVIM v0.8.0 Last change: 2024 February 05 ============================================================================== Table of Contents *CopilotChat-table-of-contents* From 5c4c22d1bb13d1d927c3301840d2a0699df2b732 Mon Sep 17 00:00:00 2001 From: Huynh Duc Dung Date: Mon, 5 Feb 2024 10:24:36 +0800 Subject: [PATCH 03/12] refactor!: disable extra info as default --- lua/CopilotChat/init.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lua/CopilotChat/init.lua b/lua/CopilotChat/init.lua index a5876373..9fe5f325 100644 --- a/lua/CopilotChat/init.lua +++ b/lua/CopilotChat/init.lua @@ -12,11 +12,12 @@ _COPILOT_CHAT_GLOBAL_CONFIG = {} -- Set up the plugin ---@param options (table | nil) -- - show_help: ('yes' | 'no') default: 'yes'. +-- - disable_extra_info: ('yes' | 'no') default: 'yes'. -- - prompts: (table?) default: default_prompts. -- - debug: (boolean?) default: false. M.setup = function(options) vim.g.copilot_chat_show_help = options and options.show_help or 'yes' - vim.g.copilot_chat_disable_separators = options and options.disable_extra_info or false + vim.g.copilot_chat_disable_separators = options and options.disable_extra_info or 'yes' local debug = options and options.debug or false _COPILOT_CHAT_GLOBAL_CONFIG.debug = debug From a5319e508910c4f90ca8fd91f368074eb2a00048 Mon Sep 17 00:00:00 2001 From: Huynh Duc Dung Date: Mon, 5 Feb 2024 10:24:58 +0800 Subject: [PATCH 04/12] docs: add disable_extra_info flag on readme --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 07047001..b2e07617 100644 --- a/README.md +++ b/README.md @@ -31,6 +31,7 @@ return { opts = { show_help = "yes", -- Show help text for CopilotChatInPlace, default: yes debug = false, -- Enable or disable debug mode, the log file will be in ~/.local/state/nvim/CopilotChat.nvim.log + disable_extra_info = 'no', -- Disable extra information (e.g: system prompt) in the response. }, build = function() vim.notify("Please update the remote plugins by running ':UpdateRemotePlugins', then restart Neovim.") From 4d596994d1df9e05a8e6715c43aa81b1798e885e Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Mon, 5 Feb 2024 02:25:21 +0000 Subject: [PATCH 05/12] chore(doc): auto generate docs --- doc/CopilotChat.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/doc/CopilotChat.txt b/doc/CopilotChat.txt index a9462e8e..d4e5a880 100644 --- a/doc/CopilotChat.txt +++ b/doc/CopilotChat.txt @@ -49,6 +49,7 @@ LAZY.NVIM ~ opts = { show_help = "yes", -- Show help text for CopilotChatInPlace, default: yes debug = false, -- Enable or disable debug mode, the log file will be in ~/.local/state/nvim/CopilotChat.nvim.log + disable_extra_info = 'no', -- Disable extra information (e.g: system prompt) in the response. }, build = function() vim.notify("Please update the remote plugins by running ':UpdateRemotePlugins', then restart Neovim.") From d1e65c056035459c5e14a75e779c39db9f04f8a6 Mon Sep 17 00:00:00 2001 From: "allcontributors[bot]" <46447321+allcontributors[bot]@users.noreply.github.com> Date: Mon, 5 Feb 2024 11:38:44 +0800 Subject: [PATCH 06/12] docs: add PostCyberPunk as a contributor for doc (#63) --- .all-contributorsrc | 43 +++++++++++++++++++++++++++++++++++-------- README.md | 7 ++++--- 2 files changed, 39 insertions(+), 11 deletions(-) diff --git a/.all-contributorsrc b/.all-contributorsrc index 4bd80307..59f826dd 100644 --- a/.all-contributorsrc +++ b/.all-contributorsrc @@ -1,5 +1,7 @@ { - "files": ["README.md"], + "files": [ + "README.md" + ], "imageSize": 100, "commit": false, "commitType": "docs", @@ -10,49 +12,74 @@ "name": "gptlang", "avatar_url": "https://avatars.githubusercontent.com/u/121417512?v=4", "profile": "https://github.com/gptlang", - "contributions": ["code", "doc"] + "contributions": [ + "code", + "doc" + ] }, { "login": "jellydn", "name": "Dung Duc Huynh (Kaka)", "avatar_url": "https://avatars.githubusercontent.com/u/870029?v=4", "profile": "https://productsway.com/", - "contributions": ["code", "doc"] + "contributions": [ + "code", + "doc" + ] }, { "login": "qoobes", "name": "Ahmed Haracic", "avatar_url": "https://avatars.githubusercontent.com/u/58834655?v=4", "profile": "https://qoobes.dev", - "contributions": ["code"] + "contributions": [ + "code" + ] }, { "login": "ziontee113", "name": "Trí Thiện Nguyễn", "avatar_url": "https://avatars.githubusercontent.com/u/102876811?v=4", "profile": "https://youtube.com/@ziontee113", - "contributions": ["code"] + "contributions": [ + "code" + ] }, { "login": "Cassius0924", "name": "He Zhizhou", "avatar_url": "https://avatars.githubusercontent.com/u/62874592?v=4", "profile": "https://github.com/Cassius0924", - "contributions": ["code"] + "contributions": [ + "code" + ] }, { "login": "rguruprakash", "name": "Guruprakash Rajakkannu", "avatar_url": "https://avatars.githubusercontent.com/u/9963717?v=4", "profile": "https://www.linkedin.com/in/guruprakashrajakkannu/", - "contributions": ["code"] + "contributions": [ + "code" + ] }, { "login": "kristofka", "name": "kristofka", "avatar_url": "https://avatars.githubusercontent.com/u/140354?v=4", "profile": "https://github.com/kristofka", - "contributions": ["code"] + "contributions": [ + "code" + ] + }, + { + "login": "PostCyberPunk", + "name": "PostCyberPunk", + "avatar_url": "https://avatars.githubusercontent.com/u/134976996?v=4", + "profile": "https://github.com/PostCyberPunk", + "contributions": [ + "doc" + ] } ], "contributorsPerLine": 7, diff --git a/README.md b/README.md index b2e07617..17e12411 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,7 @@ # Copilot Chat for Neovim - -[![All Contributors](https://img.shields.io/badge/all_contributors-7-orange.svg?style=flat-square)](#contributors-) - +[![All Contributors](https://img.shields.io/badge/all_contributors-8-orange.svg?style=flat-square)](#contributors-) > [!NOTE] @@ -289,6 +287,9 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d Guruprakash Rajakkannu
Guruprakash Rajakkannu

💻 kristofka
kristofka

💻 + + PostCyberPunk
PostCyberPunk

📖 + From 0c443cb785b528fcf21ff6668cea9579fd8d9316 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Mon, 5 Feb 2024 03:39:05 +0000 Subject: [PATCH 07/12] chore(doc): auto generate docs --- doc/CopilotChat.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/CopilotChat.txt b/doc/CopilotChat.txt index d4e5a880..4b382413 100644 --- a/doc/CopilotChat.txt +++ b/doc/CopilotChat.txt @@ -313,14 +313,14 @@ CONTRIBUTORS ✨ *CopilotChat-copilot-chat-for-neovim-contributors-✨* Thanks goes to these wonderful people (emoji key ): -gptlang💻 📖Dung Duc Huynh (Kaka)💻 📖Ahmed Haracic💻Trí Thiện Nguyễn💻He Zhizhou💻Guruprakash Rajakkannu💻kristofka💻This project follows the all-contributors +gptlang💻 📖Dung Duc Huynh (Kaka)💻 📖Ahmed Haracic💻Trí Thiện Nguyễn💻He Zhizhou💻Guruprakash Rajakkannu💻kristofka💻PostCyberPunk📖This project follows the all-contributors specification. Contributions of any kind welcome! ============================================================================== 2. Links *CopilotChat-links* -1. *All Contributors*: https://img.shields.io/badge/all_contributors-7-orange.svg?style=flat-square +1. *All Contributors*: https://img.shields.io/badge/all_contributors-8-orange.svg?style=flat-square 2. *@jellydn*: 3. *Chat Demo*: https://i.gyazo.com/10fbd1543380d15551791c1a6dcbcd46.gif 4. *Explain Code Demo*: https://i.gyazo.com/e5031f402536a1a9d6c82b2c38d469e3.gif From d5f26b45f6b797719833bf27f66d8dbaa4c1b8d4 Mon Sep 17 00:00:00 2001 From: "Dung Duc Huynh (Kaka)" <870029+jellydn@users.noreply.github.com> Date: Mon, 5 Feb 2024 11:42:16 +0800 Subject: [PATCH 08/12] docs: add same keybinds in both visual and normal mode (#62) (#64) Co-authored-by: PostCyberPunk <134976996+PostCyberPunk@users.noreply.github.com> --- README.md | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/README.md b/README.md index 17e12411..15dc5bb9 100644 --- a/README.md +++ b/README.md @@ -250,6 +250,36 @@ Follow the example below to create a simple input for CopilotChat. }, ``` +### Add same keybinds in both visual and normal mode + +```lua + { + "jellydn/CopilotChat.nvim", + keys = + function() + local keybinds={ + --add your custom keybinds here + } + -- change prompt and keybinds as per your need + local my_prompts = { + {prompt = "In Neovim.",desc = "Neovim",key = "n"}, + {prompt = "Help with this",desc = "Help",key = "h"}, + {prompt = "Simplify and imporve readablilty",desc = "Simplify",key = "s"}, + {prompt = "Optimize the code to improve perfomance and readablilty.",desc = "Optimize",key = "o"}, + {prompt = "Find possible errors and fix them for me",desc = "Fix",key = "f"}, + {prompt = "Explain in detail",desc = "Explain",key = "e"}, + {prompt = "Write a shell scirpt",desc = "Shell",key = "S"}, + } + -- you can change cc to your desired keybind prefix + for _,v in pairs(my_prompts) do + table.insert(keybinds,{ "cc"..v.key, ":CopilotChatVisual "..v.prompt.."", mode = "x", desc = "CopilotChat - "..v.desc }) + table.insert(keybinds,{ "cc"..v.key, "CopilotChat "..v.prompt.."", desc = "CopilotChat - "..v.desc }) + end + return keybinds + end, + }, +``` + ## Roadmap - Translation to pure Lua From ad198edd6ebb19fa3da27644d41cd0ad24ee3965 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Mon, 5 Feb 2024 03:42:35 +0000 Subject: [PATCH 09/12] chore(doc): auto generate docs --- doc/CopilotChat.txt | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/doc/CopilotChat.txt b/doc/CopilotChat.txt index 4b382413..a4361c87 100644 --- a/doc/CopilotChat.txt +++ b/doc/CopilotChat.txt @@ -285,6 +285,37 @@ Follow the example below to create a simple input for CopilotChat. < +ADD SAME KEYBINDS IN BOTH VISUAL AND NORMAL MODE ~ + +>lua + { + "jellydn/CopilotChat.nvim", + keys = + function() + local keybinds={ + --add your custom keybinds here + } + -- change prompt and keybinds as per your need + local my_prompts = { + {prompt = "In Neovim.",desc = "Neovim",key = "n"}, + {prompt = "Help with this",desc = "Help",key = "h"}, + {prompt = "Simplify and imporve readablilty",desc = "Simplify",key = "s"}, + {prompt = "Optimize the code to improve perfomance and readablilty.",desc = "Optimize",key = "o"}, + {prompt = "Find possible errors and fix them for me",desc = "Fix",key = "f"}, + {prompt = "Explain in detail",desc = "Explain",key = "e"}, + {prompt = "Write a shell scirpt",desc = "Shell",key = "S"}, + } + -- you can change cc to your desired keybind prefix + for _,v in pairs(my_prompts) do + table.insert(keybinds,{ "cc"..v.key, ":CopilotChatVisual "..v.prompt.."", mode = "x", desc = "CopilotChat - "..v.desc }) + table.insert(keybinds,{ "cc"..v.key, "CopilotChat "..v.prompt.."", desc = "CopilotChat - "..v.desc }) + end + return keybinds + end, + }, +< + + ROADMAP *CopilotChat-copilot-chat-for-neovim-roadmap* - Translation to pure Lua From 0fa28e7f78e6caa062e5c6a19f3713ff0b0ad547 Mon Sep 17 00:00:00 2001 From: "Dung Duc Huynh (Kaka)" <870029+jellydn@users.noreply.github.com> Date: Mon, 5 Feb 2024 11:44:06 +0800 Subject: [PATCH 10/12] docs: add same keybinds in both visual and normal mode (#24) * Fix Python 3.10 and add disable_extra_info option (#60) * fix Python3.10 by removing Unpack type infomation * add option to remove extra information: disable_extra_info * chore(main): release 1.2.1 (#61) * chore(doc): auto generate docs * refactor!: disable extra info as default * docs: add disable_extra_info flag on readme * chore(doc): auto generate docs * docs: add PostCyberPunk as a contributor for doc (#63) * chore(doc): auto generate docs * docs: add same keybinds in both visual and normal mode (#62) (#64) Co-authored-by: PostCyberPunk <134976996+PostCyberPunk@users.noreply.github.com> * chore(doc): auto generate docs --------- Co-authored-by: gptlang <121417512+gptlang@users.noreply.github.com> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: github-actions[bot] Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com> Co-authored-by: PostCyberPunk <134976996+PostCyberPunk@users.noreply.github.com> --- .all-contributorsrc | 43 +++++++++++++++++++++++++++++++++++-------- README.md | 37 ++++++++++++++++++++++++++++++++++--- doc/CopilotChat.txt | 35 +++++++++++++++++++++++++++++++++-- 3 files changed, 102 insertions(+), 13 deletions(-) diff --git a/.all-contributorsrc b/.all-contributorsrc index 4bd80307..59f826dd 100644 --- a/.all-contributorsrc +++ b/.all-contributorsrc @@ -1,5 +1,7 @@ { - "files": ["README.md"], + "files": [ + "README.md" + ], "imageSize": 100, "commit": false, "commitType": "docs", @@ -10,49 +12,74 @@ "name": "gptlang", "avatar_url": "https://avatars.githubusercontent.com/u/121417512?v=4", "profile": "https://github.com/gptlang", - "contributions": ["code", "doc"] + "contributions": [ + "code", + "doc" + ] }, { "login": "jellydn", "name": "Dung Duc Huynh (Kaka)", "avatar_url": "https://avatars.githubusercontent.com/u/870029?v=4", "profile": "https://productsway.com/", - "contributions": ["code", "doc"] + "contributions": [ + "code", + "doc" + ] }, { "login": "qoobes", "name": "Ahmed Haracic", "avatar_url": "https://avatars.githubusercontent.com/u/58834655?v=4", "profile": "https://qoobes.dev", - "contributions": ["code"] + "contributions": [ + "code" + ] }, { "login": "ziontee113", "name": "Trí Thiện Nguyễn", "avatar_url": "https://avatars.githubusercontent.com/u/102876811?v=4", "profile": "https://youtube.com/@ziontee113", - "contributions": ["code"] + "contributions": [ + "code" + ] }, { "login": "Cassius0924", "name": "He Zhizhou", "avatar_url": "https://avatars.githubusercontent.com/u/62874592?v=4", "profile": "https://github.com/Cassius0924", - "contributions": ["code"] + "contributions": [ + "code" + ] }, { "login": "rguruprakash", "name": "Guruprakash Rajakkannu", "avatar_url": "https://avatars.githubusercontent.com/u/9963717?v=4", "profile": "https://www.linkedin.com/in/guruprakashrajakkannu/", - "contributions": ["code"] + "contributions": [ + "code" + ] }, { "login": "kristofka", "name": "kristofka", "avatar_url": "https://avatars.githubusercontent.com/u/140354?v=4", "profile": "https://github.com/kristofka", - "contributions": ["code"] + "contributions": [ + "code" + ] + }, + { + "login": "PostCyberPunk", + "name": "PostCyberPunk", + "avatar_url": "https://avatars.githubusercontent.com/u/134976996?v=4", + "profile": "https://github.com/PostCyberPunk", + "contributions": [ + "doc" + ] } ], "contributorsPerLine": 7, diff --git a/README.md b/README.md index b2e07617..15dc5bb9 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,7 @@ # Copilot Chat for Neovim - -[![All Contributors](https://img.shields.io/badge/all_contributors-7-orange.svg?style=flat-square)](#contributors-) - +[![All Contributors](https://img.shields.io/badge/all_contributors-8-orange.svg?style=flat-square)](#contributors-) > [!NOTE] @@ -252,6 +250,36 @@ Follow the example below to create a simple input for CopilotChat. }, ``` +### Add same keybinds in both visual and normal mode + +```lua + { + "jellydn/CopilotChat.nvim", + keys = + function() + local keybinds={ + --add your custom keybinds here + } + -- change prompt and keybinds as per your need + local my_prompts = { + {prompt = "In Neovim.",desc = "Neovim",key = "n"}, + {prompt = "Help with this",desc = "Help",key = "h"}, + {prompt = "Simplify and imporve readablilty",desc = "Simplify",key = "s"}, + {prompt = "Optimize the code to improve perfomance and readablilty.",desc = "Optimize",key = "o"}, + {prompt = "Find possible errors and fix them for me",desc = "Fix",key = "f"}, + {prompt = "Explain in detail",desc = "Explain",key = "e"}, + {prompt = "Write a shell scirpt",desc = "Shell",key = "S"}, + } + -- you can change cc to your desired keybind prefix + for _,v in pairs(my_prompts) do + table.insert(keybinds,{ "cc"..v.key, ":CopilotChatVisual "..v.prompt.."", mode = "x", desc = "CopilotChat - "..v.desc }) + table.insert(keybinds,{ "cc"..v.key, "CopilotChat "..v.prompt.."", desc = "CopilotChat - "..v.desc }) + end + return keybinds + end, + }, +``` + ## Roadmap - Translation to pure Lua @@ -289,6 +317,9 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d Guruprakash Rajakkannu
Guruprakash Rajakkannu

💻 kristofka
kristofka

💻 + + PostCyberPunk
PostCyberPunk

📖 + diff --git a/doc/CopilotChat.txt b/doc/CopilotChat.txt index d4e5a880..a4361c87 100644 --- a/doc/CopilotChat.txt +++ b/doc/CopilotChat.txt @@ -285,6 +285,37 @@ Follow the example below to create a simple input for CopilotChat. < +ADD SAME KEYBINDS IN BOTH VISUAL AND NORMAL MODE ~ + +>lua + { + "jellydn/CopilotChat.nvim", + keys = + function() + local keybinds={ + --add your custom keybinds here + } + -- change prompt and keybinds as per your need + local my_prompts = { + {prompt = "In Neovim.",desc = "Neovim",key = "n"}, + {prompt = "Help with this",desc = "Help",key = "h"}, + {prompt = "Simplify and imporve readablilty",desc = "Simplify",key = "s"}, + {prompt = "Optimize the code to improve perfomance and readablilty.",desc = "Optimize",key = "o"}, + {prompt = "Find possible errors and fix them for me",desc = "Fix",key = "f"}, + {prompt = "Explain in detail",desc = "Explain",key = "e"}, + {prompt = "Write a shell scirpt",desc = "Shell",key = "S"}, + } + -- you can change cc to your desired keybind prefix + for _,v in pairs(my_prompts) do + table.insert(keybinds,{ "cc"..v.key, ":CopilotChatVisual "..v.prompt.."", mode = "x", desc = "CopilotChat - "..v.desc }) + table.insert(keybinds,{ "cc"..v.key, "CopilotChat "..v.prompt.."", desc = "CopilotChat - "..v.desc }) + end + return keybinds + end, + }, +< + + ROADMAP *CopilotChat-copilot-chat-for-neovim-roadmap* - Translation to pure Lua @@ -313,14 +344,14 @@ CONTRIBUTORS ✨ *CopilotChat-copilot-chat-for-neovim-contributors-✨* Thanks goes to these wonderful people (emoji key ): -gptlang💻 📖Dung Duc Huynh (Kaka)💻 📖Ahmed Haracic💻Trí Thiện Nguyễn💻He Zhizhou💻Guruprakash Rajakkannu💻kristofka💻This project follows the all-contributors +gptlang💻 📖Dung Duc Huynh (Kaka)💻 📖Ahmed Haracic💻Trí Thiện Nguyễn💻He Zhizhou💻Guruprakash Rajakkannu💻kristofka💻PostCyberPunk📖This project follows the all-contributors specification. Contributions of any kind welcome! ============================================================================== 2. Links *CopilotChat-links* -1. *All Contributors*: https://img.shields.io/badge/all_contributors-7-orange.svg?style=flat-square +1. *All Contributors*: https://img.shields.io/badge/all_contributors-8-orange.svg?style=flat-square 2. *@jellydn*: 3. *Chat Demo*: https://i.gyazo.com/10fbd1543380d15551791c1a6dcbcd46.gif 4. *Explain Code Demo*: https://i.gyazo.com/e5031f402536a1a9d6c82b2c38d469e3.gif From adfeaf757862c864d01617626f35f518ac51c51a Mon Sep 17 00:00:00 2001 From: "Dung Duc Huynh (Kaka)" <870029+jellydn@users.noreply.github.com> Date: Mon, 5 Feb 2024 11:46:50 +0800 Subject: [PATCH 11/12] Create FUNDING.yml --- .github/FUNDING.yml | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 .github/FUNDING.yml diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml new file mode 100644 index 00000000..949fd0ff --- /dev/null +++ b/.github/FUNDING.yml @@ -0,0 +1,3 @@ +# These are supported funding model platforms + +github: [gptlang, jellydn] From 4c510acf31be9378730b75202ad4b3c2540259f1 Mon Sep 17 00:00:00 2001 From: "Dung Duc Huynh (Kaka)" <870029+jellydn@users.noreply.github.com> Date: Mon, 5 Feb 2024 21:41:31 +0800 Subject: [PATCH 12/12] docs: add announcement --- README.md | 334 +----------------------------------------------------- 1 file changed, 6 insertions(+), 328 deletions(-) diff --git a/README.md b/README.md index 15dc5bb9..a6445df0 100644 --- a/README.md +++ b/README.md @@ -1,331 +1,9 @@ -# Copilot Chat for Neovim +**Project Update: My Fork Now Part of CopilotC-Nvim** - -[![All Contributors](https://img.shields.io/badge/all_contributors-8-orange.svg?style=flat-square)](#contributors-) - +I'm pleased to share that my fork has been archived and integrated into the CopilotC-Nvim organization. This move enhances collaboration, increases update frequency, and expands community support. -> [!NOTE] -> You might want to take a look at [this fork](https://github.com/jellydn/CopilotChat.nvim) which is more well maintained & is more configurable. I personally use it now as well. +**What's Next?** +- Check out the project at [CopilotChat.nvim](https://github.com/CopilotC-Nvim/CopilotChat.nvim). +- For updates and contributions, visit the new repository under CopilotC-Nvim. -> [!NOTE] -> A new command, `CopilotChatInPlace` has been introduced. It functions like the ChatGPT plugin. Please run ":UpdateRemotePlugins" command and restart Neovim before starting a chat with Copilot. To stay updated on our roadmap, please join our [Discord](https://discord.gg/vy6hJsTWaZ) community. - -## Authentication - -It will prompt you with instructions on your first start. If you already have `Copilot.vim` or `Copilot.lua`, it will work automatically. - -## Installation - -### Lazy.nvim - -1. `pip install python-dotenv requests pynvim==0.5.0 prompt-toolkit` -2. `pip install tiktoken` (optional for displaying prompt token counts) -3. Put it in your lazy setup - -```lua -return { - { - "jellydn/CopilotChat.nvim", - opts = { - show_help = "yes", -- Show help text for CopilotChatInPlace, default: yes - debug = false, -- Enable or disable debug mode, the log file will be in ~/.local/state/nvim/CopilotChat.nvim.log - disable_extra_info = 'no', -- Disable extra information (e.g: system prompt) in the response. - }, - build = function() - vim.notify("Please update the remote plugins by running ':UpdateRemotePlugins', then restart Neovim.") - end, - event = "VeryLazy", - keys = { - { "cce", "CopilotChatExplain", desc = "CopilotChat - Explain code" }, - { "cct", "CopilotChatTests", desc = "CopilotChat - Generate tests" }, - { - "ccv", - ":CopilotChatVisual", - mode = "x", - desc = "CopilotChat - Open in vertical split", - }, - { - "ccx", - ":CopilotChatInPlace", - mode = "x", - desc = "CopilotChat - Run in-place code", - }, - }, - }, -} -``` - -4. Run command `:UpdateRemotePlugins`, then inspect the file `~/.local/share/nvim/rplugin.vim` for additional details. You will notice that the commands have been registered. - -For example: - -```vim -" python3 plugins -call remote#host#RegisterPlugin('python3', '/Users/huynhdung/.local/share/nvim/lazy/CopilotChat.nvim/rplugin/python3/copilot-plugin.py', [ - \ {'sync': v:false, 'name': 'CopilotChat', 'type': 'command', 'opts': {'nargs': '1'}}, - \ {'sync': v:false, 'name': 'CopilotChatVisual', 'type': 'command', 'opts': {'nargs': '1', 'range': ''}}, - \ {'sync': v:false, 'name': 'CopilotChatInPlace', 'type': 'command', 'opts': {'nargs': '*', 'range': ''}}, - \ {'sync': v:false, 'name': 'CopilotChatAutocmd', 'type': 'command', 'opts': {'nargs': '*'}}, - \ {'sync': v:false, 'name': 'CopilotChatMapping', 'type': 'command', 'opts': {'nargs': '*'}}, - \ ]) -``` - -5. Restart `neovim` - -### Manual - -1. Put the files in the right place - -``` -$ git clone https://github.com/jellydn/CopilotChat.nvim -$ cd CopilotChat.nvim -$ cp -r --backup=nil rplugin ~/.config/nvim/ -``` - -2. Install dependencies - -``` -$ pip install -r requirements.txt -``` - -3. Open up Neovim and run `:UpdateRemotePlugins` -4. Restart Neovim - -## Usage - -### Configuration - -You have the ability to tailor this plugin to your specific needs using the configuration options outlined below: - -```lua -{ - debug = false, -- Enable or disable debug mode - show_help = 'yes', -- Show help text for CopilotChatInPlace - prompts = { -- Set dynamic prompts for CopilotChat commands - Explain = 'Explain how it works.', - Tests = 'Briefly explain how the selected code works, then generate unit tests.', - } -} -``` - -You have the capability to expand the prompts to create more versatile commands: - -```lua -return { - "jellydn/CopilotChat.nvim", - opts = { - debug = true, - show_help = "yes", - prompts = { - Explain = "Explain how it works.", - Review = "Review the following code and provide concise suggestions.", - Tests = "Briefly explain how the selected code works, then generate unit tests.", - Refactor = "Refactor the code to improve clarity and readability.", - }, - }, - build = function() - vim.notify("Please update the remote plugins by running ':UpdateRemotePlugins', then restart Neovim.") - end, - event = "VeryLazy", - keys = { - { "cce", "CopilotChatExplain", desc = "CopilotChat - Explain code" }, - { "cct", "CopilotChatTests", desc = "CopilotChat - Generate tests" }, - { "ccr", "CopilotChatReview", desc = "CopilotChat - Review code" }, - { "ccR", "CopilotChatRefactor", desc = "CopilotChat - Refactor code" }, - } -} -``` - -For further reference, you can view @jellydn's [configuration](https://github.com/jellydn/lazy-nvim-ide/blob/main/lua/plugins/extras/copilot-chat.lua). - -### Chat with Github Copilot - -1. Copy some code into the unnamed register using the `y` command. -2. Run the command `:CopilotChat` followed by your question. For example, `:CopilotChat What does this code do?` - -![Chat Demo](https://i.gyazo.com/10fbd1543380d15551791c1a6dcbcd46.gif) - -### Code Explanation - -1. Copy some code into the unnamed register using the `y` command. -2. Run the command `:CopilotChatExplain`. - -![Explain Code Demo](https://i.gyazo.com/e5031f402536a1a9d6c82b2c38d469e3.gif) - -### Generate Tests - -1. Copy some code into the unnamed register using the `y` command. -2. Run the command `:CopilotChatTests`. - -[![Generate tests](https://i.gyazo.com/f285467d4b8d8f8fd36aa777305312ae.gif)](https://gyazo.com/f285467d4b8d8f8fd36aa777305312ae) - -### Token count & Fold with visual mode - -1. Select some code using visual mode. -2. Run the command `:CopilotChatVisual` with your question. - -[![Fold Demo](https://i.gyazo.com/766fb3b6ffeb697e650fc839882822a8.gif)](https://gyazo.com/766fb3b6ffeb697e650fc839882822a8) - -### In-place Chat Popup - -1. Select some code using visual mode. -2. Run the command `:CopilotChatInPlace` and type your prompt. For example, `What does this code do?` -3. Press `Enter` to send your question to Github Copilot. -4. Press `q` to quit. There is help text at the bottom of the screen. You can also press `?` to toggle the help text. - -[![In-place Demo](https://i.gyazo.com/4a5badaa109cd483c1fc23d296325cb0.gif)](https://gyazo.com/4a5badaa109cd483c1fc23d296325cb0) - -## Tips - -### Debugging with `:messages` and `:CopilotChatDebugInfo` - -If you encounter any issues, you can run the command `:messages` to inspect the log. You can also run the command `:CopilotChatDebugInfo` to inspect the debug information. - -[![Debug Info](https://i.gyazo.com/bf00e700bcee1b77bcbf7b516b552521.gif)](https://gyazo.com/bf00e700bcee1b77bcbf7b516b552521) - -### How to setup with `which-key.nvim` - -A special thanks to @ecosse3 for the configuration of [which-key](https://github.com/jellydn/CopilotChat.nvim/issues/30). - -```lua - { - "jellydn/CopilotChat.nvim", - event = "VeryLazy", - opts = { - prompts = { - Explain = "Explain how it works.", - Review = "Review the following code and provide concise suggestions.", - Tests = "Briefly explain how the selected code works, then generate unit tests.", - Refactor = "Refactor the code to improve clarity and readability.", - }, - }, - build = function() - vim.notify("Please update the remote plugins by running ':UpdateRemotePlugins', then restart Neovim.") - end, - config = function() - local present, wk = pcall(require, "which-key") - if not present then - return - end - - wk.register({ - c = { - c = { - name = "Copilot Chat", - } - } - }, { - mode = "n", - prefix = "", - silent = true, - noremap = true, - nowait = false, - }) - end, - keys = { - { "ccc", ":CopilotChat ", desc = "CopilotChat - Prompt" }, - { "cce", ":CopilotChatExplain ", desc = "CopilotChat - Explain code" }, - { "cct", "CopilotChatTests", desc = "CopilotChat - Generate tests" }, - { "ccr", "CopilotChatReview", desc = "CopilotChat - Review code" }, - { "ccR", "CopilotChatRefactor", desc = "CopilotChat - Refactor code" }, - } - }, -``` - -### Create a simple input for CopilotChat - -Follow the example below to create a simple input for CopilotChat. - -```lua --- Create input for CopilotChat - { - "cci", - function() - local input = vim.fn.input("Ask Copilot: ") - if input ~= "" then - vim.cmd("CopilotChat " .. input) - end - end, - desc = "CopilotChat - Ask input", - }, -``` - -### Add same keybinds in both visual and normal mode - -```lua - { - "jellydn/CopilotChat.nvim", - keys = - function() - local keybinds={ - --add your custom keybinds here - } - -- change prompt and keybinds as per your need - local my_prompts = { - {prompt = "In Neovim.",desc = "Neovim",key = "n"}, - {prompt = "Help with this",desc = "Help",key = "h"}, - {prompt = "Simplify and imporve readablilty",desc = "Simplify",key = "s"}, - {prompt = "Optimize the code to improve perfomance and readablilty.",desc = "Optimize",key = "o"}, - {prompt = "Find possible errors and fix them for me",desc = "Fix",key = "f"}, - {prompt = "Explain in detail",desc = "Explain",key = "e"}, - {prompt = "Write a shell scirpt",desc = "Shell",key = "S"}, - } - -- you can change cc to your desired keybind prefix - for _,v in pairs(my_prompts) do - table.insert(keybinds,{ "cc"..v.key, ":CopilotChatVisual "..v.prompt.."", mode = "x", desc = "CopilotChat - "..v.desc }) - table.insert(keybinds,{ "cc"..v.key, "CopilotChat "..v.prompt.."", desc = "CopilotChat - "..v.desc }) - end - return keybinds - end, - }, -``` - -## Roadmap - -- Translation to pure Lua -- Tokenizer -- Use vector encodings to automatically select code -- Sub commands - See [issue #5](https://github.com/gptlang/CopilotChat.nvim/issues/5) - -## Development - -### Installing Pre-commit Tool - -For development, you can use the provided Makefile command to install the pre-commit tool: - -```bash -make install-pre-commit -``` - -This will install the pre-commit tool and the pre-commit hooks. - -## Contributors ✨ - -Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)): - - - - - - - - - - - - - - - - - - - -
gptlang
gptlang

💻 📖
Dung Duc Huynh (Kaka)
Dung Duc Huynh (Kaka)

💻 📖
Ahmed Haracic
Ahmed Haracic

💻
Trí Thiện Nguyễn
Trí Thiện Nguyễn

💻
He Zhizhou
He Zhizhou

💻
Guruprakash Rajakkannu
Guruprakash Rajakkannu

💻
kristofka
kristofka

💻
PostCyberPunk
PostCyberPunk

📖
- - - - - - -This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome! +Your support and contributions are appreciated as we continue to develop Copilot Chat for Neovim.