From 4a8bc0ae164f3a84b2cfbc8a6a563183ec0ad028 Mon Sep 17 00:00:00 2001 From: Michael Olson Date: Fri, 5 Jul 2024 15:40:58 -0400 Subject: [PATCH] feat(icons): provide language specific icons in extras --- lua/lazyvim/plugins/extras/lang/docker.lua | 10 ++++++++++ lua/lazyvim/plugins/extras/lang/git.lua | 11 ++++++++++ lua/lazyvim/plugins/extras/lang/go.lua | 15 ++++++++++++++ lua/lazyvim/plugins/extras/lang/helm.lua | 10 ++++++++++ lua/lazyvim/plugins/extras/lang/terraform.lua | 10 ++++++++++ .../plugins/extras/lang/typescript.lua | 18 +++++++++++++++++ lua/lazyvim/plugins/extras/util/chezmoi.lua | 20 +++++++++++++++++++ lua/lazyvim/plugins/extras/util/dot.lua | 14 +++++++++++++ lua/lazyvim/plugins/extras/util/rest.lua | 10 ++++++++++ lua/lazyvim/plugins/ui.lua | 10 +++++++++- 10 files changed, 127 insertions(+), 1 deletion(-) diff --git a/lua/lazyvim/plugins/extras/lang/docker.lua b/lua/lazyvim/plugins/extras/lang/docker.lua index ea26b013..200e973e 100644 --- a/lua/lazyvim/plugins/extras/lang/docker.lua +++ b/lua/lazyvim/plugins/extras/lang/docker.lua @@ -41,4 +41,14 @@ return { }, }, }, + + -- Filetype icons + { + "echasnovski/mini.icons", + opts = { + file = { + ["docker-compose.yml"] = { glyph = "󰡨", hl = "MiniIconsBlue" }, + }, + }, + }, } diff --git a/lua/lazyvim/plugins/extras/lang/git.lua b/lua/lazyvim/plugins/extras/lang/git.lua index 0fc92c4d..48721354 100644 --- a/lua/lazyvim/plugins/extras/lang/git.lua +++ b/lua/lazyvim/plugins/extras/lang/git.lua @@ -19,4 +19,15 @@ return { table.insert(opts.sources, { name = "git" }) end, }, + + -- Filetype icons + { + "echasnovski/mini.icons", + opts = { + file = { + [".gitkeep"] = { glyph = "󰊢", hl = "MiniIconsGray" }, + [".keep"] = { glyph = "󰊢", hl = "MiniIconsGray" }, + }, + }, + }, } diff --git a/lua/lazyvim/plugins/extras/lang/go.lua b/lua/lazyvim/plugins/extras/lang/go.lua index 931f8df4..2df84ba2 100644 --- a/lua/lazyvim/plugins/extras/lang/go.lua +++ b/lua/lazyvim/plugins/extras/lang/go.lua @@ -137,4 +137,19 @@ return { }, }, }, + + -- Filetype icons + { + "echasnovski/mini.icons", + opts = { + file = { + [".go-version"] = { glyph = "", hl = "MiniIconsBlue" }, + }, + filetype = { + gomod = { glyph = "", hl = "MiniIconsAzure" }, + gosum = { glyph = "", hl = "MiniIconsCyan" }, + gotmpl = { glyph = "󰟓", hl = "MiniIconsGray" }, + }, + }, + }, } diff --git a/lua/lazyvim/plugins/extras/lang/helm.lua b/lua/lazyvim/plugins/extras/lang/helm.lua index 58d8bdc8..f6e66d37 100644 --- a/lua/lazyvim/plugins/extras/lang/helm.lua +++ b/lua/lazyvim/plugins/extras/lang/helm.lua @@ -31,4 +31,14 @@ return { }, }, }, + + -- Filetype icons + { + "echasnovski/mini.icons", + opts = { + filetype = { + helm = { glyph = "󰠳", hl = "MiniIconsBlue" }, + }, + }, + }, } diff --git a/lua/lazyvim/plugins/extras/lang/terraform.lua b/lua/lazyvim/plugins/extras/lang/terraform.lua index 5ab58f86..8ff32c6f 100644 --- a/lua/lazyvim/plugins/extras/lang/terraform.lua +++ b/lua/lazyvim/plugins/extras/lang/terraform.lua @@ -77,4 +77,14 @@ return { }, }, }, + + -- Filetype icons + { + "echasnovski/mini.icons", + opts = { + filetype = { + tf = { glyph = "󱁢", hl = "MiniIconsBlue" }, + }, + }, + }, } diff --git a/lua/lazyvim/plugins/extras/lang/typescript.lua b/lua/lazyvim/plugins/extras/lang/typescript.lua index 139c3086..71ec4604 100644 --- a/lua/lazyvim/plugins/extras/lang/typescript.lua +++ b/lua/lazyvim/plugins/extras/lang/typescript.lua @@ -248,4 +248,22 @@ return { end end, }, + + -- Filetype icons + { + "echasnovski/mini.icons", + opts = { + file = { + [".eslintrc.js"] = { glyph = "󰱺", hl = "MiniIconsYellow" }, + [".node-version"] = { glyph = "", hl = "MiniIconsGreen" }, + [".prettierrc"] = { glyph = "", hl = "MiniIconsPurple" }, + [".yarnrc.yml"] = { glyph = "", hl = "MiniIconsBlue" }, + ["eslint.config.js"] = { glyph = "󰱺", hl = "MiniIconsYellow" }, + ["package.json"] = { glyph = "", hl = "MiniIconsGreen" }, + ["tsconfig.json"] = { glyph = "", hl = "MiniIconsAzure" }, + ["tsconfig.build.json"] = { glyph = "", hl = "MiniIconsAzure" }, + ["yarn.lock"] = { glyph = "", hl = "MiniIconsBlue" }, + }, + }, + }, } diff --git a/lua/lazyvim/plugins/extras/util/chezmoi.lua b/lua/lazyvim/plugins/extras/util/chezmoi.lua index 56518dfd..c5b19b9b 100644 --- a/lua/lazyvim/plugins/extras/util/chezmoi.lua +++ b/lua/lazyvim/plugins/extras/util/chezmoi.lua @@ -88,4 +88,24 @@ return { table.insert(opts.config.center, 5, projects) end, }, + + -- Filetype icons + { + "echasnovski/mini.icons", + opts = { + file = { + [".chezmoiignore"] = { glyph = "", hl = "MiniIconsGray" }, + [".chezmoiremove"] = { glyph = "", hl = "MiniIconsGray" }, + [".chezmoiroot"] = { glyph = "", hl = "MiniIconsGray" }, + [".chezmoiversion"] = { glyph = "", hl = "MiniIconsGray" }, + ["bash.tmpl"] = { glyph = "", hl = "MiniIconsGray" }, + ["json.tmpl"] = { glyph = "", hl = "MiniIconsGray" }, + ["ps1.tmpl"] = { glyph = "󰨊", hl = "MiniIconsGray" }, + ["sh.tmpl"] = { glyph = "", hl = "MiniIconsGray" }, + ["toml.tmpl"] = { glyph = "", hl = "MiniIconsGray" }, + ["yaml.tmpl"] = { glyph = "", hl = "MiniIconsGray" }, + ["zsh.tmpl"] = { glyph = "", hl = "MiniIconsGray" }, + }, + }, + }, } diff --git a/lua/lazyvim/plugins/extras/util/dot.lua b/lua/lazyvim/plugins/extras/util/dot.lua index ba2f627d..7f307ff7 100644 --- a/lua/lazyvim/plugins/extras/util/dot.lua +++ b/lua/lazyvim/plugins/extras/util/dot.lua @@ -60,4 +60,18 @@ return { end end, }, + + -- Filetype icons + { + "echasnovski/mini.icons", + opts = { + extension = { + bash = { glyph = "", hl = "MiniIconsGray" }, + zsh = { glyph = "", hl = "MiniIconsGray" }, + }, + filetype = { + dotenv = { glyph = "", hl = "MiniIconsYellow" }, + }, + }, + }, } diff --git a/lua/lazyvim/plugins/extras/util/rest.lua b/lua/lazyvim/plugins/extras/util/rest.lua index 61092ca6..7a7851c9 100644 --- a/lua/lazyvim/plugins/extras/util/rest.lua +++ b/lua/lazyvim/plugins/extras/util/rest.lua @@ -22,4 +22,14 @@ return { ensure_installed = { "http", "graphql" }, }, }, + + -- Filetype icons + { + "echasnovski/mini.icons", + opts = { + filetype = { + http = { glyph = "", hl = "MiniIconsRed" }, + }, + }, + }, } diff --git a/lua/lazyvim/plugins/ui.lua b/lua/lazyvim/plugins/ui.lua index 5fde7ebd..bc32dbdd 100644 --- a/lua/lazyvim/plugins/ui.lua +++ b/lua/lazyvim/plugins/ui.lua @@ -306,7 +306,15 @@ return { { "echasnovski/mini.icons", lazy = true, - opts = {}, + opts_extend = { "directory", "extension", "file", "filetype", "lsp", "os" }, + opts = { + file = { + [".gitkeep"] = { glyph = "󰊢", hl = "MiniIconsGray" }, + [".keep"] = { glyph = "󰊢", hl = "MiniIconsGray" }, + ["CODEOWNERS"] = { glyph = "", hl = "MiniIconsGreen" }, + ["devcontainer.json"] = { glyph = "", hl = "MiniIconsAzure" }, + }, + }, init = function() package.preload["nvim-web-devicons"] = function() require("mini.icons").mock_nvim_web_devicons()