Skip to content

Commit 8c7ac33

Browse files
committed
Update feature description and explain config
1 parent 3ccbedd commit 8c7ac33

File tree

1 file changed

+36
-2
lines changed

1 file changed

+36
-2
lines changed

README.md

Lines changed: 36 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,46 @@ Simply get a copy of your currently selected code or text snippet added to your
3030

3131
### Copy Snippet as Markdown Code Block
3232

33-
This command has an additional configuration option that let's you determine if the Markdown code block should contain the file's language identifier which enables [syntax highlighting](https://help.github.com/en/github/writing-on-github/creating-and-highlighting-code-blocks#syntax-highlighting) in some places:
33+
Copies the currently selected snippet without leading indentation and automatically wraps it in a [fenced Markdown code block](https://help.github.com/en/github/writing-on-github/creating-and-highlighting-code-blocks).
34+
35+
## Options
36+
37+
### Include Language Identifier
38+
39+
The "Copy Snippet as Markdown Code Block" command can optionally include the current VS Code document's language identifier in the Markdown code block. Including a language identifier enables [syntax highlighting](https://help.github.com/en/github/writing-on-github/creating-and-highlighting-code-blocks#syntax-highlighting) in some places (like in Issue or Pull Request comments on GitHub) but is incompatible with other tools, such as Slack.
40+
41+
This behavior can be controlled through a configuration setting:
3442

3543
```json
36-
"snippet-copy.addLanguageIdToMarkdownBlock": false // Default is false
44+
"snippet-copy.markdownCodeBlock.includeLanguageIdentifier": "prompt" // Default is to always prompt on use
3745
```
3846

47+
Possible options are:
48+
49+
| Option | Description |
50+
| --------- | ---------------------------------------------------------------------------------------- |
51+
| `"prompt"` | Default. Prompts you whenever the "Copy Snippet as Markdown Code Block" command is used. |
52+
| `"always"` | Always include the document's language identifier in the Markdown code block. |
53+
| `"never"` | Never include the language identifer. |
54+
55+
### Convert Tabs to Spaces
56+
57+
Many tools or websites often render tabs very widely or generally in a weird way and make therefore them not very pleasant to look at. Snippet Copy therefore by default automatically converts a tab character to two spaces.
58+
59+
This can be adjusted in settings:
60+
61+
```json
62+
"snippet-copy.convertTabsToSpaces": {
63+
"enabled": true,
64+
"tabSize": 2
65+
}
66+
```
67+
68+
| Setting | Description |
69+
| ----------- | ------------------------------------------------------------------ |
70+
| `"enabled"` | `true` by default. Whether to convert tabs to spaces. |
71+
| `"tabSize"` | `2` is the default. How many spaces to convert a tab character to. |
72+
3973
---
4074

4175
With an icon lovingly crafted by [@dipree](https://github.com/dipree) 🌺

0 commit comments

Comments
 (0)