Documentation
¶
Overview ¶
Package icons picks a Nerd Font glyph for a file: a folder for a directory, the Go gopher's mark for a .go file, a picture for a PNG.
The glyphs live in the Private Use Area and draw only in a terminal whose font has them - a Nerd Font, or a terminal like Ghostty, Kitty or WezTerm that ships the symbols itself. Everywhere else they are empty boxes, which is why the editor has a setting to turn them off.
Every codepoint here was checked by name against a Nerd Fonts v3 font (glyph names are in each comment). Font Awesome's are the most stable across Nerd Fonts versions, so they carry the categories; the language marks come from the Seti and Devicons sets.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Icon ¶
Icon is one glyph and how to colour it.
The colour is a syntax class rather than a colour of its own, so icons take the light or dark palette with everything else instead of adding a palette a theme would have to match.
func For ¶
For returns the icon for a file called name, given what the caller knows about it. name may be a path; only its last element is looked at.
func ForBuffer ¶
ForBuffer is the icon for a buffer's name: its file's, a folder for a directory listing (named with a trailing separator), and a note for buffers like *scratch* that no file stands behind.
func ForCandidate ¶
ForCandidate is For for a completion candidate: a path, a directory when it ends in a separator, and "./" for the directory being listed.