Installation | Configuration | Documentation | Supported platforms | Browser compatibility | Contributing
Krabby is a web extension (for Chrome, Firefox and surf) 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.
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] [extensions=yes] [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.
- 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, Firefox and surf support. It has also been tested on Opera, Vivaldi and Brave.
Download 3-gatsu no Lion episodes from HorribleSubs
· Download 3-gatsu no Lion episodes from HorribleSubs
Commands
- f → Focus link
- Input: o
- s → Select active element
- Alt + a → Select parent elements (2 times)
- Alt + i → Select child elements (2 times)
- Enter → Open link
- Alt + i → Select child elements
- Alt + k → Keep selections that match the given RegExp
- Input:
720p
- Input:
- Alt + I → Select links
- Alt + k → Keep selections that match the given RegExp
- Input:
Magnet
- Input:
- Alt + Shift + Enter → Open link in the associated application
Extract from Wikipedia the list of cities and towns in Russia
· Extract from Wikipedia the list of cities and towns in Russia
Commands
- f → Focus link
- Input: a, l
- s → Select active element
- Alt + a → Select parent elements (3 times)
- S → Select elements that match the specified group of selectors
- Input:
tr td:first-child
- Input:
- Alt + I → Select links
- Alt + y → Copy link text
Quickly move around a document with no table of contents
· Quickly move around a document with no table of contents
Commands
- % → Select document
- S → Select elements that match the specified group of selectors
- Input:
h1, h2, h3
- Input:
- ( → Focus previous selection
Playing videos in picture-in-picture mode
· Playing videos in picture-in-picture mode
Commands
- p → Toggle picture-in-picture mode
Opening links in a paragraph
· Opening links in a paragraph
Commands
- f → Focus link
- Input: e
- s → Select active element
- Alt + a → Select parent elements
- Alt + I → Select links
- Control + Enter → Open link in new tab
Play videos with mpv
Commands
- f → Focus link
- Input: a, w
- s → Select active element
- Alt + a → Select parent elements (3 times)
- Alt + I → Select links
- Alt + m → Play with mpv in reverse order
Copy selection with Pandoc
Commands
- f → Focus link
- Input: s
- s → Select active element
- Alt + a → Select parent elements (4 times)
- Y → Copy selection, using an HTML filter
Copy multiple links
Commands
- f → Focus link
- Input: s
- s → Select active element
- Alt + a → Select parent elements (3 times)
- Alt + i → Select child elements
- Alt + ] → Select last child elements
- Alt + ( → Select previous sibling elements
- Alt + I → Select links
- y → Copy link address
- Y → Copy link address and text
See krabby-resources for all available demos.
- Crystal
- Docker (for static builds)
- jq
- wl-clipboard for Wayland or xclip for X11 (Optional, for plumbing)
- mpv (Optional, for playing videos)
- Rofi (Optional, for tab search and plumbing, dmenu replacement)
- Pandoc (Optional, for HTML filtering)
- Zip (Zip is used to package the extension)
- Commands (Chrome API to perform browser actions)
- Shell (Chrome API to execute external commands)
- Editor (Open an external editor to edit text inputs)
- dmenu (Tab search with dmenu)
Run the following in your terminal, then follow the onscreen instructions.
make install [static=no] [extensions=yes] [interactive=yes]
Web browser | Support | Engine | Notes |
---|---|---|---|
Chrome | ✓ | ||
Chromium | ✓ | ||
Firefox | ✓ | Only developer or unbranded version | |
surf | ✓ | Limited support (does not have WebExtension features, such as native messaging) | |
Edge | ? | ||
Opera | ✓ | ||
Safari | ✗ | ||
Vivaldi | ✓ | ||
Brave | ✓ |
- 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.