Skip to content

Configuring key bindings

Trevor Arjeski edited this page Jul 2, 2021 · 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:

  • cancel

  • disable

  • exit

  • run_editor

  • tab_next

  • tab_prev

  • tab_move_left

  • tab_move_right

  • tab_goto: [char]

  • messages_page_up

  • messages_page_down

  • messages_scroll_up

  • messages_scroll_down

  • messages_scroll_top

  • messages_scroll_bottom

  • input: [char]

  • input_autocomplete

  • input_next_entry

  • input_prev_entry

  • input_send

  • input_delete_prev_char

  • input_delete_next_char

  • input_delete_to_start

  • input_delete_to_end

  • input_delete_prev_word

  • input_move_curs_end

  • input_move_curs_start

  • input_move_curs_left

  • input_move_curs_right

  • input_move_word_left

  • input_move_word_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