Liam's BitchX IRC Reference: Binding Keys

This section describes how to change how BitchX behaves when you press a key, and also what keys are already set up to do special things. - Introduction to Binding - Seeing Your Current Bindings - Saving Your Changed Bindings - Finding what key is bound to a given Function - Screen Functions - Default Bindings for BitchX

 



Introduction to Binding

You will already have noticed that when you press the RETURN key, the message you have typed is sent to the current channel, or the command you have typed is obeyed. This is because the RETURN key is bound to the internal BitchX function SEND_LINE.

You can change the way keys are bound with the /BIND and /RBIND commands. If you give the BIND command the name of a key, it wil tell you what the key does. Use the circumflex (^) to ask about control characters. For example, let's see what Control-A is bound to:

You type: /bind ^A
Output: * ^A is bound to BEGINNING_OF_LINE

So in my copy of BitchX at least, Control-A moves to the start of the input line. Yours might do something different. To bind Control-A to BEGINNING_OF_LINE, you would do this:

You type: /bind ^A BEGINNING_OF_LINE
Output: * ^A is bound to BEGINNING_OF_LINE

You can see that BitchX confirms the binding with that message.




Seeing Your Current Bindings

One way to see what your bindings are right now is to use the ?BIND command with no arguments. Unfortunately, this will produce a lot of output, and is a little hard to read. You can scroll up (the page up/down keys may work, if you have them, or ESC-p and ESC-n may work), but an easier way is to save the list to a file.

You type: /win logfile ~/bindings
/win log on
/bind
/win log off

This will still generate masses of output, but a copy of it will be saved in the file bindings in your login directory. You can look at that file with a text editor such as vi or pico, or use the less command to scroll through it.




Saving Your Changed Bindings

After a while, it is very likely that you will find some key bindings that you prefer over the default ones, and you will want to save them. Place the following lines in a file called .bitchxrc in your login directory (be careful to remember the dot at the start of the filename!):

You type: /bind ^A BEGINNING_OF_LINE
/load ~/.BitchX/BitchX.sav

next time you start BitchX, Control-A will be bound to BEGINNING_OF_LINE.,/p>




Finding what key is bound to a given Function

You can find out what keys you need to press to activate a certain function using the /RBIND comand, which takes a function name as an argument and shows you all the key sequences that are bound to that function.

You type: /rbind BEGINNING_OF_LINE
Output: * ^A is bound to BEGINNING_OF_LINE
* META32-~ is bound to BEGINNING_OF_LINE

In this case, there are two key sequences bound to Beginning of Line, although if we try to find how to type META32, we are in for a surprise:

You type: /rbind META32
Output: no output

It turns out that, by default, META32 is unbound, so there is no way to type it. You may find that if you have a keyboard with a HOME or Start of Line key, BitchX will bind it for you automatically, but the important point to note is that not all functions nd meta keys are actually bound to anything.




Screen Functions

This is the complete list of BitchX bindable functions availble for use with the /BIND command. The default keybindings are shown in the next section, below.

