Skip to content

A keyboard interface to the web, inspired by Kakoune

License

Notifications You must be signed in to change notification settings

AdamWagner/krabby

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

75 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

IRC

A keyboard interface to the web, heavily inspired by Kakoune.

TL;DR

WebExtensionKeyboard interfaceSubject–object–verb orderMultiple selectionsKakoune-inspired

Run the following in your terminal, then follow the onscreen instructions.

git clone https://github.com/alexherbo2/krabby
cd krabby
make install

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

  • Keyboard layout agnostic. Maps to physical keys, but displays with the US layout.
  • Subject–object–verb order
  • Multiple selections as a central way of interacting
  • Powerful selection manipulation primitives
  • Link hints
  • Tab search
  • Contextual commands
  • Contextual help
  • Simple interaction with external programs
  • 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.

Demos

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
  • Alt + I → Select links
  • Alt + k → Keep selections that match the given RegExp
    • Input: Magnet
  • o → 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
  • 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
  • ( → Focus previous selection
Tab search with dmenu

Tab search with dmenu

Commands

  • q → Tab search with dmenu
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

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

Dependencies

Extensions

  • Commands (Chrome API to perform browser actions)
  • Shell (Chrome API to execute external commands)
  • dmenu (Tab search with dmenu)

Installation

Run the following in your terminal, then follow the onscreen instructions.

make install

Browser compatibility

Web browser Support Engine Comments
Chrome Blink
Firefox Gecko Only developer or unbranded version
Edge ? Blink
Opera Blink
Safari WebKit
Vivaldi Blink
Brave Blink

Credits

References

About

A keyboard interface to the web, inspired by Kakoune

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • HTML 71.1%
  • JavaScript 20.8%
  • Shell 5.5%
  • CSS 2.4%
  • Makefile 0.2%