diff --git a/.config/nvim/lua/my/functions.lua b/.config/nvim/lua/my/functions.lua index 4397070..6c70b8c 100644 --- a/.config/nvim/lua/my/functions.lua +++ b/.config/nvim/lua/my/functions.lua @@ -106,4 +106,12 @@ function M.get_hl_hex(hl_group) return hl_hex end +-- return true if 'Symbols Nerd Font' is known to fontconfig +function M.nerdfont_installed() + if os.execute([[fc-list -q 'Symbols Nerd Font']]) == 0 then + return true + end + return false +end + return M diff --git a/.config/nvim/lua/my/plugins.lua b/.config/nvim/lua/my/plugins.lua index 35120ab..ded5080 100644 --- a/.config/nvim/lua/my/plugins.lua +++ b/.config/nvim/lua/my/plugins.lua @@ -83,9 +83,19 @@ require('packer').startup(function(use) } use { 'https://github.com/kyazdani42/nvim-tree.lua', - tag = '*' + tag = '*', + requires = { + 'https://github.com/ryanoasis/vim-devicons', + opt = true + } + } + use { + 'https://github.com/nvim-lualine/lualine.nvim', + requires = { + 'https://github.com/ryanoasis/vim-devicons', + opt = true + } } - use { 'https://github.com/nvim-lualine/lualine.nvim' } -- coding use { diff --git a/.config/nvim/lua/my/tools.lua b/.config/nvim/lua/my/tools.lua index 6d9aff0..111f297 100644 --- a/.config/nvim/lua/my/tools.lua +++ b/.config/nvim/lua/my/tools.lua @@ -36,6 +36,8 @@ map('n', 'tm', t_builtin.man_pages, 'Man pages') map('n', 'tr', t_builtin.registers, 'Registers') map('n', 'tp', telescope.extensions.projects.projects, 'Projects') +local nerdfont_installed = require('my.functions').nerdfont_installed() + require("nvim-tree").setup({ filters = { dotfiles = false @@ -49,10 +51,10 @@ require("nvim-tree").setup({ renderer = { icons = { show = { - file = false, - folder = false, - folder_arrow = false, - git = false + file = nerdfont_installed, + folder = nerdfont_installed, + folder_arrow = nerdfont_installed, + git = nerdfont_installed } } } @@ -70,9 +72,10 @@ require('lualine').setup({ }, sections = { lualine_a = { 'mode' }, - lualine_b = { 'branch', { 'diagnostics', icons_enabled = false } }, + lualine_b = { 'branch', + { 'diagnostics', icons_enabled = nerdfont_installed } }, lualine_c = { { 'filename', path = 1 } }, - lualine_x = { { 'filetype', icons_enabled = false } }, + lualine_x = { { 'filetype', icons_enabled = nerdfont_installed } }, lualine_y = { 'progress' }, lualine_z = { 'location' } },