explaingit

ryanoasis/vim-devicons

5,805Vim ScriptAudience · developerComplexity · 2/5LicenseSetup · moderate

TLDR

A Vim and Neovim plugin that displays file-type icons next to filenames in file explorers, status bars, and other panels by mapping hundreds of file extensions to special characters in a patched Nerd Font.

Mindmap

mindmap
  root((vim-devicons))
    What it does
      Adds icons to Vim
      Maps extensions to chars
      Works in file trees
    Setup
      Install Nerd Font
      Configure terminal
      Load plugin last
    Integrations
      NERDTree explorer
      vim-airline status bar
      CtrlP file finder
      vim-startify dashboard
    Config
      Custom mappings
      Toggle features
      Help file
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

Things people build with this

USE CASE 1

Add file-type icons to your Vim or Neovim file explorer so you can instantly identify file types at a glance.

USE CASE 2

Make your Vim status bar show icons alongside filenames by integrating with vim-airline or lightline.

USE CASE 3

Add custom icon mappings for file extensions not already covered by the default set.

USE CASE 4

Create a visually enhanced Vim startup screen with file icons using vim-startify.

Tech stack

Vim ScriptNerd Fonts

Getting it running

Difficulty · moderate Time to first run · 30min

Requires installing a patched Nerd Font and configuring your terminal emulator to use it before icons will render correctly.

Use freely for any purpose including commercial use, as long as you keep the copyright notice.

In plain English

vim-devicons is a plugin for the Vim and Neovim text editors that adds small icons next to file and folder names. When you open a file tree panel, a fuzzy file finder, a status bar, or a startup screen inside Vim, this plugin makes each entry show a tiny icon representing its file type, such as a Python file, a JSON file, a folder, or a hidden configuration file like .gitignore. The icons are actually special characters from a patched font. To use the plugin, you first install a font from the Nerd Fonts project (or patch your own font) and configure your terminal or Vim to use it. Once the font is in place, the plugin maps hundreds of file extensions and known filenames to specific characters in that font, and those characters render as icons. The plugin integrates with a long list of other Vim plugins: NERDTree (a file explorer), vim-airline and lightline (status bar plugins), CtrlP and Denite (file finders), vim-startify (a startup dashboard), and several others. You install it last after your other plugins so that it can attach its icon-rendering logic to the ones already loaded. Configuration is done through Vim settings. You can change how icons look, add custom mappings for file types not already covered, and toggle specific features on or off. The plugin ships with a help file accessible via :help devicons. The project is MIT licensed, maintained on GitHub, and accepts community contributions. The same author also maintains the Nerd Fonts repository, which is the font set this plugin depends on.

Copy-paste prompts

Prompt 1
I'm setting up vim-devicons with NERDTree in Neovim. Show me exactly how to install a Nerd Font, configure my terminal to use it, and add the plugin to my init.vim so icons render correctly.
Prompt 2
Help me add custom file extension icon mappings to vim-devicons for file types that are not in the default set.
Prompt 3
My vim-devicons icons are showing as squares or question marks in my terminal. How do I diagnose and fix a font rendering issue?
Prompt 4
Show me how to configure vim-devicons to work with vim-airline so icons appear in my Vim status bar.
Prompt 5
How do I load vim-devicons last in my plugin list and why does load order matter for icons to work?
Open on GitHub → Explain another repo

← ryanoasis on gitmyhub — every repo by this author, as a profile.

Verify against the repo before relying on details.