-
Notifications
You must be signed in to change notification settings - Fork 126
Luakit Configuration
This short guide demonstrates how to configure the Luakit browser using Fennel. The file paths shown below are for Linux systems; please adjust accordingly if you use something else.
Luakit itself doesn't understand Fennel, so we need a light wrapper around our config. First, Luakit requires a userconf.lua
file in a usual config location. For instance:
/home/you/.config/luakit/userconf.lua
Within this file, place the following line:
require("fennel").install().dofile("/home/you/.config/luakit/config.fnl")
By default, an absolute path to your Fennel code is necessary to appease the package loader.
Before we can start Luakit, however, we must also provide a Lua-compiled version of Fennel for Luakit to load first.
- Download the latest tag of Fennel.
- Decompress it.
- Run
make
to build (among other things) afennel.lua
. - Copy
fennel.lua
to/home/you/.config/luakit/
.
Now we're ready. After adding config as shown below, open luakit
and enjoy!
We'll add all of our configuration to a config.fnl
file. Within it, we're free to import any of the Luakit Lua modules and use them as-is.
Simple Colemak rebindings can be added like so:
(local modes (require :modes))
(modes.remap_binds "normal" [["n" "j" false]
["e" "k" false]
["N" "J" false]
["E" "K" false]])
See also the official docs for the modes
module.
(local adblock (require :adblock))
(adblock.load false "easylist.txt")
(adblock.load false "easyprivacy.txt")
(adblock.load false "fanboy-annoyance.txt")
See also the official docs for the adblock
module for how to obtain the blocklists.
The f
key opens "follow mode", allowing you to click links via the keyboard. By default, Luakit assigns number combinations to each link, but it's also possible to set letters. For instance, using the Home Row instead can make browsing quite comfortable.
(local select (require :select))
(fn select.label_maker [s] (s.interleave "arst" "neio"))
The above is (most of) the Home Row for the Colemak layout. Feel free to set it to whatever you wish.
See also the official docs for the select
module.