Files
plainleaf/plugs/editor/editor.plug.yaml
T

406 lines
8.9 KiB
YAML

name: editor
requiredPermissions:
- fetch
functions:
setEditorMode:
path: "./editor.ts:setEditorMode"
events:
- editor:init
toggleDarkMode:
path: "./editor.ts:toggleDarkMode"
command:
name: "Editor: Toggle Dark Mode"
toggleMarkdownSyntaxRendering:
path: "./editor.ts:toggleMarkdownSyntaxRendering"
command:
name: "Editor: Toggle Markdown Syntax Rendering"
newWindow:
path: editor.ts:newWindowCommand
command:
name: "Editor: New Window"
key: "Ctrl-n"
mac: "Cmd-n"
openCommandPalette:
path: editor.ts:openCommandPalette
command:
name: "Open Command Palette"
key: "Ctrl-/"
mac: "Cmd-/"
openPageNavigator:
path: editor.ts:openPageNavigator
command:
name: "Navigate: Page Picker"
key: "Ctrl-k"
mac: "Cmd-k"
openMetaNavigator:
path: editor.ts:openMetaNavigator
command:
name: "Navigate: Meta Picker"
key: "Ctrl-Shift-k"
mac: "Cmd-Shift-k"
openTagNavigator:
path: editor.ts:openTagNavigator
command:
name: "Navigate: Tag Picker"
key: "Ctrl-Alt-t"
openDocumentNavigator:
path: editor.ts:openDocumentNavigator
command:
name: "Navigate: Document Picker"
key: "Ctrl-o"
mac: "Cmd-o"
openAllNavigator:
path: editor.ts:openAllNavigator
command:
name: "Navigate: Anything Picker"
# Page operations
deletePage:
path: "./page.ts:deletePage"
command:
name: "Page: Delete"
requireMode: rw
requireEditor: page
copyPage:
path: "./page.ts:copyPage"
command:
name: "Page: Copy"
requireMode: rw
requireEditor: page
# Completion
pageComplete:
path: "./complete.ts:pageComplete"
events:
- editor:complete
reloadSystem:
path: editor.ts:reloadSystem
command:
name: "System: Reload"
key: Ctrl-Alt-r
refreshAllWidgets:
path: editor.ts:refreshAllWidgets
command:
name: "Widgets: Refresh All"
requireEditor: page
languageComplete:
path: complete.ts:languageComplete
events:
- editor:complete
# Navigation
linkNavigate:
path: "./navigate.ts:linkNavigate"
command:
name: "Navigate: To This Page"
key: Ctrl-Enter
mac: Cmd-Enter
requireEditor: page
clickNavigate:
path: "./navigate.ts:clickNavigate"
events:
- page:click
navigateHome:
path: "./navigate.ts:navigateCommand"
command:
name: "Navigate: Home"
key: "Ctrl-g h"
page: ""
moveToPos:
path: "./editor.ts:moveToPosCommand"
command:
name: "Navigate: To Position"
requireEditor: page
copyRefCommand:
path: "./editor.ts:copyRefCommand"
command:
name: "Navigate: Copy Ref To Current Position"
requireEditor: page
copyLinkCommand:
path: "./editor.ts:copyLinkCommand"
command:
name: "Navigate: Copy Link To Current Position"
requireEditor: page
moveToLine:
path: "./editor.ts:moveToLineCommand"
command:
name: "Navigate: To Line"
requireEditor: page
navigateToPage:
path: "./navigate.ts:navigateToPage"
command:
name: "Navigate: To Page"
hide: true
navigateToURL:
path: "./navigate.ts:navigateToURL"
command:
name: "Navigate: To URL"
hide: true
navigateBack:
path: "./navigate.ts:navigateBack"
command:
name: "Navigate: Back in History"
navigateForward:
path: "./navigate.ts:navigateForward"
command:
name: "Navigate: Forward in History"
# Text editing commands
quoteSelectionCommand:
path: ./text.ts:quoteSelection
command:
name: "Text: Quote Selection"
key: "Ctrl-Shift-."
mac: "Cmd-Shift-."
requireMode: rw
requireEditor: page
listifySelection:
path: ./text.ts:listifySelection
command:
name: "Text: Listify Selection"
key: "Ctrl-Shift-8"
mac: "Cmd-Shift-8"
requireMode: rw
requireEditor: page
numberListifySelection:
path: ./text.ts:numberListifySelection
command:
name: "Text: Number Listify Selection"
requireMode: rw
requireEditor: page
linkSelection:
path: ./text.ts:linkSelection
command:
name: "Text: Link Selection"
requireMode: rw
requireEditor: page
bold:
path: ./text.ts:wrapSelection
command:
name: "Text: Bold"
key: "Ctrl-b"
mac: "Cmd-b"
wrapper: "**"
requireMode: rw
requireEditor: page
italic:
path: ./text.ts:wrapSelection
command:
name: "Text: Italic"
key: "Ctrl-i"
mac: "Cmd-i"
wrapper: "_"
requireMode: rw
requireEditor: page
strikethrough:
path: ./text.ts:wrapSelection
command:
name: "Text: Strikethrough"
key: "Ctrl-Shift-s"
wrapper: "~~"
requireMode: rw
requireEditor: page
marker:
path: ./text.ts:wrapSelection
command:
name: "Text: Marker"
key: "Ctrl-Alt-m"
wrapper: "=="
requireMode: rw
requireEditor: page
centerCursor:
path: "./editor.ts:centerCursorCommand"
command:
name: "Navigate: Center Cursor"
key: "Ctrl-Alt-l"
requireMode: rw
requireEditor: page
deleteLine:
path: "./editor.ts:deleteLineCommand"
command:
name: "Delete Line"
key: "Ctrl-d"
requireMode: rw
requireEditor: page
# Debug commands
parseCommand:
path: ./system.ts:parsePageCommand
command:
name: "Debug: Parse Document"
requireEditor: page
# Vim
toggleVimMode:
path: "./vim.ts:toggleVimMode"
command:
name: "Editor: Toggle Vim Mode"
requireEditor: page
loadVimConfig:
path: "./vim.ts:loadVimConfig"
command:
name: "Editor: Vim: Load Vim Config"
requireEditor: page
events:
- editor:modeswitch
# Random stuff
statsCommand:
path: ./stats.ts:statsCommand
command:
name: "Stats: Show"
requireEditor: page
# Client commands
reloadUICommand:
path: ./system.ts:reloadUICommand
command:
name: "Client: Reload UI"
wipeClientCommand:
path: ./system.ts:wipeClientCommand
command:
name: "Client: Wipe"
cleanClientCommand:
path: ./system.ts:cleanClientCommand
command:
name: "Client: Clean"
wipeAndLogoutCommand:
path: ./system.ts:wipeAndLogoutCommand
command:
name: "Client: Logout"
versionCommand:
path: ./help.ts:versionCommand
command:
name: "Client: Version"
uploadFileCommand:
path: ./upload.ts:uploadFile
command:
name: "Upload: File"
requireMode: rw
# Outline commands
outlineMoveUp:
path: ./outline.ts:moveItemUp
command:
name: "Outline: Move Up"
key:
- "Alt-ArrowUp"
- "Mod-. k"
requireMode: rw
requireEditor: page
outlineMoveDown:
path: ./outline.ts:moveItemDown
command:
name: "Outline: Move Down"
key:
- "Alt-ArrowDown"
- "Mod-. j"
requireMode: rw
requireEditor: page
outlineIndent:
path: ./outline.ts:indentItem
command:
name: "Outline: Move Right"
key: "Mod-. l"
requireMode: rw
requireEditor: page
outlineOutdent:
path: ./outline.ts:outdentItem
command:
name: "Outline: Move Left"
key: "Mod-. h"
requireMode: rw
requireEditor: page
# Outline folding commands
foldCommand:
path: ./outline.ts:foldCommand
command:
name: "Outline: Fold"
requireEditor: page
unfoldCommand:
path: ./outline.ts:unfoldCommand
command:
name: "Outline: Unfold"
requireEditor: page
toggleFoldCommand:
path: ./outline.ts:toggleFoldCommand
command:
name: "Outline: Toggle Fold"
key: "Mod-. Mod-."
requireEditor: page
foldAllCommand:
path: ./outline.ts:foldAllCommand
command:
name: "Outline: Fold All"
requireEditor: page
unfoldAllCommand:
path: ./outline.ts:unfoldAllCommand
command:
name: "Outline: Unfold All"
requireEditor: page
findInPageCommand:
path: editor.ts:findInPageCommand
command:
name: "Editor: Find in Page"
key: "Ctrl-f"
mac: "Cmd-f"
requireEditor: page
# Outline helper functions
determineItemBounds:
path: ./outline.ts:determineItemBounds
ensureNewLine:
path: ./outline.ts:ensureNewLine
# Undo/redo
undoCommand:
path: ./editor.ts:undoCommand
command:
name: "Editor: Undo"
key: "Ctrl-z"
mac: "Cmd-z"
requireMode: rw
requireEditor: page
redoCommand:
path: ./editor.ts:redoCommand
command:
name: "Editor: Redo"
key: "Ctrl-y"
mac: "Cmd-Shift-z"
requireMode: rw
requireEditor: page
# Demo
customFlashMessage:
path: editor.ts:customFlashMessage
command:
name: "Flash: Custom Message"
hide: true
contexts:
- internal
deleteDocument:
path: "./document.ts:deleteDocument"
command:
name: "Document: Delete"
requireMode: rw
requireEditor: notpage