mirror of
https://github.com/heyman/heynote.git
synced 2025-01-08 23:19:48 +01:00
Add more bindings to Emacs style keybindings
This commit is contained in:
parent
97d4f6294a
commit
1fe63860a8
@ -3,8 +3,20 @@ import { EditorSelection } from "@codemirror/state"
|
|||||||
import {
|
import {
|
||||||
indentWithTab, insertTab, indentLess, indentMore,
|
indentWithTab, insertTab, indentLess, indentMore,
|
||||||
undo, redo,
|
undo, redo,
|
||||||
cursorGroupLeft, cursorGroupRight, selectGroupLeft, selectGroupRight,
|
cursorGroupLeft, cursorGroupRight, selectGroupLeft, selectGroupRight,
|
||||||
} from "@codemirror/commands"
|
simplifySelection,
|
||||||
|
deleteCharForward, deleteCharBackward, deleteToLineEnd,
|
||||||
|
splitLine,
|
||||||
|
transposeChars,
|
||||||
|
cursorPageDown,
|
||||||
|
cursorCharLeft, selectCharLeft,
|
||||||
|
cursorCharRight, selectCharRight,
|
||||||
|
cursorLineUp, selectLineUp,
|
||||||
|
cursorLineDown, selectLineDown,
|
||||||
|
cursorLineStart, selectLineStart,
|
||||||
|
cursorLineEnd, selectLineEnd,
|
||||||
|
}from "@codemirror/commands"
|
||||||
|
|
||||||
import {
|
import {
|
||||||
insertNewBlockAtCursor,
|
insertNewBlockAtCursor,
|
||||||
addNewBlockAfterCurrent,
|
addNewBlockAfterCurrent,
|
||||||
@ -55,8 +67,23 @@ export function emacsKeymap(editor) {
|
|||||||
keymapFromSpec([
|
keymapFromSpec([
|
||||||
["Ctrl-Shift--", undo],
|
["Ctrl-Shift--", undo],
|
||||||
["Ctrl-.", redo],
|
["Ctrl-.", redo],
|
||||||
|
["Ctrl-g", simplifySelection],
|
||||||
{key:"Ctrl-ArrowLeft", run:cursorGroupLeft, shift:selectGroupLeft},
|
{key:"Ctrl-ArrowLeft", run:cursorGroupLeft, shift:selectGroupLeft},
|
||||||
{key:"Ctrl-ArrowRight", run:cursorGroupRight, shift:selectGroupRight},
|
{key:"Ctrl-ArrowRight", run:cursorGroupRight, shift:selectGroupRight},
|
||||||
|
|
||||||
|
["Ctrl-d", deleteCharForward],
|
||||||
|
["Ctrl-h", deleteCharBackward],
|
||||||
|
["Ctrl-k", deleteToLineEnd],
|
||||||
|
["Ctrl-o", splitLine],
|
||||||
|
["Ctrl-t", transposeChars],
|
||||||
|
["Ctrl-v", cursorPageDown],
|
||||||
|
|
||||||
|
{ key: "Ctrl-b", run: cursorCharLeft, shift: selectCharLeft, preventDefault: true },
|
||||||
|
{ key: "Ctrl-f", run: cursorCharRight, shift: selectCharRight },
|
||||||
|
{ key: "Ctrl-p", run: cursorLineUp, shift: selectLineUp },
|
||||||
|
{ key: "Ctrl-n", run: cursorLineDown, shift: selectLineDown },
|
||||||
|
{ key: "Ctrl-a", run: cursorLineStart, shift: selectLineStart },
|
||||||
|
{ key: "Ctrl-e", run: cursorLineEnd, shift: selectLineEnd },
|
||||||
]),
|
]),
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user