Function NameDescription
AUTOREPLYtypes the nick of the last person to msg you
AUTOREPLY_BACK(commented out; a no-op)
BACKSPACEdelete left one charater in the input buffer
BACKWARD_CHARACTERmove left one charater in the input buffer
BACKWARD_HISTORYreplace the input buffer with the previous string from your input history
BACKWARD_WORDmove left to a space
BEGINNING_OF_LINEmove left to the start of the line
BLINKinsert the blink attribute (control-F)
BOLDinsert BOLD (control-b) to toggle bold on/off
CDCC_PLISTdisplay the offerlist to current channel
CHANNEL_CHOPSshows ops on the current channel (see USER)
CHANNEL_NONOPSshows non-ops on the current channel (see USER)
CHANGE_TO_SPLITswitch server to one on the other side of a netsplit
CHELPprint the help index
CLEAR_SCREENclear the current window
COMMAND_COMPLETIONattempts to complete the current command based on what you've typed so far, so /cle might expand to /CLEAR for example
CPU_SAVERwho knows?
DCC_PLISTshow active DCC transfer status
DCC_STATSshow accumulated DCC transfer stats
DELETE_CHARACTERdelete under the cursor
DELETE_NEXT_WORDdelete word forward
DELETE_PREVIOUS_WORDdelete word backward
DELETE_TO_PREVIOUS_SPACEdelete bigword backward
END_OF_LINEmove to the end of input line
ENTER_DIGRAPHenter an 8-bit character I think
ERASE_LINEclear the whole input line
ERASE_TO_BEG_OF_LINEdelete to the start of the line
ERASE_TO_END_OF_LINEdelete to the end of the line
FORWARD_CHARACTERmove forward one character
FORWARD_HISTORYreplace the input line with the next item from your history
FORWARD_WORDmove forward one word
HIGHLIGHT_OFFinsert the highlight off character (control-o) that cancels all highlight modes (bold, underline, flash)
IGNORE_NICKinserts a command /ig <nick>, where <nick> is the last nick to send you a message. Press return if you want to keep the command, or delete it as if you had typed it by mistake...
JOIN_LAST_INVITEjoin the channel to which you were most revently /INVITEd
META1_CHARACTER
META2_CHARACTER
META3_CHARACTER
META4_CHARACTER
META5_CHARACTER
META6_CHARACTER
META7_CHARACTER
META8_CHARACTER
META9_CHARACTER
META10_CHARACTER
META11_CHARACTER
META12_CHARACTER
META13_CHARACTER
META14_CHARACTER
META15_CHARACTER
META16_CHARACTER
META17_CHARACTER
META18_CHARACTER
META19_CHARACTER
META20_CHARACTER
META21_CHARACTER
META22_CHARACTER
META23_CHARACTER
META24_CHARACTER
META25_CHARACTER
META26_CHARACTER
META27_CHARACTER
META28_CHARACTER
META29_CHARACTER
META30_CHARACTER
META31_CHARACTER
META32_CHARACTER
META33_CHARACTER
META34_CHARACTER
META35_CHARACTER
META36_CHARACTER
META37_CHARACTER
META38_CHARACTER
META39_CHARACTER
NEW_BEGINNING_OF_LINEsame as beginning_of_line but also sets the internal extended_handled variable.
NEW_SCROLL_BACKWARDscroll the window half a screen backwards
NEW_SCROLL_ENDscroll to the end (the most recent part) of the current window
NEW_SCROLL_FORWARDscroll half a page down towards the end of the current window
NEXT_WINDOWmove to the next window
NICK_COMPLETIONthe nick completion character
NOTHINGkey bound to this are silently ignored
PARSE_COMMANDnot sure what this does
PREVIOUS_WINDOWcycle through windows
QUIT_IRCleave BitchX without any prompt or warning
QUOTE_CHARACTERthe next character you type is inserted literally
REFRESH_INPUTLINEredraw the input buffer
REFRESH_SCREENrefresh the entire screen
REVERSEinsert the reverse video command character (contreol-v)
SCROLL_BACKWARDscroll the window half a screen backwards
SCROLL_ENDscroll to the ens of the window"
SCROLL_FORWARDscroll forwards half a screen in the current window
SCROLL_STARTscroll to the start of the scrollback buffer in the current window
SELF_INSERTinsert the key typed
SEND_LINEreturn: do the line!
SHOVE_TO_HISTORYsave the current line in the history
STOP_IRCsuspend BitchX (use fg to get it back; STOP_IRC is not always available
SWAP_LAST_WINDOWswap the current window with the last hidden one in the list
SWAP_NEXT_WINDOWswap the current window with the next hidden one
SWAP_PREVIOUS_WINDOWswap the current window with the next hidden one
SWITCH_CHANNELStalk to another channel in the same window
TAB_MSGinserts /msg nick at the start of the buffer< based on people who have messaged you recently
TAB_MSG_BACKautoreply
TOGGLE_CLOAKctcp cloaking on or off; this will give a message like CTCP Cloaking is now [Off] when you press the key (Delete on the arrowpad by default). With CTCP cloacking on, people don't get replies from you for ctcp requests like ping, version and finger.
TOGGLE_INSERT_MODEwitch between insert and overtype mode
TOGGLE_STOP_SCREENstop scrolling I think"
TRANSPOSE_CHARACTERSswap the character under the cursor with the one to its left
TYPE_TEXTin a script, this makes text appear in the input buffer. In input, it's already there, so you don't see anything.
UNCLEAR_TEXTundoes the effect of clear!
UNDERLINEinserts control-_, the underline start/stop character
UNSTOP_ALL_WINDOWSresume scrolling everywehre
WHOLEFTshow who was disconnected by a netsplit in all your current channels
WINDOW_BALANCEmake the split screen windows be equally sized
WINDOW_GROW_ONEmake the current window larger
WINDOW_HELPshow the window help index
WINDOW_HIDEhide the current window; text will continue to accumulate in the hidden window with no indication that it's there.
WINDOW_KILLclose (kill) the current window; does not part any channels.
WINDOW_LISTlist your windows
WINDOW_MOVEswap this window with some other one
WINDOW_SHRINK_ONEmake the current window smaller
WINDOW_SWAP_1
WINDOW_SWAP_2
WINDOW_SWAP_3
WINDOW_SWAP_4
WINDOW_SWAP_5
WINDOW_SWAP_6
WINDOW_SWAP_7
WINDOW_SWAP_8
WINDOW_SWAP_9
WINDOW_SWAP_10
YANK_FROM_CUTBUFFERinsert the last text you deleted



Default Bindings for BitchX

The following table shows the default key bindings for BitchX 1.75p2. In a few places, the ankh script changes bindings to make them closer to ircII, emacs, bash and other common utilities, and this has been indicated too.

Any keys not listed here are bound to SELF_INSERT; key sequences not listed here (such as control-w control-w) are bound to NOTHING instead.

Map 0 (no prefix)CharacterCommand
1 (^A)BEGINNING_OF_LINE
2 (^B)BOLD
4 (^D)DELETE_CHARACTER
5 (^E)CHANGE_TO_SPLIT
6 (^F)WHOLEFT
8 (^H (delete))BACKSPACE
9 (^I (tab))TAB_MSG
10 (^J (enter))SEND_LINE
11 (^K)JOIN_LAST_INVITE
12 (^L (linefeed))REFRESH_SCREEN
13 (^M (return))SEND_LINE
14 (^N)QUOTE_CHARACTER
15 (^O)IGNORE_NICK
16 (^P)BACKWARD_HISTORY
17 (^Q)QUOTE_CHARACTER
18 (^R)NICK_COMPLETION
19 (^S)TOGGLE_STOP_SCREEN
20 (^T)TRANSPOSE_CHARACTERS
21 (^U)ERASE_LINE
22 (^V)REVERSE
23 (^W)META2_CHARACTER
24 (^X)SWITCH_CHANNELS
25 (^Y)YANK_FROM_CUTBUFFER
26 (^Z)STOP_IRC
27 (^[ (escape))META1_CHARACTER
29AUTOREPLY
31 (^_)UNDERLINE
127 (^? (delete))BACKSPACE

European keyboards (and probably others) use the eigth bit for extended characters. Having the following keys bound by default causes them lots of grief, so unless you really want to use these, they are commented out.
188, ¼, meta-<SCROLL_START
190, ¾, meta->SCROLL_END
226, â, meta-bBACKWARD_WORD
228, ä, meta-dDELETE_NEXT_WORD
229, å, meta-eSCROLL_END
230, æ, meta-fFORWARD_WORD
232, è, meta-hDELETE_PREVIOUS_WORD
255, ÿ, metta-DELDELETE_PREVIOUS_WORD


Map 1, prefix (ESC char)

ESC-ESCCOMMAND_COMPLETION
ESC-.CLEAR_SCREEN
ESC-<SCROLL_START
ESC->SCROLL_END
ESC-OMETA2_CHARACTER
ESC-[META2_CHARACTER
ESC-DBACKWARD_WORD
ESC-dDELETE_NEXT_WORD
ESC-eSCROLL_END
ESC-fFORWARD_WORD
ESC-hDELETE_PREVIOUS_WORD
ESC-nSCROLL_FORWARD
ESC-pSCROLL_BACKWARD
ESC-DELDELETE_PREVIOUS_WORD
ESC-1WINDOW_SWAP_1
ESC-2WINDOW_SWAP_2
ESC-3WINDOW_SWAP_3
ESC-4WINDOW_SWAP_4
ESC-5WINDOW_SWAP_5
ESC-6WINDOW_SWAP_6
ESC-7WINDOW_SWAP_7
ESC-8WINDOW_SWAP_8
ESC-9WINDOW_SWAP_9
ESC-0WINDOW_SWAP_10

Map 2, Prefix Meta2 (Control-w char, ESC-O, ESC-[)

^W-^ZSTOP_IRC
^W-ABACKWARD_HISTORY
^W-BFORWARD_HISTORY
^W-CFORWARD_CHARACTER
^W-DBACKWARD_CHARACTER
^W-nSWAP_NEXT_WINDOW
^W-nNEXT_WINDOW, if you have the Ankh script loaded
^W-pPREVIOUS_WINDOW

These are added for BSD console mode
^W-HNEW_BEGINNING_OF_LINE
^W-FNEW_SCROLL_END
^W-INEW_SCROLL_BACKWARD
^W-GNEW_SCROLL_FORWARD
^W-?WINDOW_HELP
^W-+WINDOW_GROW_ONE
^W--WINDOW_SHRINK_ONE
^W-mWINDOW_MOVE
^W-lWINDOW_LISTK
^W-kWINDOW_KILL
^W-bWINDOW_BALANCE
^W-hWINDOW_HIDE

Map 2, prefix Meta2 (Control-w char)

^W-[META3_CHARACTER
^W-1META3_CHARACTER
^W-MCHELP
^W-NCHANNEL_CHOPS
^W-OCHANNEL_NONOPS
^W-PCDCC_PLIST
^W-QDCC_PLIST
^W-RDCC_STATS
^W-1META3_CHARACTER
^W-3META34_CHARACTER
^W-4META33_CHARACTER
^W-5META30_CHARACTER
^W-6META31_CHARACTER
META32-~BEGINNING_OF_LINE
META34-~[Delete] TOGGLE_CLOAK
META33-~SCROLL_END
META30-~SCROLL_BACKWARD
META31-~SCROLL_FORWARD
^W-?WINDOW_HELP
^W-+WINDOW_GROW_ONE
^W--WINDOW_SHRINK_ONE
^W-mWINDOW_MOVE
^W-lWINDOW_LISTK
^W-kWINDOW_KILL
^W-bWINDOW_BALANCE
^W-hWINDOW_HIDE

Meta 3 characters (Control-w [ char)

^W-[META3_CHARACTER
^W-1META3_CHARACTER
ESC-[-[-ACHELP
ESC-[-[-BCHANNEL_CHOPS
ESC-[-[-CCHANNEL_NONOPS
ESC-[-[-DCDCC_PLIST
ESC-[-[-EDCC_PLIST
ESC-[-[-7DCC_STATS

Meta 4 characters (vi characters?)

Note: Since Meta4 is not bound to anything by default, this table is not accessible unless you bind META4 to something yourself

^HBACKWARD_CHARACTER
spaceFORWARD_CHARACTER
AMETA4_CHARACTER
HBACKWARD_CHARACTER
IMETA4_CHARACTER
JFORWARD_HISTORY
KBACKWARD_HISTORY
LFORWARD_CHARACTER
XDELETE_CHARACTER
^META4_CHARACTER
h4BACKWARD_CHARACTER
iMETA4_CHARACTER
jFORWARD_HISTORY
kBACKWARD_HISTORY
jFORWARD_CHARACTER
xDELETE_CHARACTER