From f2ae8cf3bd666153cdfeaad37c453ef8742986bb Mon Sep 17 00:00:00 2001 From: Oli Morris Date: Sun, 26 Jan 2025 22:28:53 +0000 Subject: [PATCH] docs: update --- doc/.vitepress/config.mjs | 1 - doc/configuration/others.md | 13 +++++++++++++ doc/usage/action-palette.md | 25 +++++++++++++++++++++++++ doc/usage/introduction.md | 19 ++++++++++++++++--- doc/usage/others.md | 13 ------------- doc/usage/workflows.md | 2 ++ 6 files changed, 56 insertions(+), 17 deletions(-) delete mode 100644 doc/usage/others.md diff --git a/doc/.vitepress/config.mjs b/doc/.vitepress/config.mjs index 5a100274..3fc7596a 100644 --- a/doc/.vitepress/config.mjs +++ b/doc/.vitepress/config.mjs @@ -91,7 +91,6 @@ export default defineConfig({ { text: "Events", link: "/usage/events" }, { text: "Inline Assistant", link: "/usage/inline-assistant" }, { text: "Workflows", link: "/usage/workflows" }, - { text: "Others", link: "/usage/others" }, ], }, { diff --git a/doc/configuration/others.md b/doc/configuration/others.md index 4fdfea6d..9df3cfc0 100644 --- a/doc/configuration/others.md +++ b/doc/configuration/others.md @@ -43,3 +43,16 @@ require("codecompanion").setup({ }, }), ``` +## Highlight Groups + +The plugin sets the following highlight groups during setup: + +- `CodeCompanionChatHeader` - The headers in the chat buffer +- `CodeCompanionChatSeparator` - Separator between headings in the chat buffer +- `CodeCompanionChatTokens` - Virtual text in the chat buffer showing the token count +- `CodeCompanionChatAgent` - Agents in the chat buffer +- `CodeCompanionChatTool` - Tools in the chat buffer +- `CodeCompanionChatVariable` - Variables in the chat buffer +- `CodeCompanionVirtualText` - All other virtual text in the plugin + + diff --git a/doc/usage/action-palette.md b/doc/usage/action-palette.md index 839914d1..3317e6e4 100644 --- a/doc/usage/action-palette.md +++ b/doc/usage/action-palette.md @@ -1 +1,26 @@ # Using the Action Palette + +

+ +

+ +The _Action Palette_ has been designed to be your entry point for the many configuration options that CodeCompanion offers. It can be opened with `:CodeCompanionActions`. + +Once opened, the user can see plugin defined actions such as `Chat` and `Open Chats`. The latter, enabling the user to move between any open chat buffers. These can be turned off in the config by setting `display.action_palette.opts.show_default_actions = false`. + +## Default Prompts + +The plugin also defines a number of prompts in the form of the prompt library: + +- `Explain` - Explain how code in a buffer works +- `Fix Code` - Fix the selected code +- `Explain LSP Diagnostics` - Explain the LSP diagnostics for the selected code +- `Unit Tests` - Generate unit tests for selected code +- `Generate a Commit Message` - Generate a commit message + +> [!INFO] +> These can also be called via the cmd line for example `:CodeCompanion /explain` + +The plugin also contains an example workflow, `Code Workflow`. See the [workflows section](/usage/workflows) for more information. + +The default prompts can be turned off by setting `display.action_palette.show_default_prompt_library = false`. diff --git a/doc/usage/introduction.md b/doc/usage/introduction.md index 93b10e0c..4e09d658 100644 --- a/doc/usage/introduction.md +++ b/doc/usage/introduction.md @@ -1,9 +1,22 @@ # Using CodeCompanion -Below are some ideas for how you can use the plugin to make your Neovim workflow more productive +CodeCompanion continues to evolve with regular frequency. This page will endeavour to serve as focal point for providing useful productivity tips for the plugin. -## Available Commands +## Copying code from a chat buffer -## Use the `@editor` Tool +The fastest way to copy an LLM's code output is with `gy`. This will yank the nearest codeblock. +## Automatically update a buffer + +The [editor](/usage/chat-buffer/agents#editor) tool enables an LLM to modify code in a Neovim buffer. This is especially useful if you do not wish to manually apply an LLM's suggestions yourself. Simply tag it in the chat buffer with `@editor`. + +## Run tests from the chat buffer + +The [cmd_runner](/usage/chat-buffer/agents#cmd-runner) tool enables an LLM to execute commands on your machine. This can be useful if you wish the LLM to run a test suite on your behalf and give insight on failing cases. + +## Quickly accessing a chat buffer + +The `:CodeCompanionChat Toggle` command will automically create a chat buffer if one doesn't exist, open the last chat buffer or hide the current chat buffer. It's the fastest way to navigate chat buffers. + +When in a chat buffer, you can cycle between other chat buffers with `{` or `}`. diff --git a/doc/usage/others.md b/doc/usage/others.md deleted file mode 100644 index 716c189e..00000000 --- a/doc/usage/others.md +++ /dev/null @@ -1,13 +0,0 @@ -# Other Usage Tips - -## Highlight Groups - -The plugin sets the following highlight groups during setup: - -- `CodeCompanionChatHeader` - The headers in the chat buffer -- `CodeCompanionChatSeparator` - Separator between headings in the chat buffer -- `CodeCompanionChatTokens` - Virtual text in the chat buffer showing the token count -- `CodeCompanionChatAgent` - Agents in the chat buffer -- `CodeCompanionChatTool` - Tools in the chat buffer -- `CodeCompanionChatVariable` - Variables in the chat buffer -- `CodeCompanionVirtualText` - All other virtual text in the plugin diff --git a/doc/usage/workflows.md b/doc/usage/workflows.md index 3a447475..cfdba8ba 100644 --- a/doc/usage/workflows.md +++ b/doc/usage/workflows.md @@ -1 +1,3 @@ # Using Workflows + +To be updated.