-
sample configuration require("lualine").setup({
sections = {
lualine_a = {},
lualine_b = { "filetype" }, --full filetype
lualine_c = {
{
"filetype",
icon_only = true,
separator = "",
padding = { right = 0, left = 1 },
},
{ "filename", path = 1 },
}
lualine_x = {},
lualine_y = {},
lualine_z = {},
}
} ex. What this results on filetype |
Beta Was this translation helpful? Give feedback.
Answered by
fitrh
May 4, 2022
Replies: 1 comment 1 reply
-
You can use the {
'filetype',
fmt = function(str)
local icon = require('nvim-web-devicons')
if not icon.get_icon(vim.fn.expand('%:t'), vim.bo.filetype) then
-- or if you have the latest version of nvim-web-devicon
-- and don't care about buffer names
-- if not icon.get_icon_by_filetype(vim.bo.filetype) then
return nil
end
return str
end,
icon_only = true,
} |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
diegodox
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You can use the
fmt
option for that, but first, if you havenvim-web-devicons
configured, make sure you disable thedefault