Skip to content

Instantly share code, notes, and snippets.

@hchbaw
Last active December 15, 2015 00:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hchbaw/5174411 to your computer and use it in GitHub Desktop.
Save hchbaw/5174411 to your computer and use it in GitHub Desktop.
;; https://gist.github.com/deton/5138905
;; Thank you very much, deton!
;; tc-tbl を evil-digraphs-table-user と ~/.vim.tcode へ出力します。
(with-temp-buffer
(loop initially (progn
(load "tc-tbl.elc")
(insert "(setq evil-digraphs-table-user '("))
finally (progn
(insert "))")
(write-region (point-min) (point-max) "~/.evil.tcode")
(eval-buffer)
(erase-buffer))
for c in (string-to-list (mapconcat 'identity tcode-tbl ""))
for key = nil
when (characterp c)
unless (char-equal c ?■)
unless (char-equal c ? )
do (setq key (tcode-encode c))
when key
do (prin1 (cons (mapcar 'tcode-key-to-char key) c)
(current-buffer)))
(insert "digraphs ")
(mapc (lambda (table)
(pcase-let ((`((,char1 ,char2) . ,digraph) table))
(insert char1)
(insert char2)
(just-one-space)
(insert (format "%S" digraph))
(just-one-space)))
evil-digraphs-table-user)
(write-region (point-min) (1- (point-max)) "~/.vim.tcode"))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment