add custom config for net-tree
This commit is contained in:
parent
95653c6526
commit
c516919105
5 changed files with 257 additions and 5 deletions
22
lua/custom/utils/init.lua
Normal file
22
lua/custom/utils/init.lua
Normal 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
|
||||
Loading…
Add table
Add a link
Reference in a new issue