开源软件名称(OpenSource Name):kyazdani42/nvim-web-devicons开源软件地址(OpenSource Url):https://github.com/kyazdani42/nvim-web-devicons开源编程语言(OpenSource Language):Lua 95.1%开源软件介绍(OpenSource Introduction):Nvim-web-deviconsA RequirementsInstallationPlug 'kyazdani42/nvim-web-devicons' UsageSetupThis adds all the highlight groups for the devicons
i.e. it calls 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 default icons (default to false)
-- will get overriden by `get_icons` option
default = true;
} Get IconGet the icon for a given file by passing in the require'nvim-web-devicons'.get_icon(filename, extension, options) The optional 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
local icon, color = require'nvim-web-devicons'.get_icon_color("init.lua", "lua")
assert(icon == "")
assert(color == "#51a0cf") Get all iconsIt is possible to get all of the registered icons with the require'nvim-web-devicons'.get_icons() This can be useful for debugging purposes or for creating custom highlights for each icon. Set an iconYou can override individual icons with the require("nvim-web-devicons").set_icon {
zsh = {
icon = "",
color = "#428850",
cterm_color = "65",
name = "Zsh"
}
} You can override the default icon with the require("nvim-web-devicons").set_default_icon('', '#6d8086') Getting icons by filetypeYou can get the icon and colors associated with a filetype using the 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 You can also use |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论