Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: split tables into individual files #550

Merged
merged 19 commits into from
Jan 26, 2025
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .luacheckrc
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ read_globals = {
"MiniAlign",
}

files["lua/nvim-web-devicons/icons-*.lua"].max_line_length = 200
files["lua/nvim-web-devicons/*/icons_*.lua"].max_line_length = 200
2 changes: 1 addition & 1 deletion .styluaignore
Original file line number Diff line number Diff line change
@@ -1 +1 @@
lua/nvim-web-devicons/icons-*.lua
lua/nvim-web-devicons/*/icons_*.lua
4 changes: 2 additions & 2 deletions Makefile
alex-courtis marked this conversation as resolved.
Show resolved Hide resolved
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These are all present in CI and work.

CI could be consolidated at some point but not today.

Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ VIM_MINI_ALIGN_VERSION = 0.14.0
all: colors style-check lint filetypes

colors: vim-colortemplate mini-align
alex-courtis marked this conversation as resolved.
Show resolved Hide resolved
rm lua/nvim-web-devicons/icons-light.lua
cp lua/nvim-web-devicons/icons-default.lua lua/nvim-web-devicons/icons-light.lua
rm lua/nvim-web-devicons/light/icons_by_*.lua
cp lua/nvim-web-devicons/default/icons_by_*.lua lua/nvim-web-devicons/light/
nvim \
--clean \
--headless \
Expand Down
224 changes: 2 additions & 222 deletions lua/nvim-web-devicons.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ local M = {}
local icons, icons_by_filename, icons_by_file_extension, icons_by_operating_system
local icons_by_desktop_environment, icons_by_window_manager

local filetypes = require "nvim-web-devicons.filetypes"

local default_icon = {
icon = "",
color = "#6d8086",
Expand Down Expand Up @@ -101,228 +103,6 @@ local function refresh_icons()
icons[1] = default_icon
end

-- Map of filetypes -> icon names
local filetypes = {
["apl"] = "apl",
["asm"] = "asm",
["astro"] = "astro",
["avif"] = "avif",
["bash"] = "bash",
["bib"] = "bib",
["bicep"] = "bicep",
["bicepparam"] = "bicepparam",
["bqn"] = "bqn",
["bzl"] = "bzl",
["brewfile"] = "brewfile",
["blueprint"] = "blp",
["checkhealth"] = "checkhealth",
["commit"] = "commit_editmsg",
["copying"] = "copying",
["gemfile"] = "gemfile$",
["lesser"] = "copying.lesser",
["vagrantfile"] = "vagrantfile$",
["awk"] = "awk",
["bmp"] = "bmp",
["c"] = "c",
["cfg"] = "cfg",
["clojure"] = "clj",
["cmake"] = "cmake",
["cobol"] = "cobol",
["coffee"] = "coffee",
["conf"] = "conf",
["cp"] = "cp",
["cpp"] = "cpp",
["cr"] = "cr",
["cs"] = "cs",
["csh"] = "csh",
["cson"] = "cson",
["css"] = "css",
["csv"] = "csv",
["cuda"] = "cu",
["d"] = "d",
["dart"] = "dart",
["desktop"] = "desktop",
["diff"] = "diff",
["doc"] = "doc",
["docx"] = "docx",
["dockerfile"] = "dockerfile",
["dosbatch"] = "bat",
["dosini"] = "ini",
["dot"] = "dot",
["drools"] = "drl",
["dropbox"] = "dropbox",
["dump"] = "dump",
["eex"] = "eex",
["ejs"] = "ejs",
["elixir"] = "ex",
["elf"] = "elf",
["elm"] = "elm",
["epuppet"] = "epp",
["erlang"] = "erl",
["eruby"] = "erb",
["fennel"] = "fnl",
["fish"] = "fish",
["forth"] = "fs",
["fortran"] = "f90",
["fsharp"] = "f#",
["fsi"] = "fsi",
["fsscript"] = "fsscript",
["fsx"] = "fsx",
["gd"] = "gd",
["gif"] = "gif",
["git"] = "git",
["gitconfig"] = ".gitconfig",
["gitcommit"] = "commit_editmsg",
["gitignore"] = ".gitignore",
["gitattributes"] = ".gitattributes",
["glb"] = "glb",
["go"] = "go",
["godot"] = "godot",
["graphql"] = "graphql",
["groovy"] = "groovy",
["gql"] = "gql",
["gruntfile"] = "gruntfile",
["gtkrc"] = "gtkrc",
["gulpfile"] = "gulpfile",
["haml"] = "haml",
["haxe"] = "hx",
["haskell"] = "hs",
["hbs"] = "hbs",
["heex"] = "heex",
["hex"] = "hex",
["html"] = "html",
["ico"] = "ico",
["idlang"] = "pro",
["ino"] = "ino",
["import"] = "import",
["ipynb"] = "ipynb",
["java"] = "java",
["javascript"] = "js",
["javascript.jsx"] = "jsx",
["javascriptreact"] = "jsx",
["jpeg"] = "jpeg",
["jpg"] = "jpg",
["json"] = "json",
["jsonc"] = "jsonc",
["json5"] = "json5",
["julia"] = "jl",
["kotlin"] = "kt",
["leex"] = "leex",
["less"] = "less",
["liquid"] = "liquid",
["lhaskell"] = "lhs",
["license"] = "license",
["unlicense"] = "unlicense",
["log"] = "log",
["lock"] = "lock",
["lprolog"] = "sig",
["lua"] = "lua",
["luau"] = "luau",
["make"] = "makefile",
["markdown"] = "markdown",
["material"] = "material",
["mdx"] = "mdx",
["mint"] = "mint",
["mojo"] = "mojo",
["motoko"] = "mo",
["mustache"] = "mustache",
["nim"] = "nim",
["nix"] = "nix",
["nu"] = "nu",
["node"] = "node_modules",
["obj"] = "obj",
["ocaml"] = "ml",
["odin"] = "odin",
["openscad"] = "scad",
["opus"] = "opus",
["otf"] = "otf",
["pck"] = "pck",
["pdf"] = "pdf",
["perl"] = "pl",
["php"] = "php",
["plaintex"] = "tex",
["png"] = "png",
["po"] = "po",
["postscr"] = "ai",
["ppt"] = "ppt",
["prisma"] = "prisma",
["procfile"] = "procfile",
["prolog"] = "pro",
["ps1"] = "ps1",
["psd1"] = "psd1",
["psm1"] = "psm1",
["psb"] = "psb",
["psd"] = "psd",
["puppet"] = "pp",
["pyc"] = "pyc",
["pyd"] = "pyd",
["pyo"] = "pyo",
["python"] = "py",
["qml"] = "qml",
["query"] = "query",
["r"] = "r",
["res"] = "rescript",
["resi"] = "rescript",
["rlib"] = "rlib",
["rmd"] = "rmd",
["rproj"] = "rproj",
["ruby"] = "rb",
["rust"] = "rs",
["sass"] = "sass",
["sbt"] = "sbt",
["scala"] = "scala",
["scheme"] = "scm",
["scss"] = "scss",
["sh"] = "sh",
["slim"] = "slim",
["sln"] = "sln",
["sml"] = "sml",
["solidity"] = "sol",
["sql"] = "sql",
["sqlite"] = "sqlite",
["sqlite3"] = "sqlite3",
["srt"] = "srt",
["ssa"] = "ssa",
["stp"] = "stp",
["styl"] = "styl",
["sublime"] = "sublime",
["suo"] = "suo",
["svelte"] = "svelte",
["svg"] = "svg",
["swift"] = "swift",
["systemverilog"] = "sv",
["tads"] = "t",
["tcl"] = "tcl",
["tf"] = "tf",
["templ"] = "templ",
["terminal"] = "terminal",
["tex"] = "tex",
["tmux"] = "tmux",
["toml"] = "toml",
["tres"] = "tres",
["tscn"] = "tscn",
["twig"] = "twig",
["txt"] = "txt",
["typescript"] = "ts",
["typescriptreact"] = "tsx",
["vala"] = "vala",
["verilog"] = "v",
["vhdl"] = "vhd",
["vim"] = "vim",
["vue"] = "vue",
["wasm"] = "wasm",
["webm"] = "webm",
["webp"] = "webp",
["webpack"] = "webpack",
["xcplayground"] = "xcplayground",
["xls"] = "xls",
["xlsx"] = "xlsx",
["xml"] = "xml",
["yaml"] = "yaml",
["zig"] = "zig",
["zsh"] = "zsh",
}

local function get_highlight_name(data)
if not global_opts.color_icons then
data = default_icon
Expand Down
10 changes: 10 additions & 0 deletions lua/nvim-web-devicons/default/icons_by_desktop_environment.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
return {
["budgie"] = { icon = "", color = "#4E5361", cterm_color = "240", name = "Budgie" },
["cinnamon"] = { icon = "", color = "#DC682E", cterm_color = "166", name = "Cinnamon" },
["gnome"] = { icon = "", color = "#FFFFFF", cterm_color = "231", name = "GNOME" },
["lxde"] = { icon = "", color = "#A4A4A4", cterm_color = "248", name = "LXDE" },
["lxqt"] = { icon = "", color = "#0191D2", cterm_color = "32", name = "LXQt" },
["mate"] = { icon = "", color = "#9BDA5C", cterm_color = "113", name = "MATE" },
["plasma"] = { icon = "", color = "#1B89F4", cterm_color = "33", name = "KDEPlasma" },
["xfce"] = { icon = "", color = "#00AADF", cterm_color = "74", name = "Xfce" },
}
Loading
Loading