add custom config for net-tree

This commit is contained in:
Schistos Tega 2024-05-30 16:19:17 +03:00
parent 95653c6526
commit c516919105
5 changed files with 257 additions and 5 deletions

22
lua/custom/utils/init.lua Normal file
View file

@ -0,0 +1,22 @@
local M = {}
function M.notify(msg, type, opts)
vim.schedule(function()
vim.notify(msg, type, opts)
end)
end
function M.get_icon(kind, padding, no_fallback)
if not vim.g.have_nerd_font and no_fallback then
return ''
end
local icon_pack = vim.g.have_nerd_font and 'icons' or 'text_icons'
if not M[icon_pack] then
M.icons = require 'custom.icons.nerd_font'
M.text_icons = require 'custom.icons.text'
end
local icon = M[icon_pack] and M[icon_pack][kind]
return icon and icon .. string.rep(' ', padding or 0) or ''
end
return M