Skip to content

Instantly share code, notes, and snippets.

@hchbaw
Created June 19, 2010 07:54
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save hchbaw/444693 to your computer and use it in GitHub Desktop.
;; g:eskk_revert_henkan_style = "eskk"
;; http://github.com/tyru/eskk.vim/commit/a962f27d868c902415c364df8a7cb0d0d8018bcc
;; Thank you very much, tyru!
(define skk-back-to-kanji-state
(lambda (sc)
(let ((skk (lambda (sc)
(skk-context-set-state! sc 'skk-state-kanji)
(skk-context-set-okuri-head! sc "")
(if (not (null? (skk-context-okuri sc)))
(begin
(skk-context-set-head! sc
(append (skk-context-okuri sc)
(skk-context-head sc)))
(skk-reset-dcomp-word sc)))
(if (not (null? (skk-context-appendix sc)))
(begin
(skk-context-set-head! sc
(append (skk-context-appendix sc)
(skk-context-head sc)))
(skk-reset-dcomp-word sc)))
(skk-context-set-okuri! sc '())
(skk-context-set-appendix! sc '())))
(eskk (lambda (sc)
(let ((x (skk-context-okuri-head sc))
(rkc (skk-context-rk-context sc)))
(rk-push-key! rkc x)
(skk-context-set-okuri! sc '())
(skk-context-set-state! sc 'skk-state-okuri))))
(eskk? (lambda (sc)
(and (not (null? (skk-context-okuri sc)))
(not (member (skk-context-okuri-head sc)
'("a" "e" "i" "o" "u")))))))
(skk-reset-candidate-window sc)
(cond ((eskk? sc) (eskk sc))
(#t (skk sc))))
;; don't clear dcomp (not compatible with ddskk's behavior)
;;(skk-reset-dcomp-word sc )
(skk-context-set-nr-candidates! sc 0)))
@hchbaw
Copy link
Author

hchbaw commented Jun 19, 2010

タイポしてました tyru さんごめんなさいごめんなさいm(__)m

@tyru
Copy link

tyru commented Jun 19, 2010

w

@tyru
Copy link

tyru commented Jun 19, 2010

これは素晴らしい。
というよりuim-skkってSchemeで挙動を変えられたりしたんですねー。
一度見てみる必要があるかも。 >uim-skk

@hchbaw
Copy link
Author

hchbaw commented Jun 21, 2010

こんにちわっ!

おぎょうぎが悪いのですけれども、~/.uim に

(require-module "skk")
;; この gist をペーストするか、もしくは
(load "/path/to/skk.scm");; この gist を読み込む

とすると動くと思います。
/usr/share/uim/skk.scmskk-back-to-kanji-state が上書きされますので注意が必要です。

@hchbaw
Copy link
Author

hchbaw commented Jun 21, 2010

/usr/share/uim/skk.scm で定義されている skk-back-to-kanji-state をこの gist の定義で上書きして下さいませ。

といったほうがわかりやすいかも><

@tyru
Copy link

tyru commented Jun 21, 2010

おおー!ありがとうございます。
僕もついにuim-skkを常用することに決めたので、このスクリプトのお世話になると思いますw

@tyru
Copy link

tyru commented Jun 23, 2010

最新版ではg:eskk_revert_henkan_styleのそれぞれの値は次のように変更になってます。
"eskk" => "okuri-one"
"aquaskk" => "delete-okuri"
"skk" => "concat-okuri"
また最新版では"okuri"という値がデフォルトになっていて、これは「▼書く」を「▽か*く」にします。
このままスペースで変換もできます。
送り仮名の部分だけやり直して編集したい人は"okuri-one"の挙動も便利だと思います。

@hchbaw
Copy link
Author

hchbaw commented Jun 23, 2010

教えていただきありがとうございます!

"okuri-one" の大ファンです、そして "okuri" もよいですね。
他にも選択肢があって至れり尽くせり!嬉しいです。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment