Skip to content

Configuring key bindings

JosBosmans edited this page Nov 12, 2023 · 7 revisions

Configuration

The default keymap is commented out at the bottom of the default config.yml file that tiny creates.

Here is a minimal version:

key_map:
  ctrl_a:     input_move_curs_start
  ctrl_e:     input_move_curs_end

Each entry in the map is made up of a Key (single or combination) and a KeyAction.

Keys

Here are the available keys that you can set or override:

Single keys

  • backspace
  • del
  • end
  • esc
  • home
  • pgdown
  • pgup
  • tab
  • up
  • down
  • left
  • right
  • any other single character or number

Combinations

  • Alt + arrow, ex. alt_left
  • Alt + character, ex. alt_c
  • Ctrl + character, ex. ctrl_a
  • Ctrl + arrow, ex. ctrl_up

Key Actions

Here are a list of the available KeyActions:

KeyAction Description
cancel currently only used for cancelling the exit dialogue
disable disables a key
exit shows the exit dialogue to quit Tiny
run_editor run the external text editor
tab_next go to the next tab
tab_prev go to the previous tab
tab_move_left move the tab to the left in the tab bar
tab_move_right move the tab to the right in the tab bar
tab_goto: [char] go to the tab assigned to a letter or number
messages_page_up scroll up one page in the current tab's messages
messages_page_down scroll down one page in the current tab's messages
messages_scroll_up scroll up by one line in the current tab's messages
messages_scroll_down scroll down by one line in the current tab's messages
messages_scroll_top scroll to the top of the current tab's messages
messages_scroll_bottom scroll to the bottom of the current tab's messages
input: [char] input a character
command: [string] pass a command (called run_command before)
input_autocomplete trigger nickname auto
input_next_entry go to the next history entry or next nick if in auto
input_prev_entry go to the previous history entry or next nick if in auto
input_send send message that is written on input line
input_delete_prev_char delete the previous character on input line
input_delete_next_char delete the next character on input line
input_delete_to_start delete to the start of the line from cursor position
input_delete_to_end delete to the end of the line from cursor position
input_delete_prev_word delete the word before the cursor
input_move_curs_end move cursor to the end of the input line
input_move_curs_start move cursor to the start of the input line
input_move_curs_left move cursor to the left by one
input_move_curs_right move cursor to the right by one
input_move_word_left move cursor one word to the left
input_move_word_right move cursor one word to the right

Advanced Mappings

If you are using a non-US keyboard, such as AZERTY, you may rebind the tab control keys as follows:

keymap:
  alt_&: 
     tab_goto: 1
  alt_": 
     tab_goto: 3
  alt_': 
     tab_goto: 4
  alt_(: 
     tab_goto: 5
  alt_-: 
     tab_goto: 6
  alt_è: 
     tab_goto: 7
  alt__: 
     tab_goto: 8
  alt_ç: 
     tab_goto: 9
  alt_à: 
     tab_goto: 0

You can also rebind characters to other characters with the following:

keymap:
  q: 
     input: p

This will map the q key to p, so when you hit q it will input a p in the text field.

Code reference

Clone this wiki locally