Skip to content

Commit faadbc4

Browse files
authored
Update README.md
1 parent f7731e0 commit faadbc4

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

README.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -358,7 +358,16 @@ You can use them simply defining `prompt:<promptID>` on the first line of code b
358358

359359
### Custom Prompts
360360

361-
In the settings page you can simply create your own prompt. For example if you create a prompt with the name `myprompt`, you can use that simply by defining its name e.g.: `prompt:myprompt`.
361+
In the settings page you can simply create your own prompt. For example if you create a prompt with the name `myprompt`, you can use that simply by defining its name e.g.: `prompt:myprompt`.
362+
You can create a custom prompt by defining its structure, parsing logic, and styling rules using three key settings:
363+
- `basePrompt`: This is the visual template for your prompt. Use placeholders (`{user}`, `{host}`, `{path}`, `{db}`, `{module}` and `{branch}`) to insert dynamic information.
364+
Example: `"{user}@{host}:{path}$"`
365+
- `parsePromptRegex`: A Regular Expression used to identify and extract parts of a prompt string. It relies on named capture groups (e.g., `(?<user>...)`) to label the parts it finds.
366+
Example: `^(?<user>[^@]+)@(?<host>[^:]+)` captures the username and hostname.
367+
- `highlightGroups`: A JSON object that maps the names from your regex capture groups (e.g., "user") to style classes. This tells the plugin which color to apply to each part of the prompt.
368+
Example: `{ "user": "user", "host": "host" }`
369+
370+
The `parsePromptRegex` finds the text for the user and host. The `highlightGroups` setting then links these parts to their respective styles, which are used to apply the correct colors.
362371

363372
### On-The-Fly Prompts
364373

0 commit comments

Comments
 (0)