Skip to content

Instantly share code, notes, and snippets.

@imjma
Created August 14, 2012 04:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save imjma/3346207 to your computer and use it in GitHub Desktop.
Save imjma/3346207 to your computer and use it in GitHub Desktop.
[RimeIME](http://code.google.com/p/rimeime/) Custom YAML files
# Rime alternative settings
# encoding: utf-8
#
# modifications to default settings:
# 1. ascii-style punctuation in half-shape mode
# 2. [ ] as paging keys
#
# save this file as:
# (Linux) ~/.config/ibus/rime/alternative.yaml
# (Mac OS) ~/Library/Rime/alternative.yaml
# (Windows) "%APPDATA%\Rime\alternative.yaml"
#
# edit <SCHEMA_ID>.custom.yaml:
# >> patch:
# >> 'punctuator/import_preset': alternative
# >> 'key_binder/import_preset': alternative
config_version: "0.2"
punctuator:
full_shape:
" " : { commit: " " }
"," : { commit: , }
"." : { commit: 。 }
"<" : [ 《, 〈, «, ‹ ]
">" : [ 》, 〉, », › ]
"/" : [ 、, /, "/", ÷ ]
"?" : { commit: ? }
";" : { commit: ; }
":" : :
"'" : { pair: [ "‘", "’" ] }
"\"" : { pair: [ "“", "”" ] }
"\\" : [ 、, \, "\\" ]
"|" : [ ・, |, "|", "§", "¦" ]
"`" : [ `, "`" ]
"~" : [ 〜, "~", ~, 〰 ]
"!" : { commit: ! }
"@" : [ @, "@", ☯ ]
"#" : [ #, "#", ⌘ ]
"%" : [ %, "%", "°", "℃" ]
"$" : [ ¥, "$", "€", "£", "¥", "¢", "¤" ]
"^" : { commit: …… }
"&" : [ &, "&" ]
"*" : [ *, "*", ・, ×, ※, ❂, · ]
"(" : (
")" : )
"-" : [ -, "-" ]
"_" : ——
"+" : [ +, "+" ]
"=" : [ =, "=" ]
"[" : [ 「, 【, 〔, [ ]
"]" : [ 」, 】, 〕, ] ]
"{" : [ 『, 〖, { ]
"}" : [ 』, 〗, } ]
half_shape:
"," : { commit: "," }
"." : { commit: "." }
"<" : "<"
">" : ">"
"/" : "/"
"?" : { commit: "?" }
";" : { commit: ";" }
":" : { commit: ":" }
"'" : "'"
"\"" : "\""
"\\" : "\\"
"|" : "|"
"`" : "`"
"~" : "~"
"!" : { commit: "!" }
"@" : "@"
"#" : "#"
"%" : "%"
"$" : "$"
"^" : "^"
"&" : "&"
"*" : "*"
"(" : "("
")" : ")"
"-" : "-"
"_" : "_"
"+" : "+"
"=" : "="
"[" : "["
"]" : "]"
"{" : "{"
"}" : "}"
key_binder:
bindings:
# commonly used 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 }
- { when: paging, accept: bracketleft, send: Page_Up }
- { when: has_menu, accept: bracketright, send: Page_Down }
patch:
"menu/page_size": 9
schema_list:
- schema: luna_pinyin
# luna_pinyin.custom.yaml
#
# 【朙月拼音】模糊音定製模板
# 佛振配製 :-)
#
# 位置:
# ~/.config/ibus/rime (Linux)
# ~/Library/Rime (Mac OS)
# %APPDATA%\Rime (Windows)
#
# 於重新部署後生效
#
patch:
'punctuator/import_preset': alternative
'speller/algebra':
- erase/^xx$/ # 第一行保留
# 模糊音定義
# 需要哪組就刪去行首的 # 號,單雙向任選
#- derive/^([zcs])h/$1/ # zh, ch, sh => z, c, s
#- derive/^([zcs])([^h])/$1h$2/ # z, c, s => zh, ch, sh
#- derive/^n/l/ # n => l
#- derive/^l/n/ # l => n
# 這兩組一般是單向的
#- derive/^r/l/ # r => l
#- derive/^ren/yin/ # ren => yin, reng => ying
#- derive/^r/y/ # r => y
# 下面 hu <=> f 這組寫法複雜一些,分情況討論
#- derive/^hu$/fu/ # hu => fu
#- derive/^hong$/feng/ # hong => feng
#- derive/^hu([in])$/fe$1/ # hui => fei, hun => fen
#- derive/^hu([ao])/f$1/ # hua => fa, ...
#- derive/^fu$/hu/ # fu => hu
#- derive/^feng$/hong/ # feng => hong
#- derive/^fe([in])$/hu$1/ # fei => hui, fen => hun
#- derive/^f([ao])/hu$1/ # fa => hua, ...
# 韻母部份
#- derive/^([bpmf])eng$/$1ong/ # meng = mong, ...
#- derive/([ei])n$/$1ng/ # en => eng, in => ing
#- derive/([ei])ng$/$1n/ # eng => en, ing => in
# 樣例足夠了,其他請自己總結……
# 反模糊音?
# 誰說方言沒有普通話精確、有模糊音,就能有反模糊音。
# 示例爲分尖團的中原官話:
#- derive/^ji$/zii/ # 在設計者安排下鳩佔鵲巢,尖音i只好雙寫了
#- derive/^qi$/cii/
#- derive/^xi$/sii/
#- derive/^ji/zi/
#- derive/^qi/ci/
#- derive/^xi/si/
#- derive/^ju/zv/
#- derive/^qu/cv/
#- derive/^xu/sv/
# 韻母部份,只能從大面上覆蓋
#- derive/^([bpm])o$/$1eh/ # bo => beh, ...
#- derive/(^|[dtnlgkhzcs]h?)e$/$1eh/ # ge => geh, se => sheh, ...
#- derive/^([gkh])uo$/$1ue/ # guo => gue, ...
#- derive/^([gkh])e$/$1uo/ # he => huo, ...
#- derive/([uv])e$/$1o/ # jue => juo, lve => lvo, ...
#- derive/^fei$/fi/ # fei => fi
#- derive/^wei$/vi/ # wei => vi
#- derive/^([nl])ei$/$1ui/ # nei => nui, lei => lui
#- derive/^([nlzcs])un$/$1vn/ # lun => lvn, zun => zvn, ...
#- derive/^([nlzcs])ong$/$1iong/ # long => liong, song => siong, ...
# 這個辦法雖從拼寫上做出了區分,然而受詞典制約,候選字仍是混的。
# 只有真正的方音輸入方案纔能做到!但「反模糊音」這個玩法快速而有效!
# 模糊音定義先於簡拼定義,方可令簡拼支持以上模糊音
- abbrev/^([a-z]).+$/$1/ # 簡拼(首字母)
- abbrev/^([zcs]h).+$/$1/ # 簡拼(zh, ch, sh)
# 以下是一組容錯拼寫,《漢語拼音》方案以前者爲正
- derive/^([nl])ve$/$1ue/ # nve = nue, lve = lue
- derive/^([jqxy])u/$1v/ # ju = jv,
- derive/un$/uen/ # gun = guen,
- derive/ui$/uei/ # gui = guei,
- derive/iu$/iou/ # jiu = jiou,
# 自動糾正一些常見的按鍵錯誤
- derive/([aeiou])ng$/$1gn/ # dagn => dang
- derive/([dtngkhrzcs])o(u|ng)$/$1o/ # zho => zhong|zhou
- derive/ong$/on/ # zhonguo => zhong guo
- derive/ao$/oa/ # hoa => hao
- derive/([iu])a(o|ng?)$/a$1$2/ # tain => tian
# 分尖團後 v => ü 的改寫條件也要相應地擴充:
#'translator/preedit_format':
# - "xform/([nljqxyzcs])v/$1ü/"
# 適用於【鼠鬚管】0.9.6+
# 位置:~/Library/Rime/squirrel.custom.yaml
# 用法:想要哪項生效,就刪去該行行首的#字符,但注意保留用於縮進的空格
patch:
us_keyboard_layout: true # 鍵盤選項:應用美式鍵盤佈局
style/horizontal: true # 候選窗横向顯示
# style/font_face: "儷黑 Pro" # 我喜歡的字體名稱
style/font_point: 16 # 字號
style/corner_radius: 6 # 窗口圓角半徑
# style/border_height: 0 # 窗口邊界高度,大於圓角半徑才有效果
# style/border_width: 0 # 窗口邊界寬度,大於圓角半徑才有效果
# style/color_scheme: luna # 選擇配色方案
# 註:預設的配色方案及代碼(指定爲 style/color_scheme )
# 碧水 - aqua
# 青天 - azure
# 明月 - luna
# 墨池 - ink
# 孤寺 - lost_temple
# 暗堂 - dark_temple
# 星際我爭霸 - starcraft
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment