enhance: g a to all pages, g g to graph view, g f to open flashcards

close #3393
This commit is contained in:
Tienson Qin
2021-12-09 22:03:19 +08:00
parent 86740dd1d4
commit f50b048776
2 changed files with 36 additions and 5 deletions

View File

@@ -285,8 +285,8 @@
:binding "mod+k"
:fn #(route-handler/go-to-search! :global)}
:go/journals {:desc "Jump to journals"
:binding (if mac? "mod+j" "alt+j")
:go/journals {:desc "Go to journals"
:binding "g j"
:fn route-handler/go-to-journals!}
:go/backward {:desc "Backwards"
@@ -325,7 +325,16 @@
:go/home {:desc "Go to home"
:binding "g h"
:fn #(route-handler/redirect-to-home!)}
:fn route-handler/redirect-to-home!}
:go/all-pages {:desc "Go to all pages"
:binding "g a"
:fn route-handler/redirect-to-all-pages!}
:go/graph-view {:desc "Go to graph view"
:binding "g g"
:fn route-handler/redirect-to-graph-view!}
:go/keyboard-shortcuts {:desc "Go to keyboard shortcuts"
:binding "g s"
@@ -343,6 +352,13 @@
:binding "g p"
:fn journal-handler/go-to-prev-journal!}
:go/flashcards {:desc "Toggle flashcards"
:binding "g f"
:fn (fn []
(if (state/modal-opened?)
(state/close-modal!)
(state/pub-event! [:modal/show-cards])))}
:ui/toggle-document-mode {:desc "Toggle document mode"
:binding "t d"
:fn state/toggle-document-mode!}
@@ -367,8 +383,8 @@
:binding "t t"
:fn state/toggle-theme!}
:ui/toggle-contents {:desc "Toggle Favorites in sidebar"
:binding "t f"
:ui/toggle-contents {:desc "Toggle Contents in sidebar"
:binding "mod+shift+c"
:fn ui-handler/toggle-contents!}
:command/toggle-favorite {:desc "Add to/remove from favorites"
@@ -517,6 +533,10 @@
(->
(build-category-map [:command/run
:go/home
:go/journals
:go/all-pages
:go/flashcards
:go/graph-view
:go/keyboard-shortcuts
:go/tomorrow
:go/next-journal
@@ -633,6 +653,9 @@
^{:doc "Others"}
[:go/home
:go/journals
:go/all-pages
:go/graph-view
:go/flashcards
:go/tomorrow
:go/next-journal
:go/prev-journal