Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
gptlang committed Feb 1, 2024
2 parents 154d361 + 4a01c3d commit 528bbb3
Showing 1 changed file with 50 additions and 20 deletions.
70 changes: 50 additions & 20 deletions doc/CopilotChat.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,9 @@ Table of Contents *CopilotChat-table-of-contents*
|CopilotChat-|


[!NOTE] There is a new command: `CopilotChatInPlace`, which functions similarly
to ChatGPT plugin. You can find it in the canary
<https://github.com/jellydn/CopilotChat.nvim/tree/canary?tab=readme-ov-file#lazynvim>
branch.
[!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.

AUTHENTICATION *CopilotChat-copilot-chat-for-neovim-authentication*

Expand All @@ -33,27 +32,39 @@ INSTALLATION *CopilotChat-copilot-chat-for-neovim-installation*
LAZY.NVIM ~

1. `pip install python-dotenv requests pynvim==0.5.0 prompt-toolkit`
2. Put it in your lazy setup
2. `pip install tiktoken` (optional for displaying prompt token counts)
3. Put it in your lazy setup

>lua
return {
{
"jellydn/CopilotChat.nvim",
"gptlang/CopilotChat.nvim",
dependencies = { "zbirenbaum/copilot.lua" }, -- Or { "github/copilot.vim" }
opts = {
mode = "split", -- newbuffer or split , default: newbuffer
mode = "split", -- newbuffer or split, default: newbuffer
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
},
build = function()
vim.defer_fn(function()
vim.cmd("UpdateRemotePlugins")
vim.notify("CopilotChat - Updated remote plugins. Please restart Neovim.")
end, 3000)
vim.notify("Please update the remote plugins by running ':UpdateRemotePlugins', then restart Neovim.")
end,
event = "VeryLazy",
keys = {
{ "<leader>cce", "<cmd>CopilotChatExplain<cr>", desc = "CopilotChat - Explain code" },
{ "<leader>cct", "<cmd>CopilotChatTests<cr>", desc = "CopilotChat - Generate tests" },
-- Those are available only on canary branch
{
"<leader>ccv",
":CopilotChatVsplitVisual",
mode = "x",
desc = "CopilotChat - Open in vertical split",
},
{
"<leader>ccx",
":CopilotChatInPlace<cr>",
mode = "x",
desc = "CopilotChat - Run in-place code",
},
},
},
}
Expand Down Expand Up @@ -94,6 +105,7 @@ 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.',
Expand All @@ -106,7 +118,7 @@ commands:

>lua
return {
"jellydn/CopilotChat.nvim",
"gptlang/CopilotChat.nvim",
opts = {
mode = "split",
prompts = {
Expand All @@ -117,10 +129,7 @@ commands:
},
},
build = function()
vim.defer_fn(function()
vim.cmd("UpdateRemotePlugins")
vim.notify("CopilotChat - Updated remote plugins. Please restart Neovim.")
end, 3000)
vim.notify("Please update the remote plugins by running ':UpdateRemotePlugins', then restart Neovim.")
end,
event = "VeryLazy",
keys = {
Expand All @@ -132,7 +141,7 @@ commands:
}
<

For further reference, you can view my configuration
For further reference, you can view @jellydn’s configuration
<https://github.com/jellydn/lazy-nvim-ide/blob/main/lua/plugins/extras/copilot-chat.lua>.


Expand All @@ -156,6 +165,24 @@ GENERATE TESTS ~
<https://gyazo.com/f285467d4b8d8f8fd36aa777305312ae>


TOKEN COUNT & FOLD ~

1. Select some code using visual mode.
2. Run the command `:CopilotChatVsplitVisual` with your question.

<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.

<https://gyazo.com/4a5badaa109cd483c1fc23d296325cb0>


ROADMAP *CopilotChat-copilot-chat-for-neovim-roadmap*

- Translation to pure Lua
Expand All @@ -177,9 +204,12 @@ Contributions of any kind welcome!
2. Links *CopilotChat-links*

1. *All Contributors*: https://img.shields.io/badge/all_contributors-5-orange.svg?style=flat-square
2. *Chat Demo*: https://i.gyazo.com/10fbd1543380d15551791c1a6dcbcd46.gif
3. *Explain Code Demo*: https://i.gyazo.com/e5031f402536a1a9d6c82b2c38d469e3.gif
4. *Generate tests*: https://i.gyazo.com/f285467d4b8d8f8fd36aa777305312ae.gif
2. *@jellydn*:
3. *Chat Demo*: https://i.gyazo.com/10fbd1543380d15551791c1a6dcbcd46.gif
4. *Explain Code Demo*: https://i.gyazo.com/e5031f402536a1a9d6c82b2c38d469e3.gif
5. *Generate tests*: https://i.gyazo.com/f285467d4b8d8f8fd36aa777305312ae.gif
6. *Fold Demo*: https://i.gyazo.com/766fb3b6ffeb697e650fc839882822a8.gif
7. *In-place Demo*: https://i.gyazo.com/4a5badaa109cd483c1fc23d296325cb0.gif

Generated by panvimdoc <https://github.com/kdheepak/panvimdoc>

Expand Down

0 comments on commit 528bbb3

Please sign in to comment.