๐ nerdfont.vim
November 9, 2024 ยท View on GitHub
A simplified version of vim-devicons which does NOT provide any 3rd party integrations in itself. In otherwords, it is a fundemental plugin to handle Nerd Fonts from Vim.
With fern.vim + fern-renderer-nerdfont.vim. All glyphs above were powered by this plugin
Usage
First of all, make sure one of Nerd Fonts is used in your Vim.
After that, use nerdfont#find() function to find a glyph for the current filetype like:
echo nerdfont#find()
๎
Or specify a path to find a glyph for a particular path like:
echo nerdfont#find(expand('~/.vimrc'))
๎ซ
echo nerdfont#find(expand('~/.vim'))
๎
Above automatically check if the specified path is directory. To avoid that, specify the second argument to tell if the path is directory or not like:
echo nerdfont#find(expand('~/.vimrc'), 0)
๎ซ
echo nerdfont#find(expand('~/.vimrc'), 1)
๎
See :help nerdfont-function to find glyphs for directory, fileformat, platform, etc.
Contribution
If you would like to add new glyph/filetype supports, see the following files
| If | Where |
|---|---|
Want to add new extension (e.g. .js) | assets/json/extension.json |
Want to add new exact name (e.g. Makefile) | assets/json/basename.json |
Want to add new complex pattern (e.g. .*/bin/.*$) | assets/json/pattern.json |
Integrations
See Integration section of Wiki.
License
The glyph mappings has copied from vim-devicons thus the part follow the license of vim-devicons (LICENSE.vim-devicons). Other parts are MIT license explained in LICENSE.