mirror of
https://github.com/heyman/heynote.git
synced 2025-06-27 04:51:50 +02:00
Add info about additional key bindings to documentation
This commit is contained in:
parent
215ad942ff
commit
455ef203f2
@ -46,6 +46,9 @@ Available for Mac, Windows, and Linux.
|
||||
⌘ + A Select all text in a note block. Press again to select the whole buffer
|
||||
⌘ + ⌥ + Up/Down Add additional cursor above/below
|
||||
⌥ + Shift + F Format block content (works for JSON, JavaScript, HTML, CSS and Markdown)
|
||||
⌘ + ⌥ + [ Fold block(s)
|
||||
⌘ + ⌥ + ] Unfold block(s)
|
||||
⌘ + ⌥ + . Toggle block fold
|
||||
```
|
||||
|
||||
**On Windows and Linux**
|
||||
@ -65,7 +68,13 @@ Ctrl + Up Goto previous block
|
||||
Ctrl + A Select all text in a note block. Press again to select the whole buffer
|
||||
Ctrl + Alt + Up/Down Add additional cursor above/below
|
||||
Alt + Shift + F Format block content (works for JSON, JavaScript, HTML, CSS and Markdown)
|
||||
Ctrl + Shift + [ Fold block(s)
|
||||
Ctrl + Shift + ] Unfold block(s)
|
||||
Ctrl + Shift + . Toggle block fold
|
||||
Alt Show menu
|
||||
|
||||
You can see all the default key bindings in Heynote's settings under Key Bindings.
|
||||
|
||||
```
|
||||
|
||||
## Custom Key Bindings
|
||||
|
@ -1,4 +1,4 @@
|
||||
export const keyHelpStr = (platform: string) => {
|
||||
export const keyHelpStr = (platform: string, extended: boolean = false) => {
|
||||
const modChar = platform === "darwin" ? "⌘" : "Ctrl"
|
||||
const altChar = platform === "darwin" ? "⌥" : "Alt"
|
||||
|
||||
@ -19,6 +19,22 @@ export const keyHelpStr = (platform: string) => {
|
||||
[`${altChar} + Shift + F`, "Format block content (works for JSON, JavaScript, HTML, CSS and Markdown)"],
|
||||
]
|
||||
|
||||
if (extended) {
|
||||
if (platform === "darwin") {
|
||||
keyHelp.push(
|
||||
[`${modChar} + ${altChar} + [`, "Fold block(s)"],
|
||||
[`${modChar} + ${altChar} + ]`, "Unfold block(s)"],
|
||||
[`${modChar} + ${altChar} + .`, "Toggle block fold"],
|
||||
)
|
||||
} else {
|
||||
keyHelp.push(
|
||||
[`${modChar} + Shift + [`, "Fold block(s)"],
|
||||
[`${modChar} + Shift + ]`, "Unfold block(s)"],
|
||||
[`${modChar} + Shift + .`, "Toggle block fold"],
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
if (platform === "win32" || platform === "linux") {
|
||||
keyHelp.push([altChar, "Show menu"])
|
||||
}
|
||||
|
@ -22,13 +22,16 @@ const injectKeybindsInDocs = async () => {
|
||||
const shortcuts = `$1**On Mac**
|
||||
|
||||
\`\`\`
|
||||
${keyHelpStr('darwin')}
|
||||
${keyHelpStr('darwin', true)}
|
||||
\`\`\`
|
||||
|
||||
**On Windows and Linux**
|
||||
|
||||
\`\`\`
|
||||
${keyHelpStr('win32')}
|
||||
${keyHelpStr('win32', true)}
|
||||
|
||||
You can see all the default key bindings in Heynote's settings under Key Bindings.
|
||||
|
||||
$2`
|
||||
const docsPath = path.resolve(__dirname, 'docs', 'index.md')
|
||||
let docs = fs.readFileSync(docsPath, 'utf-8')
|
||||
|
Loading…
x
Reference in New Issue
Block a user