kurusugawa-computer / markdown-copilot-vscode

OpenAI ChatGPT API client for VSCode
https://marketplace.visualstudio.com/items?itemName=kurusugawa-computer.markdown-copilot
MIT License
9 stars 2 forks source link
markdown openai vscode-extension

en ja zh-cn

Markdown Copilot for Visual Studio Code

Version Downloads GitHub Workflow Status GitHub stars GitHub Contributors

Markdown Copilot is an OpenAI ChatGPT API client for VSCode.

Basic Usage

Markdown Copilot enables you to fully replace the OpenAI ChatGPT WebUI, offering superior features such as:

  1. Saving conversation histories in Markdown
  2. Conducting multiple conversations simultaneously
  3. Branching out conversations
  4. Editing previous conversations at any point and continuing the conversation
  5. Nameing files based on conversations
  6. Titling conversations

Note: An OpenAI or Azure OpenAI API key is required to use this extension. For more information, please refer to the OpenAI official FAQ or Azure OpenAI Quickstart.

๐ŸŒŸ Key Features

๐Ÿ”€ Parallel Editing

Execute multiple auto-edits simultaneously, enhancing your productivity by not having to wait for one edit to complete before starting another.

Parallel Editing

๐ŸŽ› Context Control

Manage conversational contexts hierarchically, using quote indentation and syntax colors for visual context highlighting.

Context Control

๐Ÿ“ Contextual Editing

Markdown Copilot answers to selected text based on context.

To use, select a text range and choose ๐Ÿ’ก Markdown Copilot: Continue from the code action proposals.

Contextual Editing

Or use shortcuts for quick access:

Command Windows / Linux Mac
Trigger suggestion Ctrl+Space or Ctrl+I โŒƒ+Space or โŒ˜+I
Contextual Editing Shortcut

โ™ฏ Context Notation in Markdown

The active context is determined by tracing back the quote indent from the cursor line. Can force a context guard with a line starting with # Copilot Context.

Example: take care

If you select Then say "take care". and choose ๐Ÿ’ก Markdown Copilot: Continue, you will get the following output: hello โ†’ good bye โ†’ take care.

Example: take care

More complex example: the context continues across take care line.

Example: see you again

Specifying a speaker: You can specify a speaker by placing a special Markdown notation at the beginning of a line.

Markdown Meaning
**User:** User is the speaker
**Copilot:** Markdown Copilot is the speaker
**System(Override):** Overrides system message
**System:** Specifies additional system message

แฐ Override Options

Customize Markdown Copilot's behavior with override options. This allows you to control settings like response length or the AI model directly within your document.

To use override options, simply include a JSON code block labeled json copilot-options with your desired settings, then select this block along with your text and choose ๐Ÿ’ก Markdown Copilot: Continue from the code action proposals.

Example: Let Markdown Copilot introduce itself with customized response length and model

Introduce yourself.

```json copilot-options
{"max_tokens":50,"model":"gpt-3.5-turbo"}

For more configuration options, please refer to the [OpenAI API: Create chat completion](https://platform.openai.com/docs/api-reference/chat/create).

### ๐Ÿ“› Name and Save File

Markdown Copilot allows you to name and save a file based on its contents.

To use, select the editor you want to name and save, and use the `Markdown Copilot: Name and Save As...` command.

Or use shortcuts for quick access:

| Windows / Linux | Mac |
| :-------------: | :---: |
| <kbd>Ctrl</kbd>+<kbd>Shift</kbd>+<kbd>P</kbd> > <kbd>Name and Save As</kbd> | <kbd>โŒ˜</kbd>+<kbd>โ‡ง</kbd>+<kbd>P</kbd> > <kbd>Name and Save As</kbd> |

### ๐Ÿท๏ธ Titling the Active Context

Markdown Copilot allows you to title a conversation based on the conversation history.
Conversation titles are represented as lines beginning with `# Copilot Context: `.

To use, move the cursor to the context you want to title and use the `Markdown Copilot: Title active context` command.

Or use shortcuts for quick access:

| Windows / Linux | Mac |
| :-------------: | :---: |
| <kbd>Ctrl</kbd>+<kbd>Shift</kbd>+<kbd>P</kbd> > <kbd>Title active context</kbd> | <kbd>โŒ˜</kbd>+<kbd>โ‡ง</kbd>+<kbd>P</kbd> > <kbd>Title active context</kbd> |

### ๐Ÿ“ฅ Import Other Markdown Files

Markdown Copilot allows you to easily import other Markdown files into your current document.
This enables you to reference or reuse content from other documents.

To import another Markdown file, use the `@import` directive followed by the path to the file you want to import, enclosed in double quotes.

**Example with a relative path:** Import `another-markdown.md` located at a relative position from the current file.

```markdown
@import "path/to/another-markdown.md"

Example with an absolute path: Use an absolute path from the root directory of the workspace to import toplevel-markdown.md.

@import "/toplevel-markdown.md"

When the current document is unsaved and thus lacks a confirmed file path, you must use an absolute path to specify other Markdown files to be imported.

โคท Quote Indentation

Simplify the editing of quote indentation levels with intuitive actions.

Select text and choose ๐Ÿ’ก Markdown Copilot: Indent Quote Line or ๐Ÿ’ก Markdown Copilot: Outdent Quote Line from code action proposals.

Quote Indentation

Or use these shortcuts:

Command Windows / Linux Mac
Indent Quote Line Ctrl+Alt+L โŒ˜+โŒฅ+L
Outdent Quote Line Ctrl+Alt+Shift+L โŒ˜+โŒฅ+โ‡ง+L
Quote Indentation Shortcut

๐Ÿ“‹ Prerequisites

๐Ÿ”Œ Enhance Your Markdown Experience

Combine Markdown Copilot with these extensions for an even more powerful Markdown experience:

๐Ÿ”„ Changelog

For detailed updates, refer to the CHANGELOG.

๐Ÿค Get Involved