Add a quick "Navigate: Home" command with Alt-h keyboard shortcut

This commit is contained in:
Zef Hemel
2022-07-04 11:52:09 +02:00
parent 5c6a49d62a
commit 21836ca073
3 changed files with 20 additions and 5 deletions
+15 -4
View File
@@ -36,6 +36,12 @@ functions:
reindexSpace:
path: "./page.ts:reindexSpace"
env: server
deletePage:
path: "./page.ts:deletePage"
command:
name: "Page: Delete"
# Backlinks
indexLinks:
path: "./page.ts:indexLinks"
events:
@@ -44,20 +50,19 @@ functions:
path: ./page.ts:linkQueryProvider
events:
- query:link
deletePage:
path: "./page.ts:deletePage"
command:
name: "Page: Delete"
renamePage:
path: "./page.ts:renamePage"
command:
name: "Page: Rename"
mac: Cmd-Alt-r
key: Ctrl-Alt-r
pageComplete:
path: "./page.ts:pageComplete"
events:
- page:complete
# Navigation
linkNavigate:
path: "./navigate.ts:linkNavigate"
command:
@@ -68,6 +73,12 @@ functions:
path: "./navigate.ts:clickNavigate"
events:
- page:click
navigateHome:
path: "./navigate.ts:navigateCommand"
command:
name: "Navigate: Home"
key: "Alt-h"
page: "index"
# Hashtags
indexTags:
+4
View File
@@ -47,3 +47,7 @@ export async function clickNavigate(event: ClickEvent) {
let newNode = nodeAtPos(mdTree, event.pos);
await actionClickOrActionEnter(newNode);
}
export async function navigateCommand(cmdDef: any) {
await navigateTo(cmdDef.page);
}