overleaf/services/web/frontend/js/features/source-editor/extensions/folding-keymap.ts

20 lines
348 B
TypeScript
Raw Normal View History

import { keymap } from '@codemirror/view'
import { foldAll, toggleFold, unfoldAll } from '@codemirror/language'
export function foldingKeymap() {
return keymap.of([
{
key: 'F2',
run: toggleFold,
},
{
key: 'Alt-Shift-1',
run: foldAll,
},
{
key: 'Alt-Shift-0',
run: unfoldAll,
},
])
}