1
0
silverbullet/plugs/editor/editor.plug.yaml
2023-12-21 18:21:58 +01:00

255 lines
5.5 KiB
YAML

name: editor
syntax:
NakedURL:
firstCharacters:
- "h"
regex: "https?:\\/\\/[-a-zA-Z0-9@:%._\\+~#=]{1,256}([-a-zA-Z0-9()@:%_\\+.~#?&=\\/]*)"
className: sb-naked-url
functions:
setEditorMode:
path: "./editor.ts:setEditorMode"
events:
- editor:init
toggleDarkMode:
path: "./editor.ts:toggleDarkMode"
command:
name: "Editor: Toggle Dark Mode"
# Page operations
deletePage:
path: "./page.ts:deletePage"
command:
name: "Page: Delete"
copyPage:
path: "./page.ts:copyPage"
command:
name: "Page: Copy"
# Completion
pageComplete:
path: "./complete.ts:pageComplete"
events:
- editor:complete
commandComplete:
path: "./command.ts:commandComplete"
events:
- editor:complete
# Navigation
linkNavigate:
path: "./navigate.ts:linkNavigate"
command:
name: Navigate To page
key: Ctrl-Enter
mac: Cmd-Enter
clickNavigate:
path: "./navigate.ts:clickNavigate"
events:
- page:click
navigateHome:
path: "./navigate.ts:navigateCommand"
command:
name: "Navigate: Home"
key: "Alt-h"
page: ""
moveToPos:
path: "./editor.ts:moveToPosCommand"
command:
name: "Navigate: Move Cursor to Position"
# Text editing commands
quoteSelectionCommand:
path: ./text.ts:quoteSelection
command:
name: "Text: Quote Selection"
key: "Ctrl-Shift-."
mac: "Cmd-Shift-."
listifySelection:
path: ./text.ts:listifySelection
command:
name: "Text: Listify Selection"
key: "Ctrl-Shift-8"
mac: "Cmd-Shift-8"
numberListifySelection:
path: ./text.ts:numberListifySelection
command:
name: "Text: Number Listify Selection"
linkSelection:
path: ./text.ts:linkSelection
command:
name: "Text: Link Selection"
key: "Ctrl-Shift-k"
mac: "Cmd-Shift-k"
bold:
path: ./text.ts:wrapSelection
command:
name: "Text: Bold"
key: "Ctrl-b"
mac: "Cmd-b"
wrapper: "**"
italic:
path: ./text.ts:wrapSelection
command:
name: "Text: Italic"
key: "Ctrl-i"
mac: "Cmd-i"
wrapper: "_"
strikethrough:
path: ./text.ts:wrapSelection
command:
name: "Text: Strikethrough"
key: "Ctrl-Shift-s"
wrapper: "~~"
marker:
path: ./text.ts:wrapSelection
command:
name: "Text: Marker"
key: "Alt-m"
wrapper: "=="
centerCursor:
path: "./editor.ts:centerCursorCommand"
command:
name: "Navigate: Center Cursor"
key: "Ctrl-Alt-l"
# Debug commands
parseCommand:
path: ./debug.ts:parsePageCommand
command:
name: "Debug: Parse Document"
# Link unfurl infrastructure
unfurlLink:
path: ./link.ts:unfurlCommand
command:
name: "Link: Unfurl"
key: "Ctrl-Shift-u"
mac: "Cmd-Shift-u"
contexts:
- NakedURL
# Title-based link unfurl
titleUnfurlOptions:
path: ./link.ts:titleUnfurlOptions
events:
- unfurl:options
titleUnfurl:
path: ./link.ts:titleUnfurl
events:
- unfurl:title-unfurl
embedWidget:
path: ./embed.ts:embedWidget
codeWidget: embed
# Vim
toggleVimMode:
path: "./vim.ts:toggleVimMode"
command:
name: "Editor: Toggle Vim Mode"
loadVimRc:
path: "./vim.ts:loadVimRc"
command:
name: "Editor: Vim: Load VIMRC"
events:
- editor:modeswitch
brokenLinksCommand:
path: ./broken_links.ts:brokenLinksCommand
command:
name: "Broken Links: Show"
# Random stuff
statsCommand:
path: ./stats.ts:statsCommand
command:
name: "Stats: Show"
reloadUICommand:
path: ./debug.ts:reloadUICommand
command:
name: "Debug: Reload UI"
resetClientCommand:
path: ./debug.ts:resetClientCommand
command:
name: "Debug: Reset Client"
versionCommand:
path: ./help.ts:versionCommand
command:
name: "Help: Version"
gettingStartedCommand:
path: ./help.ts:gettingStartedCommand
command:
name: "Help: Getting Started"
accountLogoutCommand:
path: ./account.ts:accountLogoutCommand
command:
name: "Account: Logout"
uploadFileCommand:
path: ./upload.ts:uploadFile
command:
name: "Upload: File"
# Outline commands
outlineMoveUp:
path: ./outline.ts:moveItemUp
command:
name: "Outline: Move Up"
key: "Alt-ArrowUp"
outlineMoveDown:
path: ./outline.ts:moveItemDown
command:
name: "Outline: Move Down"
key: "Alt-ArrowDown"
outlineIndent:
path: ./outline.ts:indentItem
command:
name: "Outline: Move Right"
key: "Alt->"
outlineOutdent:
path: ./outline.ts:outdentItem
command:
name: "Outline: Move Left"
key: "Alt-<"
# Outline folding commands
foldCommand:
path: ./outline.ts:foldCommand
command:
name: "Outline: Fold"
key: "Ctrl-Alt-["
unfoldCommand:
path: ./outline.ts:unfoldCommand
command:
name: "Outline: Unfold"
key: "Ctrl-Alt-]"
toggleFoldCommand:
path: ./outline.ts:toggleFoldCommand
command:
name: "Outline: Toggle Fold"
key: "Alt-Shift-f"
foldAllCommand:
path: ./outline.ts:foldAllCommand
command:
name: "Outline: Fold All"
key: "Ctrl-Alt-Shift-["
unfoldAllCommand:
path: ./outline.ts:unfoldAllCommand
command:
name: "Outline: Unfold All"
key: "Ctrl-Alt-Shift-]"
# Demo
customFlashMessage:
path: editor.ts:customFlashMessage
command:
name: "Flash: Custom Message"
contexts:
- internal