いまさらだけどsmartchr.elを入れてみた
(require ’smartchr)
(defun my-smartchr-setting () (local-set-key (kbd "=") (smartchr ’(" = " " == " "="))) (local-set-key (kbd "+") (smartchr ’(" + " "++" " += " "+"))) (local-set-key (kbd "-") (smartchr ’(" - " "–" " -= " "-")))
(local-set-key (kbd """) (smartchr ’(""!!'\""</span> <span class="synConstant">"\""</span><span class="synSpecial">)))</span> <span class="synSpecial">(</span>local-set-key <span class="synSpecial">(</span>kbd <span class="synConstant">"'"</span><span class="synSpecial">)</span> <span class="synSpecial">(</span>smartchr <span class="synSpecial">'(</span><span class="synConstant">"'
!!’’" "’")))
(local-set-key (kbd ">") (smartchr ’(">" "->" ">>")))
(local-set-key (kbd "(") (smartchr ’("(!!')"</span> <span class="synConstant">"("</span><span class="synSpecial">)))</span> <span class="synSpecial">(</span>local-set-key <span class="synSpecial">(</span>kbd <span class="synConstant">"{"</span><span class="synSpecial">)</span> <span class="synSpecial">(</span>smartchr <span class="synSpecial">'(</span><span class="synConstant">"{
!!’ }" "{\n!!'\n}"</span> <span class="synConstant">"{"</span><span class="synSpecial">)))</span> <span class="synSpecial">(</span>local-set-key <span class="synSpecial">(</span>kbd <span class="synConstant">"["</span><span class="synSpecial">)</span> <span class="synSpecial">(</span>smartchr <span class="synSpecial">'(</span><span class="synConstant">"[
!!’]" "[")))
)
(add-hook ’php-mode-hook ’my-smartchr-setting) (add-hook ’javascript-mode-hook ’my-smartchr-setting) 本体は github にあります。404 · GitHub