Function: nerd-icons-insert

nerd-icons-insert is an interactive and natively compiled function defined in nerd-icons.el.

Signature

(nerd-icons-insert &optional ARG GLYPH-SET)

Documentation

Interactive icon insertion function.

When Prefix ARG is non-nil, insert the propertized icon. When GLYPH-SET is non-nil, limit the candidates to the icon set matching it.

Key Bindings

This command is not in any keymaps.

Source Code

;; Defined in /nix/store/yazcqi510kxs7jygyiirgf8qyg348f6p-emacs-packages-deps/share/emacs/site-lisp/elpa/nerd-icons-20260823.17/nerd-icons.el
;;;###autoload
(defun nerd-icons-insert (&optional arg glyph-set)
  "Interactive icon insertion function.
When Prefix ARG is non-nil, insert the propertized icon.
When GLYPH-SET is non-nil, limit the candidates to the icon set matching it."
  (interactive "P")
  (let* ((standard-output (current-buffer))
         (candidates (if glyph-set
                         (nerd-icons--read-candidates-for-glyph-set glyph-set)
                       (nerd-icons--read-candidates)))
         (prompt     (if glyph-set
                         (format "%s Icon: " (funcall (nerd-icons--glyph-set-name glyph-set)))
                       "Icon : "))
         (selection (completing-read prompt candidates nil t))
         (result    (cdr (assoc selection candidates))))

    (if arg (prin1 result) (insert result))))