Skip to content

Commit 459c588

Browse files
CopilotPKief
andauthored
feat: Add configuration option to control QuickPick Esc behavior (#63)
* Initial plan * Add configuration option for QuickPick Esc behavior Co-authored-by: PKief <[email protected]> * Update README.md to include Quick Pick ESC behavior configuration * Add quickPickEscBehavior and dateTemplate to default settings --------- Co-authored-by: copilot-swe-agent[bot] <[email protected]> Co-authored-by: PKief <[email protected]> Co-authored-by: Philipp Kief <[email protected]>
1 parent 48d81ba commit 459c588

File tree

5 files changed

+249
-216
lines changed

5 files changed

+249
-216
lines changed

README.md

Lines changed: 189 additions & 176 deletions
Original file line numberDiff line numberDiff line change
@@ -1,176 +1,189 @@
1-
<h1 align="center">
2-
<br>
3-
<img src="https://raw.githubusercontent.com/PKief/vscode-markdown-checkbox/main/logo.png" alt="logo" width="200">
4-
<br><br>
5-
Markdown Checkbox
6-
<br>
7-
<br>
8-
</h1>
9-
10-
<h4 align="center">Create and toggle checkboxes in Markdown documents</h4>
11-
12-
<p align="center">
13-
<a href="https://marketplace.visualstudio.com/items?itemName=PKief.markdown-checkbox"><img src="https://vsmarketplacebadges.dev/version/PKief.markdown-checkbox.svg?style=for-the-badge&colorA=252526&colorB=43A047&label=VERSION" alt="Version"></a>&nbsp;
14-
<a href="https://marketplace.visualstudio.com/items?itemName=PKief.markdown-checkbox"><img src="https://vsmarketplacebadges.dev/rating-short/PKief.markdown-checkbox.svg?style=for-the-badge&colorA=252526&colorB=43A047&label=Rating" alt="Rating"></a>&nbsp;
15-
<a href="https://marketplace.visualstudio.com/items?itemName=PKief.markdown-checkbox"><img src="https://vsmarketplacebadges.dev/installs-short/PKief.markdown-checkbox.svg?style=for-the-badge&colorA=252526&colorB=43A047&label=Installs" alt="Installs"></a>&nbsp;
16-
<a href="https://marketplace.visualstudio.com/items?itemName=PKief.markdown-checkbox"><img src="https://vsmarketplacebadges.dev/downloads-short/PKief.markdown-checkbox.svg?style=for-the-badge&colorA=252526&colorB=43A047&label=Downloads" alt="Downloads"></a>
17-
</p>
18-
19-
## Description
20-
21-
With this extension for Visual Studio Code it's possible to create todo lists in markdown. The extension provides shortcuts and some workspace configurations to create checkboxes and mark them with a shortcut.
22-
23-
## How to use
24-
25-
![Preview](https://raw.githubusercontent.com/PKief/vscode-extension-markdown-checkbox/main/images/preview.gif)
26-
27-
## Information in status bar
28-
29-
![Preview of status bar information](https://raw.githubusercontent.com/PKief/vscode-extension-markdown-checkbox/main/images/statusbar_preview.png)
30-
31-
_At least one checkbox must exist in a file to see this information._
32-
33-
## Pick Checkboxes
34-
35-
Toggle all checkboxes in the current document with the Multi-Select QuickPick:
36-
37-
![Preview of Multi-Select QuickPick](images/pick_checkboxes.gif)
38-
39-
The QuickPick can be opened either from the command palette or by clicking on the status bar item.
40-
41-
## Keybindings
42-
43-
| Command | Windows | Mac |
44-
| ----------------- | ----------------------------------------------------- | ---------------------------------------------- |
45-
| Create a checkbox | <kbd>CTRL</kbd> + <kbd>Shift</kbd> + <kbd>c</kbd> | <kbd>⌘</kbd> + <kbd>⇧</kbd> + <kbd>c</kbd> |
46-
| Toggle checkbox | <kbd>CTRL</kbd> + <kbd>Shift</kbd> + <kbd>Enter</kbd> | <kbd>⌘</kbd> + <kbd>⇧</kbd> + <kbd>Enter</kbd> |
47-
48-
These are the initial keyboard shortcuts, which can be customized by the [Keyboard Shortcuts](https://code.visualstudio.com/docs/getstarted/keybindings) settings in VS Code.
49-
50-
## Configuration
51-
52-
This extension can be customized with the following options.
53-
54-
### Bullet points
55-
56-
If bullet points before the checkboxes are required, then they can be enabled with the following setting:
57-
58-
options: true | false
59-
60-
```json
61-
"markdown-checkbox.withBulletPoint": true
62-
```
63-
64-
Example:
65-
66-
```
67-
* [ ] todo
68-
```
69-
70-
### Type of bullet points
71-
72-
Select a type of bullet point:
73-
74-
options: "*" | "-" | "+"
75-
76-
```json
77-
"markdown-checkbox.typeOfBulletPoint": "*"
78-
```
79-
80-
Example
81-
82-
```
83-
* [ ] asterisk
84-
- [ ] minus
85-
+ [ ] plus
86-
```
87-
88-
### Type of checkmark
89-
90-
Select a type of checkmark:
91-
92-
options: "X" | "x"
93-
94-
```json
95-
"markdown-checkbox.checkmark": "X"
96-
```
97-
98-
Example
99-
100-
```
101-
- [X] uppercase checkmark
102-
- [x] lowercase checkmark
103-
```
104-
105-
### Italic
106-
107-
Italic font style of line of the checkbox after the checkbox has been checked:
108-
109-
options: true | false
110-
111-
```json
112-
"markdown-checkbox.italicWhenChecked": true
113-
```
114-
115-
Preview
116-
117-
- [x] _this line is italic_
118-
119-
### Strikethrough
120-
121-
Strikethrough the line of the checkbox after the checkbox has been checked:
122-
123-
options: true | false
124-
125-
```json
126-
"markdown-checkbox.strikeThroughWhenChecked": true
127-
```
128-
129-
Preview:
130-
131-
- [x] ~~_this line has been crossed out_~~
132-
133-
### Date when checked
134-
135-
Add date behind the checkbox item after the checkbox has been checked:
136-
137-
options: true | false
138-
139-
```json
140-
"markdown-checkbox.dateWhenChecked": true
141-
```
142-
143-
Preview:
144-
145-
- [x] ~~_sample with date_~~ [2017-11-23]
146-
147-
### Format date
148-
149-
If dates are enabled, they can be formatted with the following user setting:
150-
151-
```json
152-
"markdown-checkbox.dateFormat": "YYYY-MM-DD"
153-
```
154-
155-
It makes use of the JavaScript library [moment.js](https://momentjs.com/docs/#/parsing/string-format/) which means that the date format patterns can be found there.
156-
157-
In addition the syntax around in which the date is placed can be defined via template. `{date}` will be replaced by the actual date value:
158-
159-
```json
160-
"markdown-checkbox.dateTemplate": "({date})"
161-
```
162-
163-
Preview:
164-
165-
- [x] ~~_sample with date_~~ (2017-11-23)
166-
167-
### Specify language IDs
168-
169-
Besides markdown, this extension can also be used for other languages in VS Code. The language IDs can be specified in the user settings like this:
170-
171-
```json
172-
"markdown-checkbox.languages": [
173-
"markdown",
174-
"plaintext"
175-
]
176-
```
1+
<h1 align="center">
2+
<br>
3+
<img src="https://raw.githubusercontent.com/PKief/vscode-markdown-checkbox/main/logo.png" alt="logo" width="200">
4+
<br><br>
5+
Markdown Checkbox
6+
<br>
7+
<br>
8+
</h1>
9+
10+
<h4 align="center">Create and toggle checkboxes in Markdown documents</h4>
11+
12+
<p align="center">
13+
<a href="https://marketplace.visualstudio.com/items?itemName=PKief.markdown-checkbox"><img src="https://vsmarketplacebadges.dev/version/PKief.markdown-checkbox.svg?style=for-the-badge&colorA=252526&colorB=43A047&label=VERSION" alt="Version"></a>&nbsp;
14+
<a href="https://marketplace.visualstudio.com/items?itemName=PKief.markdown-checkbox"><img src="https://vsmarketplacebadges.dev/rating-short/PKief.markdown-checkbox.svg?style=for-the-badge&colorA=252526&colorB=43A047&label=Rating" alt="Rating"></a>&nbsp;
15+
<a href="https://marketplace.visualstudio.com/items?itemName=PKief.markdown-checkbox"><img src="https://vsmarketplacebadges.dev/installs-short/PKief.markdown-checkbox.svg?style=for-the-badge&colorA=252526&colorB=43A047&label=Installs" alt="Installs"></a>&nbsp;
16+
<a href="https://marketplace.visualstudio.com/items?itemName=PKief.markdown-checkbox"><img src="https://vsmarketplacebadges.dev/downloads-short/PKief.markdown-checkbox.svg?style=for-the-badge&colorA=252526&colorB=43A047&label=Downloads" alt="Downloads"></a>
17+
</p>
18+
19+
## Description
20+
21+
With this extension for Visual Studio Code it's possible to create todo lists in markdown. The extension provides shortcuts and some workspace configurations to create checkboxes and mark them with a shortcut.
22+
23+
## How to use
24+
25+
![Preview](https://raw.githubusercontent.com/PKief/vscode-extension-markdown-checkbox/main/images/preview.gif)
26+
27+
## Information in status bar
28+
29+
![Preview of status bar information](https://raw.githubusercontent.com/PKief/vscode-extension-markdown-checkbox/main/images/statusbar_preview.png)
30+
31+
_At least one checkbox must exist in a file to see this information._
32+
33+
## Pick Checkboxes
34+
35+
Toggle all checkboxes in the current document with the Multi-Select QuickPick:
36+
37+
![Preview of Multi-Select QuickPick](images/pick_checkboxes.gif)
38+
39+
The QuickPick can be opened either from the command palette or by clicking on the status bar item.
40+
41+
## Keybindings
42+
43+
| Command | Windows | Mac |
44+
| ----------------- | ----------------------------------------------------- | ---------------------------------------------- |
45+
| Create a checkbox | <kbd>CTRL</kbd> + <kbd>Shift</kbd> + <kbd>c</kbd> | <kbd>⌘</kbd> + <kbd>⇧</kbd> + <kbd>c</kbd> |
46+
| Toggle checkbox | <kbd>CTRL</kbd> + <kbd>Shift</kbd> + <kbd>Enter</kbd> | <kbd>⌘</kbd> + <kbd>⇧</kbd> + <kbd>Enter</kbd> |
47+
48+
These are the initial keyboard shortcuts, which can be customized by the [Keyboard Shortcuts](https://code.visualstudio.com/docs/getstarted/keybindings) settings in VS Code.
49+
50+
## Configuration
51+
52+
This extension can be customized with the following options.
53+
54+
### Bullet points
55+
56+
If bullet points before the checkboxes are required, then they can be enabled with the following setting:
57+
58+
options: true | false
59+
60+
```json
61+
"markdown-checkbox.withBulletPoint": true
62+
```
63+
64+
Example:
65+
66+
```
67+
* [ ] todo
68+
```
69+
70+
### Type of bullet points
71+
72+
Select a type of bullet point:
73+
74+
options: "*" | "-" | "+"
75+
76+
```json
77+
"markdown-checkbox.typeOfBulletPoint": "*"
78+
```
79+
80+
Example
81+
82+
```
83+
* [ ] asterisk
84+
- [ ] minus
85+
+ [ ] plus
86+
```
87+
88+
### Type of checkmark
89+
90+
Select a type of checkmark:
91+
92+
options: "X" | "x"
93+
94+
```json
95+
"markdown-checkbox.checkmark": "X"
96+
```
97+
98+
Example
99+
100+
```
101+
- [X] uppercase checkmark
102+
- [x] lowercase checkmark
103+
```
104+
105+
### Italic
106+
107+
Italic font style of line of the checkbox after the checkbox has been checked:
108+
109+
options: true | false
110+
111+
```json
112+
"markdown-checkbox.italicWhenChecked": true
113+
```
114+
115+
Preview
116+
117+
- [x] _this line is italic_
118+
119+
### Strikethrough
120+
121+
Strikethrough the line of the checkbox after the checkbox has been checked:
122+
123+
options: true | false
124+
125+
```json
126+
"markdown-checkbox.strikeThroughWhenChecked": true
127+
```
128+
129+
Preview:
130+
131+
- [x] ~~_this line has been crossed out_~~
132+
133+
### Date when checked
134+
135+
Add date behind the checkbox item after the checkbox has been checked:
136+
137+
options: true | false
138+
139+
```json
140+
"markdown-checkbox.dateWhenChecked": true
141+
```
142+
143+
Preview:
144+
145+
- [x] ~~_sample with date_~~ [2017-11-23]
146+
147+
### Format date
148+
149+
If dates are enabled, they can be formatted with the following user setting:
150+
151+
```json
152+
"markdown-checkbox.dateFormat": "YYYY-MM-DD"
153+
```
154+
155+
It makes use of the JavaScript library [moment.js](https://momentjs.com/docs/#/parsing/string-format/) which means that the date format patterns can be found there.
156+
157+
In addition the syntax around in which the date is placed can be defined via template. `{date}` will be replaced by the actual date value:
158+
159+
```json
160+
"markdown-checkbox.dateTemplate": "({date})"
161+
```
162+
163+
Preview:
164+
165+
- [x] ~~_sample with date_~~ (2017-11-23)
166+
167+
### Specify language IDs
168+
169+
Besides markdown, this extension can also be used for other languages in VS Code. The language IDs can be specified in the user settings like this:
170+
171+
```json
172+
"markdown-checkbox.languages": [
173+
"markdown",
174+
"plaintext"
175+
]
176+
```
177+
178+
### Change the Quick Pick ESC behavior
179+
180+
The Quick Pick can be closed with the ESC key. The behavior can be configured with the following setting:
181+
182+
```json
183+
"markdown-checkbox.quickPickEscBehavior": "doNothing"
184+
```
185+
186+
Possible values are:
187+
188+
- `doNothing`: Do nothing when ESC is pressed
189+
- `uncheckAll`: Uncheck all checkboxes when ESC is pressed

package.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,15 @@
167167
"type": "string",
168168
"default": "[{date}]",
169169
"markdownDescription": "The date template `{date}` is replaced by the actual date."
170+
},
171+
"markdown-checkbox.quickPickEscBehavior": {
172+
"type": "string",
173+
"enum": [
174+
"doNothing",
175+
"uncheckAll"
176+
],
177+
"default": "doNothing",
178+
"description": "Behavior when pressing Esc in the QuickPick panel. 'doNothing' preserves current state, 'uncheckAll' unchecks all checkboxes."
170179
}
171180
}
172181
}

0 commit comments

Comments
 (0)