Contents
GNU Readline
Profanity uses GNU Readline for handling input. GNU Readline comes with many features including customisable key bindings, and Emacs or Vi editing modes.
In addition to checking ~/.inputrc
, Profanity will also look in
~/.config/profanity/inputrc
for Readline bindings.
For more information on key bindings and customisations available in GNU Readline, see the guide. Taken from the above guide, below is a list of basic bindings that come with GNU Readline by default.
In the following table C-k
means Control-k, M-k
means Meta-k where the meta
key may differ depending on your OS (alt key, windows key, command key etc).
C-b | Move back one character |
C-f | Move forward one character |
C-d | Delete the character underneath the cursor |
C-_ or C-x C-u | Undo the last editing command |
C-a | Move to the start of the line. |
C-e | Move to the end of the line. |
M-f | Move forward a word, where a word is composed of letters and digits. |
M-b | Move backward a word. |
C-l | Clear the screen. |
C-k | Kill the text from the current cursor position to the end of the line. |
M-d | Kill from the cursor to the end of the current word, or, if between words, to the end of the next word. Word boundaries are the same as those used by M-f. |
M-DEL | Kill from the cursor the start of the current word, or, if between words, to the start of the previous word. Word boundaries are the same as those used by M-b. |
C-w | Kill from the cursor to the previous whitespace. This is different than M-DEL because the word boundaries differ. |
C-y | Yank the most recently killed text back into the buffer at the cursor. |
M-y | Rotate the kill-ring, and yank the new top. You can only do this if the prior command is C-y or M-y. |
User Interface Navigation
In addition to GNU Readline input key bindings, Profanity has a few more bindings for managing the User Interface.
Alt-1..Alt-0, F1..F10 | Focus window. |
Alt-Left | Focus previous window. |
Alt-Right | Focus next window. |
Page Up | Scroll backwards through main window contents. |
Page Down | Scroll forwards through main window contents. |
Alt-Page Up | Scroll backwards through occupants/roster panel. |
Alt-Page Down | Scroll forwards through occupants/roster panel. |
Custom Readline functions
Profanity also makes functions available to readline to allow customising Profanity bindings:
prof_win_N |
Focus window N where N is 1,2,3,4,5,6,7,8,9 or 0 |
prof_win_prev |
Focus previous window |
prof_win_next |
Focus next window |
prof_win_pageup |
Page up contents of main window |
prof_win_pagedown |
Page down contents of main window |
prof_subwin_pageup |
Page up contents of sub window (roster or occupants) |
prof_subwin_pagedown |
Page down contents of sub window (roster or occupants) |
prof_win_clear |
Clear current window contents |
Example usage in inputrc
:
$if profanity
"\C-p": prof_win_prev
"\C-n": prof_win_next
"\C-j": prof_win_pageup
"\C-k": prof_win_pagedown
"\C-h": prof_subwin_pageup
"\C-l": prof_subwin_pagedown
"\C-y": prof_win_clear
$endif