Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

lua `fork` of vim-web-devicons for neovim

NotificationsYou must be signed in to change notification settings

DaikyXendo/nvim-web-devicons

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 

Repository files navigation

791 file types supported (require Nerd Font >= 3.0.0)

Image

🛑🛑 Warning 🛑🛑

Installation

Plug'DaikyXendo/nvim-web-devicons'

or withpacker.nvim

use'DaikyXendo/nvim-web-devicons'

Usage

Setup

This adds all the highlight groups for the deviconsi.e. it callsvim.api.nvim_set_hl for all iconsthis might need to be re-called in aColorscheme to re-apply cleared highlightsif the color scheme changes

require'nvim-web-devicons'.setup {-- your personnal icons can go here (to override)-- you can specify color or cterm_color instead of specifying both of them-- DevIcon will be appended to `name`override= {zsh= {icon="",color="#428850",cterm_color="65",name="Zsh"        }    },-- globally enable different highlight colors per icon (default to true)-- if set to false all icons will have the default icon's colorcolor_icons=true,-- globally enable default icons (default to false)-- will get overriden by `get_icons` optiondefault=true,}

Get Icon

Get the icon for a given file by passing in thename, theextension and anoptional optionstable.The name is passed in to check for an exact match e.g..bashrc if there is no exact name match the extensionis used. Calls.setup() if it hasn't already ran.

require'nvim-web-devicons'.get_icon(filename,extension,options)

The optionaloptions argument can used to change how the plugin works the keys includedefault = <boolean>. If the default key is set to true this function will return a defaultif there is no matching icone.g.

require'nvim-web-devicons'.get_icon(filename,extension, {default=true })

You can check if the setup function was already called with:

require'nvim-web-devicons'.has_loaded()

Get icon and color code

get_icon_color differs fromget_icon only in the second return value.get_icon_cterm_color returns cterm color instead of gui colorget_icon returns icon and highlight name.If you want to get color code, you can use this function.

localicon,color=require'nvim-web-devicons'.get_icon_color("init.lua","lua")assert(icon=="")assert(color=="#51a0cf")

Get all icons

It is possible to get all of the registered icons with theget_icons() function:

require'nvim-web-devicons'.get_icons()

This can be useful for debugging purposes or for creating custom highlights for each icon.

Set an icon

You can override individual icons with theset_icon({...}) function:

require("nvim-web-devicons").set_icon {zsh= {icon="",color="#428850",cterm_color="65",name="Zsh"    }}

You can override the default icon with theset_default_icon(icon, color) function:

require("nvim-web-devicons").set_default_icon('','#6d8086')

Getting icons by filetype

You can get the icon and colors associated with a filetype using theby_filetype functions:

require("nvim-web-devicons").get_icon_by_filetype(filetype,opts)require("nvim-web-devicons").get_icon_colors_by_filetype(filetype,opts)require("nvim-web-devicons").get_icon_color_by_filetype(filetype,opts)require("nvim-web-devicons").get_icon_cterm_color_by_filetype(filetype,opts)

These functions are the same as their counterparts without the_by_filetype suffix, but they take a filetype instead of a name/extension.

You can also useget_icon_name_by_filetype(filetype) to get the icon name associated with the filetype.

About

lua `fork` of vim-web-devicons for neovim

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Lua98.7%
  • Shell1.1%
  • Vim Script0.2%

[8]ページ先頭

©2009-2025 Movatter.jp