show icon for fugitive window

This commit is contained in:
2022-03-23 12:57:16 +03:00
parent 8f242e5bd0
commit 3772a3cbe6

View File

@@ -1,4 +1,5 @@
local lualine = require("lualine")
local devicons = require("nvim-web-devicons")
local mode = {
"mode",
@@ -18,9 +19,15 @@ local diagnostics = {
local filename = {
function()
local filetype = vim.bo.filetype
local filename = vim.fn.expand("%:t")
local fileext = vim.fn.expand("%:e")
local icon = require("nvim-web-devicons").get_icon(filename, fileext)
local icon = devicons.get_icon(filename, fileext)
if filetype == "fugitive" then
icon = devicons.get_icons().git.icon
filename = "git"
end
if not icon then
return filename