mirror of
https://github.com/heyman/heynote.git
synced 2024-11-25 01:13:17 +01:00
Change key binding for format code
This commit is contained in:
parent
03d0195eb3
commit
85a5bc95a7
@ -1,6 +1,7 @@
|
|||||||
import { isMac } from "./detect-platform.js"
|
import { isMac } from "./detect-platform.js"
|
||||||
|
|
||||||
const modChar = isMac ? "⌘" : "Ctrl"
|
const modChar = isMac ? "⌘" : "Ctrl"
|
||||||
|
const altChar = isMac ? "⌥" : "Alt "
|
||||||
|
|
||||||
export const initialContent = `
|
export const initialContent = `
|
||||||
∞∞∞text
|
∞∞∞text
|
||||||
@ -13,7 +14,7 @@ Welcome to Heynote!
|
|||||||
[${modChar} + Up] Goto previous block
|
[${modChar} + Up] Goto previous block
|
||||||
[${modChar} + A] Select all text in a note block. Press again to select the whole scratchpad
|
[${modChar} + A] Select all text in a note block. Press again to select the whole scratchpad
|
||||||
[${modChar} + ⌥ + Up/Down] Add additional cursor above/below
|
[${modChar} + ⌥ + Up/Down] Add additional cursor above/below
|
||||||
[${modChar} + B] Format block content (works for JSON, JavaScript, HTML, CSS and Markdown)
|
[${altChar} + Shift + F] Format block content (works for JSON, JavaScript, HTML, CSS and Markdown)
|
||||||
∞∞∞math
|
∞∞∞math
|
||||||
This is a Math block. Here, rows are evaluated as math expressions.
|
This is a Math block. Here, rows are evaluated as math expressions.
|
||||||
|
|
||||||
@ -30,33 +31,7 @@ time * 2
|
|||||||
∞∞∞text-a
|
∞∞∞text-a
|
||||||
`
|
`
|
||||||
|
|
||||||
export const initialDevContent = `
|
export const initialDevContent = initialContent + `
|
||||||
∞∞∞text-a
|
|
||||||
Welcome to Heynote!
|
|
||||||
|
|
||||||
[${modChar} + Enter] Add new block and move cursor to it
|
|
||||||
[${modChar} + Shift + Enter] Split the current block at cursor position
|
|
||||||
[${modChar} + L] Change block language
|
|
||||||
[${modChar} + Down] Goto next block
|
|
||||||
[${modChar} + Up] Goto previous block
|
|
||||||
[${modChar} + A] Select all text in a note block. Press again to select the whole scratchpad
|
|
||||||
[${modChar} + ⌥ + Up/Down] Add additional cursor above/below
|
|
||||||
[${modChar} + B] Format block content (works for JSON, JavaScript, HTML, CSS and Markdown)
|
|
||||||
∞∞∞math
|
|
||||||
This is a Math block. Here, rows are evaluated as math expressions.
|
|
||||||
|
|
||||||
length = 10
|
|
||||||
radius = 5
|
|
||||||
volume = length * radius^2 * PI
|
|
||||||
sqrt(9)
|
|
||||||
|
|
||||||
It also supports some basic unit conversions:
|
|
||||||
|
|
||||||
13 inches in cm
|
|
||||||
time = 3900 seconds to minutes
|
|
||||||
time * 2
|
|
||||||
∞∞∞text-a
|
|
||||||
|
|
||||||
∞∞∞python-a
|
∞∞∞python-a
|
||||||
# hmm
|
# hmm
|
||||||
def my_func():
|
def my_func():
|
||||||
|
@ -56,7 +56,7 @@ export function heynoteKeymap(editor) {
|
|||||||
["Alt-ArrowUp", moveLineUp],
|
["Alt-ArrowUp", moveLineUp],
|
||||||
["Alt-ArrowDown", moveLineDown],
|
["Alt-ArrowDown", moveLineDown],
|
||||||
["Mod-l", () => editor.openLanguageSelector()],
|
["Mod-l", () => editor.openLanguageSelector()],
|
||||||
["Mod-b", formatBlockContent],
|
["Alt-Shift-f", formatBlockContent],
|
||||||
{key:"Mod-ArrowUp", run:gotoPreviousBlock, shift:selectPreviousBlock},
|
{key:"Mod-ArrowUp", run:gotoPreviousBlock, shift:selectPreviousBlock},
|
||||||
{key:"Mod-ArrowDown", run:gotoNextBlock, shift:selectNextBlock},
|
{key:"Mod-ArrowDown", run:gotoNextBlock, shift:selectNextBlock},
|
||||||
{key:"Ctrl-ArrowUp", run:gotoPreviousParagraph, shift:selectPreviousParagraph},
|
{key:"Ctrl-ArrowUp", run:gotoPreviousParagraph, shift:selectPreviousParagraph},
|
||||||
|
Loading…
Reference in New Issue
Block a user