# Rime default settings
# vim: set sw=2 sts=2 et:
# encoding: utf-8

config_version: "0.14.minimal"

schema_list:
  - schema: luna_pinyin
  - schema: cangjie5

switcher:
  caption: 〔方案選單〕
  hotkeys:
    - Control+grave
    - Control+Shift+grave
    - F4
  save_options:
    - full_shape
    - ascii_punct
    - simplification
    - extended_charset
  fold_options: true
  abbreviate_options: true
  option_list_separator: '／'

menu:
  page_size: 5

punctuator:
  full_shape:
    ' ' : { commit: '　' }
    ',' : { commit: ， }
    '.' : { commit: 。 }
    '<' : [ 《, 〈, «, ‹ ]
    '>' : [ 》, 〉, », › ]
    '/' : [ ／, ÷ ]
    '?' : { commit: ？ }
    ';' : { commit: ； }
    ':' : { commit: ： }
    '''' : { pair: [ '‘', '’' ] }
    '"' : { pair: [ '“', '”' ] }
    '\' : [ 、, ＼ ]
    '|' : [ ・, ｜, '§', '¦' ]
    '`' : ｀
    '~' : [ 〜, ～, 〰 ]
    '!' : { commit: ！ }
    '@' : [ ＠, ☯ ]
    '#' : [ ＃, ⌘ ]
    '%' : [ ％, '°', '℃' ]
    '$' : [ ￥, '$', '€', '£', '¥', '¢', '¤' ]
    '^' : { commit: …… }
    '&' : ＆
    '*' : [ ＊, ・, ·, ×, ※, ❂ ]
    '(' : （
    ')' : ）
    '-' : －
    '_' : ——
    '+' : ＋
    '=' : ＝
    '[' : [ 「, 【, 〔, ［ ]
    ']' : [ 」, 】, 〕, ］ ]
    '{' : [ 『, 〖, ｛ ]
    '}' : [ 』, 〗, ｝ ]
  half_shape:
    ',' : { commit: ， }
    '.' : { commit: 。 }
    '<' : [ 《, 〈, «, ‹ ]
    '>' : [ 》, 〉, », › ]
    '/' : [ 、, '/', ／, ÷ ]
    '?' : { commit: ？ }
    ';' : { commit: ； }
    ':' : { commit: ： }
    '''' : { pair: [ '‘', '’' ] }
    '"' : { pair: [ '“', '”' ] }
    '\' : [ 、, '\', ＼ ]
    '|' : [ ・, '|', ｜, '§', '¦' ]
    '`' : '`'
    '~' : [ '~', 〜, ～, 〰 ]
    '!' : { commit: ！ }
    '@' : '@'
    '#' : '#'
    '%' : [ '%', ％, '°', '℃' ]
    '$' : [ ￥, '$', '€', '£', '¥', '¢', '¤' ]
    '^' : { commit: …… }
    '&' : '&'
    '*' : [ '*', ＊, ・, ·, ×, ※, ❂ ]
    '(' : （
    ')' : ）
    '-' : '-'
    '_' : ——
    '+' : '+'
    '=' : '='
    '[' : [ 「, 【, 〔, ［ ]
    ']' : [ 」, 】, 〕,  ］ ]
    '{' : [ 『, 〖, ｛ ]
    '}' : [ 』, 〗, ｝ ]

key_binder:
  bindings:
    # Emacs style
    - { when: composing, accept: Control+p, send: Up }
    - { when: composing, accept: Control+n, send: Down }
    - { when: composing, accept: Control+b, send: Left }
    - { when: composing, accept: Control+f, send: Right }
    - { when: composing, accept: Control+a, send: Home }
    - { when: composing, accept: Control+e, send: End }
    - { when: composing, accept: Control+d, send: Delete }
    - { when: composing, accept: Control+k, send: Shift+Delete }
    - { when: composing, accept: Control+g, send: Escape }
    - { when: composing, accept: Alt+v, send: Page_Up }
    - { when: composing, accept: Control+v, send: Page_Down }
    # paging keys
    - { when: composing, accept: ISO_Left_Tab, send: Page_Up }
    - { when: composing, accept: Shift+Tab, send: Page_Up }
    - { when: composing, accept: Tab, send: Page_Down }
    - { when: paging, accept: minus, send: Page_Up }
    - { when: has_menu, accept: equal, send: Page_Down }
    - { when: paging, accept: comma, send: Page_Up }
    - { when: has_menu, accept: period, send: Page_Down }
    # hotkey switch
    - { when: always, accept: Control+Shift+1, select: .next }
    - { when: always, accept: Control+Shift+2, toggle: ascii_mode }
    - { when: always, accept: Control+Shift+3, toggle: full_shape }
    - { when: always, accept: Control+Shift+4, toggle: simplification }
    - { when: always, accept: Control+Shift+5, toggle: extended_charset }
    - { when: always, accept: Shift+space, toggle: full_shape }
    - { when: always, accept: Control+period, toggle: ascii_punct }

recognizer:
  patterns:
    email: "^[a-z][-_.0-9a-z]*@.*$"
    uppercase: "[A-Z][-_+.'0-9A-Za-z]*$"
    url: "^(www[.]|https?:|ftp:|mailto:).*$|^[a-z]+[.].+$"

ascii_composer:
  switch_key:
    Shift_L: inline_ascii
    Shift_R: commit_text
    Control_L: noop
    Control_R: noop
