In this video (time-linked, only a few seconds) the word
function is displayed as
f, but can still be edited so the underlying text remains as-is.
How can this be done in emacs? (using plugins or built in features).
Emacs Stack Exchange is a question and answer site for those using, extending or developing Emacs. It only takes a minute to sign up.Sign up to join this community
Prettify-symbols-mode comes with emacs; here's a blog post about it. You need to add the substitution to
To avoid having to set this manually, it can be enabled globally from your init file:
While the current answer is useful, this example shows how to set many characters at once and enable globally when in graphical mode.
(when local-cfg/use-prettify-symbols (add-hook 'rust-mode-hook (lambda () (setq prettify-symbols-alist '( ("fn" . ?ƒ) ("Fn" . ?𝘍) ("->" . ?→) ("=>" . ?⇒) (">=" . ?≥) ("<=" . ?≤) ("==" . ?≡) ("!=" . ?≢) (".." . ?‥) ("..." . ?…) ; ("*" . ?×) ; ("/" . ?÷) ) ) ) ) )