Emacs: xah-insert-unicode 🚀

By Xah Lee. Date: .

here's a command that lets you insert your own set of unicode characters via a completion.

put this in your Emacs Init File:

(defvar xah-unicode-list
    ("bullet •")
    ("right arrow →")
    ("white diamong ◇")
    ("black diamond ◆")
    ("...ellipsis …")
    ("nbsp  ")
    ("chinese comma 、")
    ("-emdash —")
    ("fullwidth ampersand &")
    ("down arrow ↓")
    ("left arrow ←")
    ("up arrow ↑")
    ("thumb up 👍"))
  "A list of strings used by `xah-insert-unicode'.
each item is a string.
The first part of string before last space, is used as name of a unicode char, the last part before last space, is the unicode Unicode character to insert. (can be more than 1 char).")

(defun xah-insert-unicode ()
  "Insert a unicode from a custom list `xah-unicode-list'.
URL `http://xahlee.info/emacs/emacs/emacs_insert_unicode.html'
Version: 2021-01-05 2022-04-07 2022-10-30"
  (let (($str
          "Insert:" xah-unicode-list)))
    (insert (car (last (split-string $str " " t))))))