以åæ¥è¨ã§ãHTMLãããããéãã§æ¸ãã Emacs ã®ã¢ã¼ãã®æ§æ³ãã¨ãæ¸ããã®ã§ãããã¨ããããå½¢ã«ãªã£ãã®ã§ç´¹ä»ãã¾ããåã®Emacsã¢ã¼ã(æ£ç¢ºã«ã¯ãã¤ãã¼ã¢ã¼ãã§ãã)å¦å¥³ä½ã§ãã
å ¬éå ´æ
ããã¾ãåã㦠GitHub 使ãã¾ããã
ã¿ããªãããããããã¢ããã¤ã¹ãã ããã
æ³å®ãã¦ãã使ãæ¹ã
ã¡ã¸ã£ã¼ã¢ã¼ããããªãã®ã¯ãè²åãã¨ããã¤ã³ãã³ãã¨ããããããã®ã¯ä»ã®æããããã¢ã¼ãã«ä»»ãã¦ãã¾ããã¨è¨ãèãã§ãã
ãã§ãã£ã¦ãä¸ããææ¸æ§é ãèããå ´åããããæ¢ã«ããç¨åº¦æ§é ã決ã¾ã£ã¦ãã¦ãããã«æç« ãæµãè¾¼ãå ´åã®ãã¼ã¯ã¢ãããæå¼·ã«é«éã«è¡ãªãããã®æ©è½ãæä¾ããã¨ããæãã§ãã
ã¤ã³ã¹ãã¼ã«ã
elisp ã®ã¤ã³ã¹ãã¼ã«ãä¸ããæ¸ãããã¨æã£ãã®ã§ãããããã ãã§è¨äºã²ã¨ã¤ã«ãªãããã ã£ãã®ã§ãæ¶ã飲ãã§çç¥ãã¾ãã
# git clone git://github.com/tomoya/html-key-chord-mode.git
ã§ãªãã¸ããªãã¨ã³ãã¼ãã¦ãããããæ®éã«ãµã¤ããããã¦ã³ãã¼ããã¦ããããã©ãä¸çªæ©ãã®ã¯ãæç¶ install-elisp ã使ã£ã¦ãEmacs ããææ°ã®ãã¡ã¤ã«ãç´æ¥ã¤ã³ã¹ãã¼ã«ããã®ãæ©ãã¦æ¥½ã¡ãã§ãã
install-elisp ã¯ã¯ã¦ãªãã¼ã¯ã¼ãã«ããªã£ã¦ããã®ã§ããã¡ããåç
§ã
åãåãã¦ç¥ã£ããã©ãGitHub ããelispãç´æ¥ãã¦ã³ãã¼ãããã«ã¯ html-key-chord-mode.el ãéãã¦ãã½ã¼ã¹å³ä¸ã®ãrawãã¨ããã®ãçã®ãã¡ã¤ã«ã ã£ãã®ã§ã
M-x install-elisp http://github.com/tomoya/html-key-chord-mode/raw/87d07a285ee01a860336e093b86e17710f76a66b/html-key-chord-mode.el
ã¨ãã¦*1ãæ示ã«å¾ã£ã¦ C-c C-c ããã
ãã¨ãkey-chord.elã®åãååã«åãã¦ãããã¾ããxyzzy ããã® lisp 移æ¤ãç°¡åã«ãããã¨ãã試ã¿ãããxyzzy.elã¨ãã xyzzy ã®çµã¿è¾¼ã¿é¢æ°ã使ããæ§ã«ãããã®ãå¾®å¦ã«ä½ã£ã¦ä½¿ã£ã¦ããã®ã§ããããå¿
è¦ãã©ãèãã¦ãæåãã欲張ãéãã§ãã
M-x install-elisp-from-emacswiki http://www.emacswiki.org/emacs/key-chord.el M-x install-elisp http://github.com/tomoya/xyzzy.el/raw/f530bcf3ccd4160a055e0e36f421e21076591d76/xyzzy.el
ã¨ããæãã§ä¸¡æ¹å ¥ãã¦ããã¦ä¸ããã
è¨å®ã
.emacs ãªã©è¨å®ãã¡ã¤ã«ã«ã
(require 'key-chord) (require 'html-key-chord-mode)
ã§ãè¨å®å®äºã§ããã³ãã³ãã©ã¤ã³ã§èµ·åããã«ã¯ãM-x html-key-chord-mode ã§ãã
åã¯ãkey-chord å¨ãªã®ã§ã
(key-chord-define-global "hk" 'html-key-chord-mode)
ã¨ãã¦ãh + k ãã¼åææ¼ãã§ãå¼ã³åºããããã«ãã¦ãã¾ãããªããæ©è½ä¸ãå ¨ã¦ã®ãããã¡ã§å©ç¨ããã®ã¯ã誤çãå¤ãã®ã§ãªã¹ã¹ã¡ã§ãã¾ãã :p)
æ©è½ã
ç¾æç¹ã§ã¯å¤§ããåããã¨
- 対話çã«ãªã¼ã¸ã§ã³/è¡ããã¼ã¯ã¢ãããã
- ä¸ç¬ã§è¡ããã¼ã¯ã¢ãããã
ã®2ã¤ã®æ©è½ãããã¾ãã
対話çã«ãã¼ã¯ã¢ãã!
好ããªè¡ã§ C-c t ãæ¼ãã¨ããããããã¡ã§ã¿ã°ãèãããã®ã§ãå
¥åãã¦ã¨ã³ã¿ããã¨ããã®è¡ãå
¥åããã¿ã°ã§ãã¼ã¯ã¢ããããã¾ãã
ç¶ãã¦ããã¼ã¯ãã¦ãªã¼ã¸ã§ã³ãæå®ã㦠M-t ãæ¼ãã¨ãåããã¿ã°ãèãããã®ã§ãå
¥åãã¦ã¨ã³ã¿ãæ¼ãã¨ããªã¼ã¸ã§ã³ç¯å²ãã¿ã°ã§ãã¼ã¯ã¢ããããã¾ãã
ãã®ãã¼ãã¤ã³ãã¯ã
(define-key hkc-mode-map "\C-t" 'quote-line-by) ;; ã (define-key hkc-mode-map [(super t)] 'quote-region-by)
ã®æ§ã«å¤æ´å¯è½ã§ãããã§ãã£ã¦ããã®æ©è½ã¯ãã®ãããã® xyzzyç¨ ç¶ãã¯ã¢ãç¨ lispéã®ãã¯ãã§ãã
å ¥åãããã©ãã®ã§ãè¶ éã§ãã¯ã¢ã!!
ãã£ããããèãã¦ã¿ãæ©è½ã§ãkey-chord.el ã¨çµã¿åããããã¤ãã«ã¼ã½ã«ã®ããè¡ãæå®ãããã¿ã°ã§ãã¼ã¯ã¢ããããã®ã§ããã
ã¨ããããæ¨æºã§ããdl, dt, dd, ol, ul, li, th, tr, h1, h2, h3, h4, h5, h6, em, p, blockquoteãã®ã¿ã°ãç»é²ãã¦ãã£ã¦ãä¾ãã°ãdl ãåææ¼ã(key-chordã®è¨å®ããã¦ãªããã°ãããã©ã«ãã§0.05ç§ä»¥å
)ããã¨ããã®è¡ã dl ã§ãã¼ã¯ã¢ããããã¾ãã
p 㨠blockquote ã¯ã2æåã§ã¯ãªãã®ã§ãpã2度æ¼ããbq ãåææ¼ãã§ããã®è¡ããã¼ã¯ã¢ããããã¾ãã
ä»å¾ã
ã¨ãããããè¡ã¨ãªã¼ã¸ã§ã³ã®ã¿ã°ãåé¤ããé¢æ°ããå
¥ãã¦ããã¨ãã¿ã°ã®å
¥åãèãããã¨ãã«ã¿ã°ä¸è¦§ã表示ã㦠anything ã¨ããããã ã¨ãyasnippet ã¨çµã¿åãããã¨ä¾¿å©ããã ãã©é£ãããã
key-chord ã®æ¹ã¯ãããªããã©ã対話ã³ãã³ãã®æ¹ã¯å©ç¨ãããã¨ãããã®éã¨ãã®ãã¼ãºã«åããã¦ãè¨å®ã§ãªãã«ã©ã£ã¡ããªãã«ã§ãããã¨ãããã£ãæ¹ãããããã
ãã¨ãè¤æ°è¡ã«æ¸¡ã£ã¦ãåãã¿ã°ã§ä¸æ°ã«ãã¼ã¯ã¢ããããã¨ãããli ã¨ãããã®ã§ããã£ãã便å©ãããã®ãããããtable ãã¹ãã¼ã¹ã§åºåã£ã¦ããã¦ãæ£è¦è¡¨ç¾ã§ã¬ã£ã¨ã楽ã£ã¦è¨ã£ã¦ããã®ã§ããããåãå
¥ãããã
æå¾ã«ãIRC ã§è²ã
æãã¦ããã id:elim ã«çæè¬ã§ã :-)
*1:09-01-17ç¾å¨ã®ææ°ãã¡ã¤ã«ã§ãã