Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Small fix to eaf-layer refactor #14747

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 10 additions & 8 deletions layers/+tools/eaf/README.org
Original file line number Diff line number Diff line change
Expand Up @@ -54,14 +54,19 @@ If you do want to modify the leader keys, then information about the tricks
implemented in this layer can be found [[https://github.com/manateelazycat/emacs-application-framework/issues/498][here]] and [[https://github.com/manateelazycat/emacs-application-framework/pull/500][here]].

* Key bindings
Except for the few Spacemacs specific modifications listed below, all EAF
keybindings are documented [[https://github.com/manateelazycat/emacs-application-framework/wiki/Keybindings][here.]]

Use ~SPC t k m~ to [[https://develop.spacemacs.org/doc/DOCUMENTATION.html#which-key-persistent][show the EAF keybindings persistently in which-key]], or use
~SPC h d K~ to show the `eaf-mode-map` in a separate buffer.
** Global
*** All EAF-applications

| Key binding | Description |
|-------------+----------------------------------------------------------------------------|
| ~SPC a a f~ | EAF open file ([[https://github.com/manateelazycat/emacs-application-framework#launch-eaf-applications][see EAF doc for supported file types]]) |
| ~SPC t k m~ | Show available key commands in which-key (read [[https://develop.spacemacs.org/doc/DOCUMENTATION.html#which-key][here]] for more details) |
| ~SPC m d~ | toggle dark-mode (or in browser press ~M-d~, in pdf-viewer just press ~d~) |
| Key binding | Description |
|-------------+-------------------------------------------------------------------------------|
| ~SPC a a f~ | EAF open file ([[https://github.com/manateelazycat/emacs-application-framework#launch-eaf-applications][see EAF doc for supported file types]]) |
| ~SPC t k m~ | Show available key commands in which-key (read [[https://develop.spacemacs.org/doc/DOCUMENTATION.html#which-key][here]] for more details) |
| ~SPC m d~ | toggle dark-mode (or in browser press ~M-d~ and in pdf-viewer just press ~d~) |

*** Browser

Expand Down Expand Up @@ -102,6 +107,3 @@ implemented in this layer can be found [[https://github.com/manateelazycat/emacs
| Key binding | Description |
|-------------+------------------------|
| ~SPC m e~ | open in eaf pdf-viewer |

There are many more key bindings. Use ~SPC t k m~ to [[https://develop.spacemacs.org/doc/DOCUMENTATION.html#which-key-persistent][show them persistently in
which-key]], or use ~SPC h d k~ to show the `eaf-mode-map` in a separate buffer.
12 changes: 7 additions & 5 deletions layers/+tools/eaf/packages.el
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@
("-" . "insert_or_zoom_out")
("=" . "insert_or_zoom_in")
("0" . "insert_or_zoom_reset")
;; ("d" . "insert_or_dark_mode")
("m" . "insert_or_save_as_bookmark")
("o" . "insert_or_open_browser")
;; ("y" . "insert_or_download_youtube_video")
Expand Down Expand Up @@ -235,11 +236,12 @@
(lambda (prompt)
(if (derived-mode-p 'eaf-mode)
(pcase eaf--buffer-app-name
("browser" (if (string= (eaf-call-sync "call_function" eaf--buffer-id "is_focus") "True")
(kbd "SPC")
(kbd eaf-evil-leader-key)))
("pdf-viewer" (kbd eaf-evil-leader-key))
("image-viewer" (kbd eaf-evil-leader-key))
((or
(and "browser"
(guard (not (string= (eaf-call-sync "call_function" eaf--buffer-id "is_focus") "True"))))
"image-viewer"
"pdf-viewer")
(kbd eaf-evil-leader-key))
(_ (kbd "SPC")))
(kbd "SPC"))))

Expand Down