跳轉至內容

uim/配置

來自 Wikibooks,開放世界中的開放書籍
< Uim

Uim可以透過兩種方式進行配置,一種是配置檔案,另一種是圖形介面。

主要的配置選項包括使用哪些輸入法以及啟用它們的鍵盤快捷鍵。

圖形介面

[編輯 | 編輯原始碼]

有兩個相同的圖形介面:一個用於GTK+,另一個用於Qt,分別稱為uim-pref-gtkuim-pref-qt。以下是介面中配置設定的列表,以及它們在配置檔案中(位於~/.uim.d/customs)中的顯示方式。

全域性設定

[編輯 | 編輯原始碼]
全域性設定檢視。

輸入法部署

[編輯 | 編輯原始碼]
  • 指定預設輸入法(custom-activate-default-im-name? <布林值>,custom-preserved-default-im-name <字串>))
  • 預設輸入法(如果上面是“#f”,則default-im-name設定為“#f”,否則設定為<字串>)
  • 啟用的輸入法(enabled-im-list <列表>)

輸入法切換

[編輯 | 編輯原始碼]
  • 透過熱鍵啟用輸入法切換(enable-im-switch? <布林值>)
  • 輸入法切換鍵(switch-im-key <字串>,switch-im-key?(make-key-predicate '("<Control>Shift_key" "<Shift>Control_key"))))
  • 跳過透過熱鍵進行輸入法切換的直接方法(switch-im-skip-direct-im? <布林值>)

輸入法切換開關

[編輯 | 編輯原始碼]
  • 透過熱鍵啟用輸入法切換開關(enable-im-toggle? <切換>)
  • 輸入法切換開關鍵(toggle-im-key <字串>,toggle-im-key?(make-key-predicate '("<Meta> "))))
  • 備用輸入法(toggle-im-alt-im <字串>)

視覺偏好

[編輯 | 編輯原始碼]
  • 預編輯顏色(uim-color {uim-color-uim|uim-color-atok})
  • 候選視窗位置(candidate-window-position {caret,left,right})
  • 在游標附近顯示輸入法狀態(bridge-show-input-state? <布林值>)
  • 在游標附近顯示輸入法狀態的時間長度(bridge-show-input-state-time-length <整數>)

高階設定

[編輯 | 編輯原始碼]
  • 啟用延遲載入輸入法以加快啟動速度(enable-lazy-loading? <布林值>)

工具欄設定

[編輯 | 編輯原始碼]
工具欄設定檢視。
[編輯 | 編輯原始碼]
  • 啟用基於選單的輸入法切換器(toolbar-show-action-based-switcher-button?
  • 有效覆蓋範圍(imsw-coverage {system-global,app-global,focused-context})
  • 功能齊全的輸入法切換器(toolbar-show-switcher-button? <布林值>)
  • 偏好設定工具(toolbar-show-pref-button? <布林值>)
  • 日語詞典工具(toolbar-show-dict-button? <布林值>)
  • 輸入板(toolbar-show-input-pad-button? <布林值>)
  • 手寫輸入板(toolbar-show-handwriting-input-pad-button? <布林值>)
  • 幫助(toolbar-show-help-button?
待辦事項:.uim.d/customs/custom-toolbar.scm定義了另外十五個設定變數,這些變數似乎也在其他配置檔案中定義……為什麼?

(define anthy-widgets '(widget_anthy_input_mode widget_anthy_kana_input_method)) (define default-widget_anthy_input_mode 'action_anthy_direct) (define anthy-input-mode-actions '(action_anthy_direct action_anthy_hiragana action_anthy_katakana action_anthy_halfkana action_anthy_halfwidth_alnum action_anthy_fullwidth_alnum)) (define default-widget_anthy_kana_input_method 'action_anthy_roma) (define anthy-kana-input-method-actions '(action_anthy_roma action_anthy_kana action_anthy_azik)) (define anthy-utf8-widgets '(widget_anthy_utf8_input_mode widget_anthy_utf8_kana_input_method)) (define default-widget_anthy_utf8_input_mode 'action_anthy_utf8_direct) (define anthy-utf8-input-mode-actions '(action_anthy_utf8_direct action_anthy_utf8_hiragana action_anthy_utf8_katakana action_anthy_utf8_halfkana action_anthy_utf8_halfwidth_alnum action_anthy_utf8_fullwidth_alnum)) (define default-widget_anthy_utf8_kana_input_method 'action_anthy_utf8_roma) (define anthy-utf8-kana-input-method-actions '(action_anthy_utf8_roma action_anthy_utf8_kana action_anthy_utf8_azik)) (define skk-widgets '(widget_skk_input_mode widget_skk_kana_input_method)) (define default-widget_skk_input_mode 'action_skk_latin) (define skk-input-mode-actions '(action_skk_latin action_skk_hiragana action_skk_katakana action_skk_hankana action_skk_wide_latin)) (define default-widget_skk_kana_input_method 'action_skk_roma) (define skk-kana-input-method-actions '(action_skk_roma action_skk_azik))

EB 庫設定

[編輯 | 編輯原始碼]
EB 庫設定檢視。

候選視窗

[編輯 | 編輯原始碼]
  • 使用EB庫搜尋註釋(eb-enable-for-annotation? <布林值>)
  • 定義EB字典檔案的字典(eb-dic-path 例如“/usr/share/dict”)
XIM 設定檢視。
  • 為即時/根視窗預編輯使用抗鋸齒字型。(uim-xim-use-xft-font? <布林值>)
  • 預編輯區域的字型名稱(uim-xim-xft-font-name 例如“VL Gothic”)

通知設定

[編輯 | 編輯原始碼]
通知設定檢視。

通知代理名稱

[編輯 | 編輯原始碼]
  • notify-agent

配置檔案

[編輯 | 編輯原始碼]

您也可以透過編輯配置檔案 ~/.uim 來配置 uim(另請參見 LIBUIM_USER_SCM_FILE)。

~/.uim 中的配置會覆蓋圖形介面 uim-pref 的配置。這意味著,如果這兩個配置發生衝突,則始終使用 ~/.uim 中的配置。

您可以使用 uim-sh 檢查 Scheme 程式碼是否有效。

$ uim-sh ~/.uim

如果要在檔案中寫入日語字元,請確保檔案編碼為 EUC-JP。

您可能希望將這些行追加到 ~/.uim。

;; vim:ft=scheme:fenc=euc-jp

如果您使用 Vim 並且

;; Local Variables:
;; mode: scheme
;; coding: euc-jp
;; End:

如果您使用 Emacs。這些行告訴您的編輯器以 Scheme 模式開啟 ~/.uim 並將檔案編碼設定為 EUC-JP。

環境變數

[編輯 | 編輯原始碼]

某些值適用於 uim 開發人員。

在下面的描述中,如果您將 uim 安裝到“/usr/local”,則 sys-pkglibdir 為“/usr/local/libexec”。sys-pkglibdir 的其他可能值為“/usr/libexec”和“/usr/lib/uim”。您可以使用 uim-sh 獲取 sys-pkglibdir 的值。

$ uim-sh
uim> (sys-pkglibdir)
"/usr/local/libexec"
uim> (exit)
$

LIBUIM_ENABLE_EMERGENCY_KEY

[編輯 | 編輯原始碼]

啟用緊急鍵。設定此變數並啟動橋接後,您可以透過按 Shift+Backspace 停用 uim 中的所有按鍵處理。

LIBUIM_PLUGIN_LIB_DIR

[編輯 | 編輯原始碼]

指定放置外掛檔案的位置。預設值為 sys-pkglibdir/plugin、~/.uim.d/plugin 和 LD_LIBRARY_PATH。

LIBUIM_SCM_FILES

[編輯 | 編輯原始碼]

指定放置 Scheme 原始檔的位置。預設值為 sys-pkgdatadir 和 ~/.uim.d/plugin。

LIBUIM_USER_SCM_FILE

[編輯 | 編輯原始碼]

指定當前使用者使用 Scheme 編寫的配置檔案。預設值為 ~/.uim。

您可以使用此變數測試您的配置檔案和/或將您的配置應用於有限的應用程式。

假設您建立一個名為 latin.scm 的檔案,將其放在您的主目錄 (~) 中,並在檔案中寫入以下程式碼

(define default-im-name 'latin)

然後按如下方式執行 Firefox

$ LIBUIM_USER_SCM_FILE=~/latin.scm firefox

您可以看到 Firefox 使用 IM 引擎 latin 啟動。

LIBUIM_VANILLA

[編輯 | 編輯原始碼]

停用 uim 中的一些功能。uim 的行為取決於指定的值

行為
2 忽略配置檔案(例如 default.scm、~/.uim 和 ~/.uim.d)

並停用延遲載入。

否則 忽略配置檔案(例如 default.scm、~/.uim 和

~/.uim.d),停用延遲載入並停用除 direct 之外的模組。

LIBUIM_VERBOSE

[編輯 | 編輯原始碼]

指定訊息的詳細級別。您需要使用“--enable-debug”進行構建才能使用此變數。

行為
3 還會輸出檔案載入的狀態。
4 還會輸出垃圾回收使用情況的狀態。
5 還會輸出程式碼評估過程。

UIM_IM_ENGINE

[編輯 | 編輯原始碼]

指定 IM 引擎名稱。

華夏公益教科書