Skip to main content
  1. Entry/

いまさらだけど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 "&quot;") (smartchr ’("&quot;!!'\&quot;&quot;</span> <span class="synConstant">&quot;\&quot;&quot;</span><span class="synSpecial">)))</span> <span class="synSpecial">(</span>local-set-key <span class="synSpecial">(</span>kbd <span class="synConstant">&quot;'&quot;</span><span class="synSpecial">)</span> <span class="synSpecial">(</span>smartchr <span class="synSpecial">'(</span><span class="synConstant">&quot;'!!’’" "’")))

(local-set-key (kbd ">") (smartchr ’(">" "->" ">>")))

(local-set-key (kbd "(") (smartchr ’("(!!')&quot;</span> <span class="synConstant">&quot;(&quot;</span><span class="synSpecial">)))</span> <span class="synSpecial">(</span>local-set-key <span class="synSpecial">(</span>kbd <span class="synConstant">&quot;{&quot;</span><span class="synSpecial">)</span> <span class="synSpecial">(</span>smartchr <span class="synSpecial">'(</span><span class="synConstant">&quot;{ !!’ }" "{\n!!'\n}&quot;</span> <span class="synConstant">&quot;{&quot;</span><span class="synSpecial">)))</span> <span class="synSpecial">(</span>local-set-key <span class="synSpecial">(</span>kbd <span class="synConstant">&quot;[&quot;</span><span class="synSpecial">)</span> <span class="synSpecial">(</span>smartchr <span class="synSpecial">'(</span><span class="synConstant">&quot;[!!’]" "["))) )

(add-hook php-mode-hook my-smartchr-setting) (add-hook javascript-mode-hook my-smartchr-setting) 本体は github にあります。404 · GitHub