nvim: add support for “nerdfonts”
This commit is contained in:
parent
d03d96a9fb
commit
8094dd8c18
|
@ -106,4 +106,12 @@ function M.get_hl_hex(hl_group)
|
||||||
return hl_hex
|
return hl_hex
|
||||||
end
|
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
|
return M
|
||||||
|
|
|
@ -83,9 +83,19 @@ require('packer').startup(function(use)
|
||||||
}
|
}
|
||||||
use {
|
use {
|
||||||
'https://github.com/kyazdani42/nvim-tree.lua',
|
'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
|
-- coding
|
||||||
use {
|
use {
|
||||||
|
|
|
@ -36,6 +36,8 @@ map('n', '<Leader>tm', t_builtin.man_pages, 'Man pages')
|
||||||
map('n', '<Leader>tr', t_builtin.registers, 'Registers')
|
map('n', '<Leader>tr', t_builtin.registers, 'Registers')
|
||||||
map('n', '<Leader>tp', telescope.extensions.projects.projects, 'Projects')
|
map('n', '<Leader>tp', telescope.extensions.projects.projects, 'Projects')
|
||||||
|
|
||||||
|
local nerdfont_installed = require('my.functions').nerdfont_installed()
|
||||||
|
|
||||||
require("nvim-tree").setup({
|
require("nvim-tree").setup({
|
||||||
filters = {
|
filters = {
|
||||||
dotfiles = false
|
dotfiles = false
|
||||||
|
@ -49,10 +51,10 @@ require("nvim-tree").setup({
|
||||||
renderer = {
|
renderer = {
|
||||||
icons = {
|
icons = {
|
||||||
show = {
|
show = {
|
||||||
file = false,
|
file = nerdfont_installed,
|
||||||
folder = false,
|
folder = nerdfont_installed,
|
||||||
folder_arrow = false,
|
folder_arrow = nerdfont_installed,
|
||||||
git = false
|
git = nerdfont_installed
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -70,9 +72,10 @@ require('lualine').setup({
|
||||||
},
|
},
|
||||||
sections = {
|
sections = {
|
||||||
lualine_a = { 'mode' },
|
lualine_a = { 'mode' },
|
||||||
lualine_b = { 'branch', { 'diagnostics', icons_enabled = false } },
|
lualine_b = { 'branch',
|
||||||
|
{ 'diagnostics', icons_enabled = nerdfont_installed } },
|
||||||
lualine_c = { { 'filename', path = 1 } },
|
lualine_c = { { 'filename', path = 1 } },
|
||||||
lualine_x = { { 'filetype', icons_enabled = false } },
|
lualine_x = { { 'filetype', icons_enabled = nerdfont_installed } },
|
||||||
lualine_y = { 'progress' },
|
lualine_y = { 'progress' },
|
||||||
lualine_z = { 'location' }
|
lualine_z = { 'location' }
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in New Issue
Block a user