Library for displaying VSCode icons in Emacs.
This library displays beautiful SVG icons adopted from modern VSCode extensions such as Microsoft's vscode-icons, VSCode Icons Team's vscode-icons, and Material Theme's vscode-material-icon-theme.
It improves existing packages like all-the-icons.el, nerd-icons.el, and vscode-icon-emacs by providing various original, pretty, and high-quality icons using SVG format. The other packages all-the-icons.el and nerd-icons.el only display single color icons while vscode-icon-emacs only display PNG icons, whose quality might be affected when being resized.
Below are some useful APIs to get icons:
vscode-icons-icon-for-file
vscode-icons-icon-for-dir
vscode-icons-icon-for-mode
vscode-icons-icon-for-imenu
vscode-icons-icon-for-buffer
Sample code to use the APIs to prepend the icon in front of a file name.
(defun prepend-file-icon (file-name)
"Prepend an icon in front of a file name."
(let* ((icon (if (file-directory-p file-name)
(or (vscode-icons-icon-for-dir file-name)
(vscode-icons-default-dir-icon))
(or (vscode-icons-icon-for-file file-name)
(vscode-icons-default-file-icon)))))
;; Return a new string which is prepended with the file icon.
(concat (propertize " " 'display icon) " " file-name)))
Illustration of integrating vscode-icons
into dired-mode
:
This package is inspired by the following projects:
- all-the-icons.el: Emacs library to display icons using various icon fonts.
- nerd-icons.el: Emacs library to display icons using Nerd fonts.
- vscode-icon-emacs: Emacs library to display VSCode icons in PNG format.
Icons are downloaded from these projects:
- vscode-icons: VSCode extension to the official Microsoft's VSCode icons.
- vscode-icons: VSCode extension to display VSCode Icons Team's icons.
- vscode-material-icon-theme: VSCode extension to display Material Theme icons.
- vscode-great-icons: VSCode Great Icons theme.
- bunker-icons: VSCode Bunker Icons theme.
- breeze-icons: KDE Breeze icon theme.
- papirus-icon-theme: Papirus icon theme.