Skip to content

Commit

Permalink
docs: add same keybinds in both visual and normal mode (#24)
Browse files Browse the repository at this point in the history
* 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 <[email protected]>

* chore(doc): auto generate docs

---------

Co-authored-by: gptlang <[email protected]>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>
Co-authored-by: PostCyberPunk <[email protected]>
  • Loading branch information
6 people authored Feb 5, 2024
1 parent 4d59699 commit 0fa28e7
Show file tree
Hide file tree
Showing 3 changed files with 102 additions and 13 deletions.
43 changes: 35 additions & 8 deletions .all-contributorsrc
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
{
"files": ["README.md"],
"files": [
"README.md"
],
"imageSize": 100,
"commit": false,
"commitType": "docs",
Expand All @@ -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,
Expand Down
37 changes: 34 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
# Copilot Chat for Neovim

<!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->

[![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-)
<!-- ALL-CONTRIBUTORS-BADGE:END -->

> [!NOTE]
Expand Down Expand Up @@ -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 <leader>cc to your desired keybind prefix
for _,v in pairs(my_prompts) do
table.insert(keybinds,{ "<leader>cc"..v.key, ":CopilotChatVisual "..v.prompt.."<cr>", mode = "x", desc = "CopilotChat - "..v.desc })
table.insert(keybinds,{ "<leader>cc"..v.key, "<cmd>CopilotChat "..v.prompt.."<cr>", desc = "CopilotChat - "..v.desc })
end
return keybinds
end,
},
```

## Roadmap

- Translation to pure Lua
Expand Down Expand Up @@ -289,6 +317,9 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d
<td align="center" valign="top" width="14.28%"><a href="https://www.linkedin.com/in/guruprakashrajakkannu/"><img src="https://avatars.githubusercontent.com/u/9963717?v=4?s=100" width="100px;" alt="Guruprakash Rajakkannu"/><br /><sub><b>Guruprakash Rajakkannu</b></sub></a><br /><a href="https://github.com/jellydn/CopilotChat.nvim/commits?author=rguruprakash" title="Code">💻</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/kristofka"><img src="https://avatars.githubusercontent.com/u/140354?v=4?s=100" width="100px;" alt="kristofka"/><br /><sub><b>kristofka</b></sub></a><br /><a href="https://github.com/jellydn/CopilotChat.nvim/commits?author=kristofka" title="Code">💻</a></td>
</tr>
<tr>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/PostCyberPunk"><img src="https://avatars.githubusercontent.com/u/134976996?v=4?s=100" width="100px;" alt="PostCyberPunk"/><br /><sub><b>PostCyberPunk</b></sub></a><br /><a href="https://github.com/jellydn/CopilotChat.nvim/commits?author=PostCyberPunk" title="Documentation">📖</a></td>
</tr>
</tbody>
</table>

Expand Down
35 changes: 33 additions & 2 deletions doc/CopilotChat.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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 <leader>cc to your desired keybind prefix
for _,v in pairs(my_prompts) do
table.insert(keybinds,{ "<leader>cc"..v.key, ":CopilotChatVisual "..v.prompt.."<cr>", mode = "x", desc = "CopilotChat - "..v.desc })
table.insert(keybinds,{ "<leader>cc"..v.key, "<cmd>CopilotChat "..v.prompt.."<cr>", desc = "CopilotChat - "..v.desc })
end
return keybinds
end,
},
<


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

- Translation to pure Lua
Expand Down Expand Up @@ -313,14 +344,14 @@ CONTRIBUTORS ✨ *CopilotChat-copilot-chat-for-neovim-contributors-✨*
Thanks goes to these wonderful people (emoji key
<https://allcontributors.org/docs/en/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
<https://github.com/all-contributors/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
Expand Down

0 comments on commit 0fa28e7

Please sign in to comment.