Skip to content

Commit

Permalink
docs: update
Browse files Browse the repository at this point in the history
  • Loading branch information
olimorris committed Jan 26, 2025
1 parent 4355d1b commit f2ae8cf
Show file tree
Hide file tree
Showing 6 changed files with 56 additions and 17 deletions.
1 change: 0 additions & 1 deletion doc/.vitepress/config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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" },
],
},
{
Expand Down
13 changes: 13 additions & 0 deletions doc/configuration/others.md
Original file line number Diff line number Diff line change
Expand Up @@ -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


25 changes: 25 additions & 0 deletions doc/usage/action-palette.md
Original file line number Diff line number Diff line change
@@ -1 +1,26 @@
# Using the Action Palette

<p>
<img src="https://github.com/user-attachments/assets/0d427d6d-aa5f-405c-ba14-583830251740" />
</p>

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`.
19 changes: 16 additions & 3 deletions doc/usage/introduction.md
Original file line number Diff line number Diff line change
@@ -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.

Check warning on line 19 in doc/usage/introduction.md

View workflow job for this annotation

GitHub Actions / Spell Check with Typos

"automically" should be "automatically".

When in a chat buffer, you can cycle between other chat buffers with `{` or `}`.

13 changes: 0 additions & 13 deletions doc/usage/others.md

This file was deleted.

2 changes: 2 additions & 0 deletions doc/usage/workflows.md
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
# Using Workflows

To be updated.

0 comments on commit f2ae8cf

Please sign in to comment.