1
0
silverbullet/plugs/editor/editor.plug.yaml

281 lines
6.1 KiB
YAML
Raw Normal View History

2023-08-28 15:12:15 +00:00
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"
openCommandPalette:
path: editor.ts:openCommandPalette
command:
name: "Open Command Palette"
key: "Ctrl-/"
mac: "Cmd-/"
openPageNavigator:
path: editor.ts:openPageNavigator
command:
name: "Page Navigator"
key: "Ctrl-k"
mac: "Cmd-k"
openTemplateNavigator:
path: editor.ts:openTemplateNavigator
command:
name: "Template Picker"
key: "Ctrl-Shift-t"
mac: "Cmd-Shift-t"
2023-08-28 15:12:15 +00:00
# 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"
2023-08-28 15:12:15 +00:00
events:
- editor:complete
commandComplete:
path: "./command.ts:commandComplete"
events:
- editor:complete
reloadSettingsAndCommands:
path: editor.ts:reloadSettingsAndCommands
command:
name: "System: Reload Settings and Commands"
2023-08-28 15:12:15 +00:00
# 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: ""
2023-08-29 19:17:29 +00:00
moveToPos:
path: "./editor.ts:moveToPosCommand"
command:
name: "Navigate: Move Cursor to Position"
2023-08-28 15:12:15 +00:00
# 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:
2023-08-29 19:17:29 +00:00
name: "Navigate: Center Cursor"
2023-08-28 15:12:15 +00:00
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"
2023-12-17 13:26:41 +00:00
# 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"
2023-12-18 11:40:31 +00:00
key: "Alt->"
outlineOutdent:
path: ./outline.ts:outdentItem
command:
name: "Outline: Move Left"
2023-12-18 11:40:31 +00:00
key: "Alt-<"
2023-12-17 13:26:41 +00:00
# Outline folding commands
foldCommand:
path: ./outline.ts:foldCommand
command:
name: "Outline: Fold"
2023-12-18 11:40:31 +00:00
key: "Ctrl-Alt-["
2023-12-17 13:26:41 +00:00
unfoldCommand:
path: ./outline.ts:unfoldCommand
command:
name: "Outline: Unfold"
2023-12-18 11:40:31 +00:00
key: "Ctrl-Alt-]"
2023-12-17 13:26:41 +00:00
toggleFoldCommand:
path: ./outline.ts:toggleFoldCommand
command:
name: "Outline: Toggle Fold"
key: "Alt-Shift-f"
foldAllCommand:
path: ./outline.ts:foldAllCommand
command:
name: "Outline: Fold All"
2023-12-18 11:40:31 +00:00
key: "Ctrl-Alt-Shift-["
2023-12-17 13:26:41 +00:00
unfoldAllCommand:
path: ./outline.ts:unfoldAllCommand
command:
name: "Outline: Unfold All"
2023-12-18 11:40:31 +00:00
key: "Ctrl-Alt-Shift-]"
2023-12-17 13:26:41 +00:00
# Demo
customFlashMessage:
path: editor.ts:customFlashMessage
command:
name: "Flash: Custom Message"
contexts:
- internal