#desc Top ; -*- mode: Muse; coding: euc-japan-unix -*- #title SKK ****** $Lastupdate: 2007/11/09 16:04:12 $ 一度 skk を使い始めたら, 二度と他の変換方法は使えなくなると思います. * 導入 辞書サーバとして dbskkd-cdb を使用しています. $ sudo aptitude install dbskkd-cdb ddskk * 設定 ** 基本設定 .emacs では (require 'skk-leim) (setq default-input-method "japanese-skk") (require 'skk-autoloads) (autoload 'skk-auto-fill-mode "skk" nil t) ;; skk モードの表示のカスタマイズ (setq skk-cursor-latin-color "DeepPink1") (setq skk-latin-mode-string "[aa]") (setq skk-cursor-jisx0208-latin-color "DeepPink1") (setq skk-hiragana-mode-string "[あ]") (setq skk-cursor-katakana-color "DeepPink1") (setq skk-katakana-mode-string "[ア]") (setq skk-cursor-jisx0208-latin-color "DeepPink1") (setq skk-jisx0208-latin-mode-string "[英]") (setq skk-indicator-use-cursor-color nil) ;; 辞書サーバとの指定(localhost) (setq skk-large-jisyo nil) (setq skk-server-host "127.0.0.1" skk-portnum 1178) (global-set-key "\C-x\C-j" 'skk-mode) (global-set-key "\C-xj" 'skk-mode) (global-set-key "\C-j" 'skk-mode) (global-set-key "\C-\\" 'skk-mode) ;; 辞書登録の際に送り仮名を削除 (setq skk-check-okurigana-on-touroku 'auto) ;; インジケータを左端に. (setq skk-status-indicator 'left) ;; 変換時 (setq skk-egg-like-newline t) ;; メッセージは日本語で (setq skk-japanese-message-and-error t) ;;"「"を入力したら"」"も自動で挿入 (setq skk-auto-insert-paren t) ;;漢字登録のミスをチェックする (setq skk-check-okurigana-on-touroku t) ;; 句読点は , . を使う (setq skk-kuten-touten-alist '( (jp . ("." . "," )) (en . ("." . ",")) )) ;; jp でも ".""," を使う. (setq skk-kutouten-type 'en) ;; @で挿入する日付表示を西暦&半角に (setq skk-date-ad t) (setq skk-number-style nil) ** sticky-shift シフトキーを打つのに小指が攣りそうになるので, ; + ascii で大文字が打て るようにしています. ; を入力したいときは二回打ちます. - [[http://homepage1.nifty.com/blankspace/emacs/sticky.html][sticky shift]] uim で sticky shift できるようにならないかなぁ. scim でも良いけど. ;; skk モード での入力を ; + ascii にする. (defvar sticky-key ";") (defvar sticky-list '( ("a" . "A") ("b" . "B") ("c" . "C") ("d" . "D") ("e" . "E") ("f" . "F") ("g" . "G") ("h" . "H") ("i" . "I") ("j" . "J") ("k" . "K") ("l" . "L") ("m" . "M") ("n" . "N") ("o" . "O") ("p" . "P") ("q" . "Q") ("r" . "R") ("s" . "S") ("t" . "T") ("u" . "U") ("v" . "V") ("w" . "W") ("x" . "X") ("y" . "Y") ("z" . "Z") ("1" . "!") ("2" . "\"") ("3" . "#") ("4" . "$") ("5" . "%") ("6" . "&") ("7" . "'") ("8" . "(") ("9" . ")") ("0" . "~") ("@" . "`") ("[" . "{") ("]" . "}") ("-" . "=") (":" . "*") ("," . "<") ("." . ">") ("/" . "?") (";" . "+") ("\\" . "|") ("^" . "_")(" " ." ") )) (defvar sticky-map (make-sparse-keymap)) (define-key global-map sticky-key sticky-map) (mapcar (lambda (pair) (define-key sticky-map (car pair) `(lambda() (interactive) (setq unread-command-events (cons , (string-to-char (cdr pair)) unread-command-events))))) sticky-list) (define-key sticky-map sticky-key '(lambda () (interactive) (insert sticky-key))) (add-hook 'skk-mode-hook (lambda () (progn (define-key skk-j-mode-map sticky-key sticky-map) (define-key skk-jisx0208-latin-mode-map sticky-key sticky-map) (define-key skk-abbrev-mode-map sticky-key sticky-map) ) )) (setq skk-isearch-start-mode 'latin) ** 辞書の増強 追加するのは - [[http://www.chibutsu.org/jisho/][地球物理辞書]] - [[http://www.geocities.jp/living_with_plasma/tanudic.html][天文・天体物理用語の漢字変換用辞書]] - [[http://omaemona.wiki.sourceforge.net/2chDic][2chDic]] 辞書の変換は $ sudo aptitude install skktools cp /usr/share/skktools/convert2skk/wnn2skk.* chmod u+x wnn2skk.* export LANG=ja_JP.eucJP wnn2skk.sh tandic4.txt > SKK-JISYO.tanudic4 wnn2skk.sh chibutsu.u > SKK-JISYO.chibutsu skkdic-expr2 SKK-JISYO.chibutsu + \ SKK-JISYO.tanudic4 + SKK-JISYO.2ch + SKK-JISYO.L \ > SKK-JISYO.new みたいに. できた SKK-JISYO.new を cdb 化する. $ skk2cdb < SKK-JISYO.new > SKK-JISYO.new.cdb SKK-JISYO.cdb は /etc/alternatives で管理されており, 例えば /usr/share/skk/SKK-JISYO は $ ls -la /usr/share/skk/SKK-JISYO /etc/alternatives/SKK-JISYO $ ls -la /etc/alternatives/SKK-JISYO /usr/share/skk/SKK-JISYO.L となっている. よって, update-alternatives でファイルを install することに. $ sudo -s # cp SKK-JISYO.new /usr/share/skk/ # cp SKK-JISYO.new.cdb /usr/share/skk/ # update-alternatives --install /usr/share/skk/SKK-JISYO \ SKK-JISYO /usr/share/skk/SKK-JISYO.new 70 # update-alternatives --config SKK-JISYO ... SKK-JISYO.new を選択 # update-alternatives --install /usr/share/skk/SKK-JISYO.cdb \ SKK-JISYO.cdb /usr/share/skk/SKK-JISYO.new.cdb 70 # update-alternatives --config SKK-JISYO.cdb ... SKK-JISYO.new.cdb を選択 ---- * 参考文献 - [[http://openlab.jp/skk/index-j.html][ようこそ、SKK Openlab へ]] - [[http://homepage1.nifty.com/blankspace/emacs/sticky.html][sticky shift]] - [[http://www.chibutsu.org/jisho/][地球物理辞書]] - [[http://www.geocities.jp/living_with_plasma/tanudic.html][天文・天体物理用語の漢字変換用辞書]] - [[http://omaemona.wiki.sourceforge.net/2chDic][2chDic]]