Problem: the original ya2s/nvim-nonicons fork diverged enough that maintaining it as a fork was pointless. The set_icon() approach broke with modern nvim-web-devicons, and the extensions directory coupled integrations that belong in user config. Solution: from-scratch rewrite with function wrapping + table mutation override engine, vim.g.nonicons config pattern, vendored mapping with integer codepoints, health check, vimdoc with recipes, and no built-in plugin integrations.
29 lines
749 B
Lua
29 lines
749 B
Lua
local M = {}
|
|
|
|
function M.check()
|
|
vim.health.start('nonicons.nvim')
|
|
|
|
local ok, devicons = pcall(require, 'nvim-web-devicons')
|
|
if ok and devicons then
|
|
vim.health.ok('nvim-web-devicons available')
|
|
else
|
|
vim.health.error('nvim-web-devicons not found')
|
|
end
|
|
|
|
local result = vim.fn.system({ 'fc-list', ':family=nonicons' })
|
|
if result ~= '' then
|
|
vim.health.ok('nonicons font installed')
|
|
else
|
|
vim.health.warn('nonicons font not detected (fc-list :family=nonicons returned empty)')
|
|
end
|
|
|
|
local mapping = require('nonicons.mapping')
|
|
local count = vim.tbl_count(mapping)
|
|
if count > 0 then
|
|
vim.health.ok('mapping loaded (' .. count .. ' icons)')
|
|
else
|
|
vim.health.error('mapping table is empty')
|
|
end
|
|
end
|
|
|
|
return M
|