Add a quick "Navigate: Home" command with Alt-h keyboard shortcut
parent
5c6a49d62a
commit
21836ca073
|
@ -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:
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -44,7 +44,7 @@ export class CommandHook
|
|||
this.editorCommands.set(cmd.name, {
|
||||
command: cmd,
|
||||
run: () => {
|
||||
return plug.invoke(name, []);
|
||||
return plug.invoke(name, [cmd]);
|
||||
},
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue