Krabby
Installation | Configuration | Documentation | Supported platforms | Browser compatibility | Troubleshooting | Contributing
Krabby is a browser extension (for Chrome and Firefox) for keyboard-based navigation, inspired by Kakoune.
The main differences with existing extensions are: multiple selections, keyboard layout agnostic, SOV (subject–object–verb) constructs and simple interaction with external programs. It is also quite usable with the mouse.
See YouTube · Krabby and krabby-resources for all available demos.
TL;DR
WebExtension — Keyboard interface — Subject–object–verb order — Multiple selections — Kakoune-inspired
Run the following in your terminal, then follow the onscreen instructions.
git clone https://github.com/alexherbo2/krabby
cd krabby
make install [static=no] [interactive=yes]
After installing, try to accomplish the following examples:
Opening links in a paragraph
Navigate to https://tuppervim.org and type:
f{hint}s[alt+a][alt+I][ctrl+enter][alt+x]
Explanation
- f enters hint mode,
{hint}
is a placeholder for you to select a link,- s creates a selection out of the active element,
- Alt + a expands the region,
- Alt + I selects all links,
- Control + Enter opens selected links in the background.
- Optionally, Alt + x will undo the operation (closing right tabs).
Play videos with mpv
Navigate to https://youtube.com/results?search_query=Berserk+AMV and type:
F{hint}{hint}<page-down>{hint}<escape>m
Explanation
- F enters hint mode (lock),
{hint}
is a placeholder for you to select 2 links,- Page Down scrolls one page down,
{hint}
is a placeholder for you to select another link,- Escape leaves hint mode.
- Finally, m opens the selection with mpv.
If you want to play around without installing, a live demo is available here.
Features
- Subject–object–verb order. Learn more at Differences with Vi(m).
- Keyboard layout agnostic. Maps to physical keys, but displays with the US layout.
- Multiple selections as a central way of interacting
- Powerful selection manipulation primitives
- Link hints
- External editor support. Open your favorite editor on text inputs.
- Tab search
- Contextual commands
- Contextual help
- Simple interaction with external programs
- Usable with the mouse. You can for example create a selection by grabbing a link with the mouse and s to create the selection. Or create multiple selections by clicking on hints with F. If you hold Control or Command, you can even make selections with the mouse selection area.
- Limited scope. Krabby is not Vim, nor Kakoune. Krabby is trying to be a navigation tool and some concepts from code editors don’t translate well. For example, there is no concept of mode in Krabby, but a system of contexts.
- Composability. Composability is better than extensibility. Krabby tries hard to provide features that interact well with each other. For example, f and y are two building blocks to focus a link and yank its URL. Depending on the context, y will yank the page or a link URL.
- Modular (think Emacs). Krabby is divided into multiple small projects. At its core Krabby just holds the configuration and grabs its functionalities from other projects.
- Chrome and Firefox support. It has also been tested on Opera, Vivaldi and Brave.
Dependencies
- Crystal
- jq
- wl-clipboard for Wayland or xclip for X11 (Optional, for plumbing)
- mpv (Optional, for playing videos)
- dmenu (Optional, for tab search and plumbing)
- Pandoc (Optional, for HTML filtering)
Extensions
- Commands (WebExtension API to perform browser actions)
- Shell (WebExtension API to execute external commands)
- Editor (Open an external editor to edit text inputs)
- dmenu (Tab search, selection and beyond with a dmenu filter program)
Installation
Run the following in your terminal, then follow the onscreen instructions.
make install [static=no] [extensions=yes] [interactive=yes]
Supported platforms
Browser compatibility
Web browser | Support | Engine | Notes |
---|---|---|---|
Chrome | âś“ | ||
Chromium | âś“ | ||
Firefox | âś“ | Only developer or unbranded version | |
Edge | ? | ||
Opera | âś“ | ||
Safari | âś— | ||
Vivaldi | âś“ | ||
Brave | âś“ |
Credits
- Kakoune (@mawww) for ideas and selection.cc.
- Saka Key (@eejdoowad) was a reference, for implementation and its code quality.
- @ul, for his advice and proofreading, especially in the early stages.
- @GeoGavilanes for the Krabby icon.
- @occivink, for his work on phantom selections, from which the “save and restore selections” feature is inspired.
- mpv and Kakoune for their website, from which Krabby is inspired.
- @AdamWagner for his work to unify scrolling mechanisms.