Skip to content

Commit

Permalink
Automatically register copilot-chat for treesitter markdown
Browse files Browse the repository at this point in the history
And add render-markdown integration info

Signed-off-by: Tomas Slusny <[email protected]>
  • Loading branch information
deathbeam committed Nov 16, 2024
1 parent b555e55 commit 0db8544
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
15 changes: 15 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -509,6 +509,21 @@ require('CopilotChat').setup({

</details>

<details>
<summary>render-markdown integration</summary>

Requires [render-markdown](https://github.com/MeanderingProgrammer/render-markdown.nvim) plugin to be installed.

```lua
require('render-markdown').setup({
file_types = { 'markdown', 'copilot-chat' },
})
```

![image](https://github.com/user-attachments/assets/d8dc16f8-3f61-43fa-bfb9-83f240ae30e8)

</details>

## Roadmap (Wishlist)

- Use indexed vector database with current workspace for better context selection
Expand Down
2 changes: 2 additions & 0 deletions lua/CopilotChat/chat.lua
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ local Chat = class(function(self, help, auto_insert, on_buf_create)
self.separator = nil
self.layout = nil

vim.treesitter.language.register('markdown', 'copilot-chat')

self.buf_create = function()
local bufnr = vim.api.nvim_create_buf(false, true)
vim.api.nvim_buf_set_name(bufnr, 'copilot-chat')
Expand Down

0 comments on commit 0db8544

Please sign in to comment.