on this page
keys.lua
Key bindings, aliases and emoticons. keys.lua returns all three, and
config.lua sets them in the config as keys, aliases and emotes:
local keys = require("keys")
return {
keys = keys.bindings,
aliases = keys.aliases,
emotes = keys.emotes,
-- ...
}
bindings
Each entry names an action and the key to bind it to. Action names have hyphens in them, so they go in square brackets:
local bindings = {
["switcher"] = "ctrl+p",
["next-buffer"] = "ctrl+n",
}
Setting an action replaces all of its default keys with the one you give.
next-buffer is on both alt+down and alt+j by default, so the example
above leaves it on ctrl+n alone.
An action that does not exist, or a key luir cannot read, is refused when the
config loads, naming the one at fault. luir --list-actions prints every
action with the keys it is on now, your changes included, and F1 shows the
same inside luir.
Writing a key
A key is any number of modifiers joined with +, then the key itself:
ctrl+k, alt+shift+n, f5.
| Modifier | Also written |
|---|---|
ctrl |
control, c |
alt |
meta, m, a |
shift |
s |
| Key | Also written |
|---|---|
a to z, 0 to 9, and other single characters |
|
f1 to f12 |
|
up, down, left, right |
|
home, end |
|
pgup |
pageup |
pgdown |
pgdn, pagedown |
insert |
ins |
delete |
del |
backspace |
bs |
enter |
return, cr |
tab |
|
backtab |
shift+tab in most terminals |
esc |
escape |
space |
Names are not case-sensitive, so shift has to be written out: alt+shift+a,
not alt+A. alt+shift+a and alt+a are different keys.
Every action
| Action | Default | Does |
|---|---|---|
quit | ctrl+q | Leave luir |
help | f1 | Show the key reference |
switcher | ctrl+k | Jump to a buffer by name |
emotes | alt+e | Insert an emoticon |
themes | alt+t | Pick a colour scheme |
add-network | alt+n | Add a network |
edit-network | alt+shift+n | Edit the selected network |
next-buffer | alt+down, alt+j | Select the next buffer |
prev-buffer | alt+up, alt+k | Select the previous buffer |
next-unread | alt+a | Jump to the next buffer with unread activity |
prev-unread | alt+shift+a | Jump to the previous buffer with unread activity |
next-network | alt+right, alt+. | Select the first buffer of the next network |
prev-network | alt+left, alt+, | Select the first buffer of the previous network |
close-buffer | ctrl+w | Close the current buffer |
clear-buffer | alt+l | Clear the current buffer's scrollback |
mark-read | alt+r | Mark the current buffer read |
mark-all-read | alt+shift+r | Mark every buffer read |
toggle-sidebar | f2 | Show or hide the buffer list |
toggle-members | f3 | Show or hide the member list |
toggle-topic | f4 | Show or hide the topic bar |
toggle-timestamps | f6 | Show or hide timestamps |
stats | f7 | Show the connection charts |
reload-config | f5 | Reload the config file from disk |
scroll-up | pgup | Scroll back one page |
scroll-down | pgdown | Scroll forward one page |
scroll-top | ctrl+home | Jump to the oldest loaded message |
scroll-bottom | ctrl+end | Jump to the newest message |
members-up | alt+pgup | Scroll the member list back one page |
members-down | alt+pgdown | Scroll the member list forward one page |
focus-members | alt+m | Move the highlight into the member list |
toggle-favorite | alt+shift+f | Favourite this buffer, or drop it |
toggle-favorites | f8 | Show or hide the favourites sections |
cancel | esc | Close an overlay or clear the input |
alt+1 to alt+9 jump to a buffer by its number in the sidebar. They are
checked before any binding and are not actions, so they cannot be moved.
tmux and alt+arrows
Inside tmux, alt+left and alt+right may never reach luir: a common tmux
setup binds them to switching sessions without the prefix. That is why alt+,
and alt+. switch networks too, by default, since tmux leaves those alone. To
see what tmux holds:
tmux list-keys -T root | grep -E 'M-(Left|Right)'
To give the arrows back to luir, add unbind -n M-Left and
unbind -n M-Right to .tmux.conf. Rebinding next-network or
prev-network yourself replaces both of its default keys with the one you give.
Keys you cannot rebind
Editing in the prompt is fixed, in the readline style:
| Key | |
|---|---|
enter |
Send the line |
tab |
Complete a nick, channel or command |
left, right |
Move a character |
ctrl+left, ctrl+right, alt+b, alt+f |
Move a word |
home, end, ctrl+a, ctrl+e |
Go to the start or end of the line |
backspace, delete |
Delete a character |
ctrl+u |
Delete to the start of the line |
up, down |
Step through the lines you have sent |
ctrl+d |
Quit, when the line is empty |
A bound action gets a key before the prompt does, which matters for a few keys
the prompt also understands. ctrl+w deletes a word and ctrl+k deletes to the
end of the line, but by default those keys belong to close-buffer and
switcher; bind those actions to something else and the editing keys work.
In the same way, alt+left and alt+right only move by a word once
prev-network and next-network are off them.
alt+m, or a click on a nick, hands the keyboard to the member list, and while
it has it these keys are fixed too:
| Key | |
|---|---|
up, down, j, k, tab, shift+tab |
Move the highlight |
pgup, pgdown, home, end, g, G |
Move it further |
enter, m |
Open a direct message with them |
w |
/whois them |
i |
Put their nick in the prompt |
o |
Op them, or deop them if they are |
v |
Voice them, or devoice them if they are |
K |
Start /kick <nick> in the prompt, to add a reason and send |
esc, q |
Give the keyboard back |
o needs ops in that channel, and v and K need ops or halfops, so the
status bar only offers them to someone who has what they need. The other keys
give the keyboard back when they are done, but o and v keep it, since a
channel is often sorted out a few people at a time.
aliases
Your own slash commands. Each maps a name to the command line it runs, and luir expands it before running the command.
local aliases = {
shrug = "/me shrugs",
w = "/whois $1",
ban = "/mode #chat +b $1",
op = "/msg ChanServ OP $1 $2",
}
| In a template | Stands for |
|---|---|
$1 to $9 |
The first to ninth word after the alias |
$* |
Everything after the alias |
Yours are merged over a bundled set by name, so naming one that is already
taken replaces it. /help lists every alias in force. The bundled set is the
services shorthands, which go through /msg so they work on networks that do
not define them, and a few others:
| Alias | Runs |
|---|---|
/bs |
/msg BotServ $* |
/cs |
/msg ChanServ $* |
/hs |
/msg HostServ $* |
/ms |
/msg MemoServ $* |
/ns |
/msg NickServ $* |
/os |
/msg OperServ $* |
/j |
/join $* |
/w |
/whois $1 |
/shrug |
/me shrugs |
emotes
Emoticons for the picker. alt+e opens it over the bundled set of over three
hundred (the shrug, the table flip, Lenny and the rest), searching their keywords as
well as their names, so angry finds the table flip. enter drops the one you
pick into the prompt at the cursor rather than sending it, since it is usually
in the middle of a sentence. /emote flip table nope sends one outright, with
text alongside it.
Many of the bundled ones come from ASCIImoji by jiggly, under the Beer-Ware License.
Yours are merged over the bundled set by name, so naming one that is already taken replaces it:
local emotes = {
["my shrug"] = "¯\\_(ツ)_/¯",
["tea"] = "( ˘▽˘)っ♨",
}
These are Lua strings, so a backslash has to be written twice. "¯\_(ツ)_/¯"
with a single one is an invalid escape, and the config will not load.
