diff --git a/.github/workflows/quality.yaml b/.github/workflows/quality.yaml index 77049fd..ffcb9af 100644 --- a/.github/workflows/quality.yaml +++ b/.github/workflows/quality.yaml @@ -87,3 +87,29 @@ jobs: run: pnpm add -g prettier@3.1.0 - name: Check markdown formatting with prettier run: prettier --check . + + mapping-sync: + name: Mapping Sync Check + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Check mapping against upstream + run: | + curl -sL https://raw.githubusercontent.com/ya2s/nonicons/main/src/template/nonicon.json \ + | jq -S 'to_entries | map({key: (.key | sub("-16$"; "")), value: .value}) | from_entries' \ + > /tmp/upstream.json + + { + echo '---@type table' + echo 'local M = {' + jq -r 'to_entries | sort_by(.key) | .[] | " ['"'"'\(.key)'"'"'] = \(.value),"' /tmp/upstream.json + echo '}' + echo 'return M' + } > /tmp/expected.lua + + if ! diff -u lua/nonicons/mapping.lua /tmp/expected.lua; then + echo '' + echo '::warning::mapping.lua is out of sync with ya2s/nonicons upstream' + echo 'Run the sync script or update lua/nonicons/mapping.lua manually.' + exit 1 + fi diff --git a/doc/nonicons.nvim.txt b/doc/nonicons.nvim.txt index b10b13d..708ca00 100644 --- a/doc/nonicons.nvim.txt +++ b/doc/nonicons.nvim.txt @@ -19,14 +19,14 @@ REQUIREMENTS *nonicons-requirements* ============================================================================== SETUP *nonicons-setup* -Using lazy.nvim: >lua +Load nvim-web-devicons before nonicons.nvim. For example, with lazy.nvim: >lua { 'barrettruth/nonicons.nvim', dependencies = { 'nvim-tree/nvim-web-devicons' }, } < -The plugin applies overrides automatically via `plugin/nonicons.lua`. No -`setup()` call is needed. +The plugin works automatically with no configuration required. For +customization, see |nonicons-config|. ============================================================================== CONFIGURATION *nonicons-config* @@ -66,6 +66,10 @@ API *nonicons-api* ============================================================================== RECIPES *nonicons-recipes* +Plugins that call nvim-web-devicons functions (oil.nvim, telescope.nvim, +fzf-lua, etc.) pick up nonicons glyphs automatically. The recipes below are +for plugins that accept icon configuration directly. + lualine ~ >lua local get = require('nonicons').get @@ -127,13 +131,24 @@ oil.nvim ~ tables directly, which nonicons.nvim mutates on load. fzf-lua ~ - - No configuration needed. fzf-lua calls `get_icon()` from devicons, which - nonicons.nvim wraps automatically. +>lua + require('fzf-lua').setup({ + file_icon_padding = ' ', + }) +< telescope.nvim ~ +>lua + local get = require('nonicons').get - No configuration needed. telescope.nvim calls `get_icon()` from devicons. + require('telescope').setup({ + defaults = { + prompt_prefix = ' ' .. get('telescope') .. ' ', + selection_caret = ' > ', + entry_prefix = ' ', + }, + }) +< nvim-tree ~ >lua diff --git a/lua/nonicons/mapping.lua b/lua/nonicons/mapping.lua index 6e74952..dd22fd3 100644 --- a/lua/nonicons/mapping.lua +++ b/lua/nonicons/mapping.lua @@ -1,22 +1,40 @@ ---@type table local M = { + ['accessibility'] = 61995, + ['accessibility-inset'] = 62026, + ['agent'] = 62080, + ['ai-model'] = 62081, ['alert'] = 61697, + ['alert-fill'] = 62027, ['angular'] = 61698, + ['apps'] = 61996, ['archive'] = 61699, ['arrow-both'] = 61700, ['arrow-down'] = 61701, + ['arrow-down-left'] = 62028, + ['arrow-down-right'] = 62029, ['arrow-left'] = 61702, ['arrow-right'] = 61703, ['arrow-switch'] = 61704, ['arrow-up'] = 61705, + ['arrow-up-left'] = 62030, + ['arrow-up-right'] = 62031, + ['babel'] = 61989, ['backbone'] = 61706, ['beaker'] = 61707, ['bell'] = 61708, + ['bell-fill'] = 61997, ['bell-slash'] = 61709, + ['biome'] = 62078, + ['blocked'] = 61961, ['bold'] = 61710, ['book'] = 61711, ['bookmark'] = 61712, + ['bookmark-filled'] = 62082, ['bookmark-slash'] = 61713, + ['bookmark-slash-fill'] = 62083, + ['boolean-off'] = 62084, + ['boolean-on'] = 62085, ['briefcase'] = 61714, ['broadcast'] = 61715, ['browser'] = 61716, @@ -24,10 +42,14 @@ local M = { ['c'] = 61718, ['c-plusplus'] = 61719, ['c-sharp'] = 61720, + ['cache'] = 62032, ['calendar'] = 61721, + ['capacitor'] = 61993, ['check'] = 61722, ['check-circle'] = 61723, ['check-circle-fill'] = 61724, + ['checkbox'] = 62033, + ['checkbox-fill'] = 62086, ['checklist'] = 61725, ['chevron-down'] = 61726, ['chevron-left'] = 61727, @@ -35,118 +57,216 @@ local M = { ['chevron-up'] = 61729, ['circle'] = 61730, ['circle-slash'] = 61731, + ['class'] = 61952, ['clippy'] = 61732, ['clock'] = 61733, + ['clock-fill'] = 62034, + ['cloud'] = 61998, + ['cloud-offline'] = 61999, ['code'] = 61734, + ['code-of-conduct'] = 62000, ['code-review'] = 61735, ['code-square'] = 61736, + ['codescan'] = 61962, + ['codescan-checkmark'] = 61963, + ['codespaces'] = 61964, + ['columns'] = 61973, + ['command-palette'] = 62035, ['comment'] = 61737, + ['comment-ai'] = 62087, ['comment-discussion'] = 61738, + ['compose'] = 62088, + ['constant'] = 61953, ['container'] = 61739, + ['copilot'] = 62036, + ['copilot-error'] = 62037, + ['copilot-warning'] = 62038, + ['copy'] = 61984, ['cpu'] = 61740, ['credit-card'] = 61741, ['cross-reference'] = 61742, + ['crosshairs'] = 62089, ['css'] = 61743, ['dart'] = 61744, ['dash'] = 61745, ['database'] = 61746, + ['dependabot'] = 61965, ['desktop-download'] = 61747, ['device-camera'] = 61748, ['device-camera-video'] = 61749, ['device-desktop'] = 61750, ['device-mobile'] = 61751, + ['devices'] = 62051, + ['diamond'] = 61974, + ['dice'] = 62090, ['diff'] = 61752, ['diff-added'] = 61753, ['diff-ignored'] = 61754, ['diff-modified'] = 61755, ['diff-removed'] = 61756, ['diff-renamed'] = 61757, + ['discussion-closed'] = 62052, + ['discussion-duplicate'] = 62053, + ['discussion-outdated'] = 62054, ['docker'] = 61758, ['dot'] = 61759, ['dot-fill'] = 61760, ['download'] = 61761, + ['duplicate'] = 61966, + ['elixir'] = 61971, ['ellipsis'] = 61762, ['elm'] = 61763, + ['error'] = 62055, + ['eslint'] = 61981, + ['exclamation'] = 62091, ['eye'] = 61764, ['eye-closed'] = 61765, + ['feed-discussion'] = 62001, + ['feed-forked'] = 62002, + ['feed-heart'] = 62003, + ['feed-issue-closed'] = 62092, + ['feed-issue-draft'] = 62093, + ['feed-issue-open'] = 62094, + ['feed-issue-reopen'] = 62095, + ['feed-merged'] = 62004, + ['feed-person'] = 62005, + ['feed-plus'] = 62096, + ['feed-public'] = 62097, + ['feed-pull-request-closed'] = 62098, + ['feed-pull-request-draft'] = 62099, + ['feed-pull-request-open'] = 62100, + ['feed-repo'] = 62006, + ['feed-rocket'] = 62007, + ['feed-star'] = 62008, + ['feed-tag'] = 62009, + ['feed-trophy'] = 62010, + ['field'] = 61954, ['file'] = 61766, + ['file-added'] = 62039, ['file-badge'] = 61767, ['file-binary'] = 61768, + ['file-check'] = 62101, ['file-code'] = 61769, ['file-diff'] = 61770, ['file-directory'] = 61771, + ['file-directory-fill'] = 62011, + ['file-directory-open-fill'] = 62012, ['file-directory-outline'] = 61772, + ['file-directory-symlink'] = 62102, + ['file-media'] = 62103, + ['file-moved'] = 62040, + ['file-removed'] = 62041, ['file-submodule'] = 61773, ['file-symlink-file'] = 61774, ['file-zip'] = 61775, ['filter'] = 61776, + ['filter-remove'] = 62104, + ['fiscal-host'] = 62056, ['flame'] = 61777, + ['flowchart'] = 62105, + ['focus-center'] = 62106, ['fold'] = 61778, ['fold-down'] = 61779, ['fold-up'] = 61780, ['gear'] = 61781, ['gift'] = 61782, ['git-branch'] = 61783, + ['git-branch-check'] = 62107, ['git-commit'] = 61784, ['git-compare'] = 61785, ['git-merge'] = 61786, + ['git-merge-queue'] = 62042, ['git-pull-request'] = 61787, + ['git-pull-request-closed'] = 61975, + ['git-pull-request-draft'] = 61976, ['globe'] = 61788, ['go'] = 61789, + ['goal'] = 62057, ['grabber'] = 61790, ['graph'] = 61791, + ['graph-bar-horizontal'] = 62108, + ['graph-bar-vertical'] = 62109, + ['graphql'] = 61994, + ['hash'] = 61977, ['heading'] = 61792, ['heart'] = 61793, ['heart-fill'] = 61794, ['history'] = 61795, ['home'] = 61796, + ['home-fill'] = 62110, ['horizontal-rule'] = 61797, ['hourglass'] = 61798, ['html'] = 61799, ['hubot'] = 61800, + ['id-badge'] = 62013, ['image'] = 61801, ['inbox'] = 61802, + ['inbox-fill'] = 62111, ['infinity'] = 61803, ['info'] = 61804, + ['interface'] = 61955, + ['ionic'] = 61990, ['issue-closed'] = 61805, + ['issue-draft'] = 61978, ['issue-opened'] = 61806, ['issue-reopened'] = 61807, + ['issue-tracked-by'] = 62043, + ['issue-tracked-in'] = 62044, + ['issue-tracks'] = 62058, ['italic'] = 61808, + ['iterations'] = 62014, ['java'] = 61809, ['javascript'] = 61810, ['json'] = 61811, ['kebab-horizontal'] = 61812, ['key'] = 61813, + ['key-asterisk'] = 61985, + ['keyword'] = 61956, ['kotlin'] = 61814, ['kubernetes'] = 61815, ['law'] = 61816, + ['layout'] = 62059, ['light-bulb'] = 61817, ['link'] = 61818, ['link-external'] = 61819, ['list-ordered'] = 61820, ['list-unordered'] = 61821, + ['loading'] = 62060, ['location'] = 61822, ['lock'] = 61823, + ['log'] = 62015, ['logo-gist'] = 61824, ['logo-github'] = 61825, + ['loop'] = 62112, ['lua'] = 61826, ['mail'] = 61827, ['mark-github'] = 61828, ['markdown'] = 61829, + ['maximize'] = 62113, + ['mcp'] = 62114, ['megaphone'] = 61830, ['mention'] = 61831, ['meter'] = 61832, ['milestone'] = 61833, + ['minimize'] = 62115, ['mirror'] = 61834, ['moon'] = 61835, ['mortar-board'] = 61836, + ['move-to-bottom'] = 62061, + ['move-to-end'] = 62062, + ['move-to-start'] = 62063, + ['move-to-top'] = 62064, + ['multi-select'] = 61948, ['mute'] = 61837, + ['next'] = 61991, ['nginx'] = 61838, ['no-entry'] = 61839, ['node'] = 61840, ['north-star'] = 61841, + ['not-found'] = 62065, ['note'] = 61842, ['npm'] = 61843, + ['number'] = 61949, ['octoface'] = 61844, ['organization'] = 61845, ['package'] = 61846, @@ -154,34 +274,54 @@ local M = { ['package-dependents'] = 61848, ['paintbrush'] = 61849, ['paper-airplane'] = 61850, + ['paperclip'] = 62045, + ['passkey-fill'] = 62066, + ['paste'] = 61986, + ['pause'] = 62116, ['pencil'] = 61851, + ['pencil-ai'] = 62117, ['people'] = 61852, ['perl'] = 61853, ['person'] = 61854, + ['person-add'] = 61967, + ['person-fill'] = 62016, ['php'] = 61855, ['pin'] = 61856, + ['pin-slash'] = 62067, + ['pivot-column'] = 62118, ['play'] = 61857, ['plug'] = 61858, ['plus'] = 61859, ['plus-circle'] = 61860, + ['prettier'] = 61982, + ['prisma'] = 62046, ['project'] = 61861, + ['project-roadmap'] = 62047, + ['project-symlink'] = 62048, + ['project-template'] = 62068, ['pulse'] = 61862, ['python'] = 61863, ['question'] = 61864, ['quote'] = 61865, ['r'] = 61866, ['react'] = 61867, + ['read'] = 62069, ['rectangle'] = 61868, + ['redo'] = 62119, + ['rel-file-path'] = 62070, ['reply'] = 61869, ['repo'] = 61870, ['repo-clone'] = 61871, + ['repo-deleted'] = 62017, ['repo-forked'] = 61872, + ['repo-locked'] = 62018, ['repo-pull'] = 61873, ['repo-push'] = 61874, ['repo-template'] = 61875, ['report'] = 61876, ['require'] = 61877, ['rocket'] = 61878, + ['rows'] = 61979, ['rss'] = 61879, ['ruby'] = 61880, ['rust'] = 61881, @@ -189,52 +329,97 @@ local M = { ['screen-full'] = 61883, ['screen-normal'] = 61884, ['search'] = 61885, + ['select-single'] = 61980, ['server'] = 61886, ['share'] = 61887, ['share-android'] = 61888, ['shield'] = 61889, ['shield-check'] = 61890, ['shield-lock'] = 61891, + ['shield-slash'] = 62049, ['shield-x'] = 61892, + ['sidebar-collapse'] = 61968, + ['sidebar-expand'] = 61969, ['sign-in'] = 61893, ['sign-out'] = 61894, + ['single-select'] = 62019, ['skip'] = 61895, + ['skip-fill'] = 62050, + ['sliders'] = 62020, ['smiley'] = 61896, + ['smiley-frown'] = 62120, + ['smiley-frustrated'] = 62121, + ['smiley-grin'] = 62122, + ['smiley-neutral'] = 62123, + ['snippet'] = 61957, + ['sort-asc'] = 61987, + ['sort-desc'] = 61988, + ['space'] = 62124, + ['spacing-large'] = 62125, + ['spacing-medium'] = 62126, + ['spacing-small'] = 62127, + ['sparkle'] = 62128, + ['sparkle-fill'] = 62071, + ['sparkles-fill'] = 62129, + ['split-view'] = 62130, + ['sponsor-tiers'] = 62072, ['square'] = 61897, + ['square-circle'] = 62131, ['square-fill'] = 61898, ['squirrel'] = 61899, + ['stack'] = 62021, ['star'] = 61900, ['star-fill'] = 61901, ['stop'] = 61902, ['stopwatch'] = 61903, ['strikethrough'] = 61904, + ['struct'] = 61958, ['sun'] = 61905, + ['svelte'] = 61992, ['swift'] = 61906, ['sync'] = 61907, + ['tab'] = 62132, + ['tab-external'] = 62022, + ['table'] = 61970, ['tag'] = 61908, ['tasklist'] = 61909, ['telescope'] = 61910, + ['telescope-fill'] = 62023, + ['template'] = 62073, ['terminal'] = 61911, + ['terraform'] = 61972, ['three-bars'] = 61912, ['thumbsdown'] = 61913, ['thumbsup'] = 61914, ['tmux'] = 61915, ['toml'] = 61916, ['tools'] = 61917, + ['tracked-by-closed-completed'] = 62133, + ['tracked-by-closed-not-planned'] = 62134, + ['trash'] = 61950, ['trashcan'] = 61918, ['triangle-down'] = 61919, ['triangle-left'] = 61920, ['triangle-right'] = 61921, ['triangle-up'] = 61922, + ['trophy'] = 62024, + ['turborepo'] = 62079, + ['type'] = 61959, ['typescript'] = 61923, ['typography'] = 61924, + ['undo'] = 62135, ['unfold'] = 61925, + ['unlink'] = 62074, ['unlock'] = 61926, ['unmute'] = 61927, + ['unread'] = 62075, ['unverified'] = 61928, + ['unwrap'] = 62136, ['upload'] = 61929, + ['variable'] = 61960, ['verified'] = 61930, ['versions'] = 61931, + ['video'] = 61951, ['vim'] = 61932, ['vim-command-mode'] = 61933, ['vim-insert-mode'] = 61934, @@ -243,91 +428,18 @@ local M = { ['vim-select-mode'] = 61937, ['vim-terminal-mode'] = 61938, ['vim-visual-mode'] = 61939, + ['vscode'] = 61983, ['vue'] = 61940, + ['webhook'] = 62025, ['workflow'] = 61941, + ['wrap'] = 62137, ['x'] = 61942, ['x-circle'] = 61943, ['x-circle-fill'] = 61944, ['yaml'] = 61945, ['yarn'] = 61946, ['zap'] = 61947, - ['multi-select'] = 61948, - ['number'] = 61949, - ['trash'] = 61950, - ['video'] = 61951, - ['class'] = 61952, - ['constant'] = 61953, - ['field'] = 61954, - ['interface'] = 61955, - ['keyword'] = 61956, - ['snippet'] = 61957, - ['struct'] = 61958, - ['type'] = 61959, - ['variable'] = 61960, - ['blocked'] = 61961, - ['codescan'] = 61962, - ['codescan-checkmark'] = 61963, - ['codespaces'] = 61964, - ['dependabot'] = 61965, - ['duplicate'] = 61966, - ['person-add'] = 61967, - ['sidebar-collapse'] = 61968, - ['sidebar-expand'] = 61969, - ['table'] = 61970, - ['elixir'] = 61971, - ['terraform'] = 61972, - ['columns'] = 61973, - ['diamond'] = 61974, - ['git-pull-request-closed'] = 61975, - ['git-pull-request-draft'] = 61976, - ['hash'] = 61977, - ['issue-draft'] = 61978, - ['rows'] = 61979, - ['select-single'] = 61980, - ['eslint'] = 61981, - ['prettier'] = 61982, - ['vscode'] = 61983, - ['copy'] = 61984, - ['key-asterisk'] = 61985, - ['paste'] = 61986, - ['sort-asc'] = 61987, - ['sort-desc'] = 61988, - ['babel'] = 61989, - ['ionic'] = 61990, - ['next'] = 61991, - ['svelte'] = 61992, - ['capacitor'] = 61993, - ['graphql'] = 61994, - ['accessibility'] = 61995, - ['apps'] = 61996, - ['bell-fill'] = 61997, - ['cloud'] = 61998, - ['cloud-offline'] = 61999, - ['code-of-conduct'] = 62000, - ['feed-discussion'] = 62001, - ['feed-forked'] = 62002, - ['feed-heart'] = 62003, - ['feed-merged'] = 62004, - ['feed-person'] = 62005, - ['feed-repo'] = 62006, - ['feed-rocket'] = 62007, - ['feed-star'] = 62008, - ['feed-tag'] = 62009, - ['feed-trophy'] = 62010, - ['file-directory-fill'] = 62011, - ['file-directory-open-fill'] = 62012, - ['id-badge'] = 62013, - ['iterations'] = 62014, - ['log'] = 62015, - ['person-fill'] = 62016, - ['repo-deleted'] = 62017, - ['repo-locked'] = 62018, - ['single-select'] = 62019, - ['sliders'] = 62020, - ['stack'] = 62021, - ['tab-external'] = 62022, - ['telescope-fill'] = 62023, - ['trophy'] = 62024, - ['webhook'] = 62025, + ['zoom-in'] = 62076, + ['zoom-out'] = 62077, } return M