summary refs log tree commit diff
path: root/emacs
diff options
context:
space:
mode:
authornoa@gaiwan.org2024-06-18 20:37:08 +0000
committernoa@gaiwan.org2024-06-18 20:37:08 +0000
commit6d8fdb94082fb8bf1f0ed594b8765d9d9448be2f (patch)
tree2a48c8723b1c463e44323123a803f8afade27b36 /emacs
parent0e9a493c52c5010dc62280098fffa38ef5b1fd7d (diff)
Better emoji support
Diffstat (limited to 'emacs')
-rw-r--r--emacs/init.el11
1 files changed, 11 insertions, 0 deletions
diff --git a/emacs/init.el b/emacs/init.el
index 539c89a..eaaa328 100644
--- a/emacs/init.el
+++ b/emacs/init.el
@@ -917,6 +917,17 @@ The misspelled word is taken from OVERLAY.  WORD is the corrected word."
 ;; For some frustrating reason, emacs does not respect fontconfig font settings.  What this means in practice is that emacs by default draws cjk characters with the korean variant.  Luckily emacs has its own obscure and poorly documented way of doing things, so i can iterate over the relevant charsets and set the font specifically for those characters.
 (dolist (charset '(han cjk-misc))
   (set-fontset-font t charset (font-spec :family "Noto Sans CJK SC")))
+;; Similar to the above, we have to manually set the font we want to be used for emoji.  I like the cute style of the emoji in fsd emoji, but it doesn't have very good coverage, so we also set noto emoji as the backup.  Note that noto emoji is not the same as noto color emoji, which uses coloured emoji.  That's clearly against the vibe of this emacs!
+(set-fontset-font
+ t 'emoji (font-spec :family "FSD Emoji") nil 'prepend)
+(set-fontset-font
+ t 'emoji (font-spec :family "Noto Emoji") nil 'append)
+
+;; While we're here, let's set up emoji input.
+(use-package cape :ensure t)
+(add-to-list 'vertico-multiform-categories
+             '(cape-emoji grid indexed (vertico-grid-annotate . 6)))
+(global-set-key (kbd "C-.") #'cape-emoji)
 
 ;; Describe a key based on a string like "C-SPC"
 (defun describe-key-shortcut (shortcut)