5.14.1 EWW Install

Simplified Install

If Casual is installed using package-install, then you can use casual-init to setup support for EWW.

By default, casual-init will setup support for EWW via the hook function casual-eww-init which is included in the customizable variable casual-init-hook.

Use the command customize-variable on casual-init-hook to control inclusion of casual-eww-init via a checkbox interface.

Refer to the Simplified Install (Install) section for more detail on customizing casual-init.

Casual makes opinionated decisions on the keybindings used in its menus. Such opinions are extended from said menus to the keymap(s) of a particular mode. For EWW, this can be controlled via the customizable variable casual-eww-add-extra-keybindings (default t).

Hook Install

Users who want a more granular install of Casual modules can invoke the hook function of interest in their Emacs initialization file.

(casual-eww-init)

Manual Install

For users who have manually installed Casual outside of package-install, the following guidance is offered.

The primary interface for Casual EWW is the Transient menu casual-eww-tmenu. It is autoloaded ((elisp)Autoload) so if Casual is installed via package-install ((emacs)Package Installation) then casual-eww-tmenu can be invoked via execute-extended-command (M-x) without need for modifying your Emacs initialization file.

That said, Casual is designed with the intent of using a common (key)binding across multiple modes to lower cognitive load. This document uses the binding C-o for this purpose, but can be changed to user preference.

There are many ways to configure this binding. Shown below is a straightforward implementation:

(require 'casual-eww) ; load all dependencies including `eww'
(keymap-set eww-mode-map "C-o" #'casual-eww-tmenu)

If lazy loading of the eww package is desired then try using eval-after-load:

(eval-after-load 'eww
  (keymap-set eww-mode-map "C-o" #'casual-eww-tmenu))

Additional Bindings

Do so similarly to access casual-eww-bookmarks-tmenu in the EWW bookmarks list.

(keymap-set eww-bookmark-mode-map "C-o" #'casual-eww-bookmarks-tmenu)

While not mandatory, the following bindings can make the EWW keymaps consistent with those used by Casual.

(keymap-set eww-mode-map "C-o" #'casual-eww-tmenu)
(keymap-set eww-mode-map "C-c C-o" #'eww-browse-with-external-browser)
(keymap-set eww-mode-map "j" #'shr-next-link)
(keymap-set eww-mode-map "k" #'shr-previous-link)
(keymap-set eww-mode-map "[" #'eww-previous-url)
(keymap-set eww-mode-map "]" #'eww-next-url)
(keymap-set eww-mode-map "M-]" #'eww-forward-url)
(keymap-set eww-mode-map "M-[" #'eww-back-url)
(keymap-set eww-mode-map "n" #'casual-lib-browse-forward-paragraph)
(keymap-set eww-mode-map "p" #'casual-lib-browse-backward-paragraph)
(keymap-set eww-mode-map "P" #'casual-eww-backward-paragraph-link)
(keymap-set eww-mode-map "N" #'casual-eww-forward-paragraph-link)
(keymap-set eww-mode-map "M-l" #'eww)

(keymap-set eww-bookmark-mode-map "C-o" #'casual-eww-bookmarks-tmenu)
(keymap-set eww-bookmark-mode-map "p" #'previous-line)
(keymap-set eww-bookmark-mode-map "n" #'next-line)
(keymap-set eww-bookmark-mode-map "<double-mouse-1>" #'eww-bookmark-browse)