nvim-lualine / lualine.nvim

A blazing fast and easy to configure neovim statusline plugin written in pure lua.
MIT License
6.26k stars 468 forks source link

Feat: Default filetype icon #1337

Open sanjapm opened 14 hours ago

sanjapm commented 14 hours ago

Requested feature

Option to set default filetype icon which is displayed if the opened file has no filetype icon

Motivation

Ensures consistency, all files get icons.

florianAriasu commented 14 hours ago

Hi! Assuming you use this plugin: nvim-web-devicons so to handle file icons, you will need to add a default icon configuration setup, for instance:

require('nvim-web-devicons').setup({
  override = {},
  default = true,  -- Enable default icon fallback
  default_icon = {
    icon = "📄",  -- Replace with any icon you like
    color = "#6d8086",  -- Icon color (optional)
    cterm_color = "65",  -- Terminal color code (optional)
    name = "Default"
  }
})
sanjapm commented 13 hours ago

I'm using Lazyvim, which uses mini.icons to handle file icons. I tried using the below configuration, but it did not work.

return {
  "echasnovski/mini.icons",
  opts = {
    default = { file = { glyph = "" } },
  },
}
florianAriasu commented 7 hours ago

Try this:

return {
  "echasnovski/mini.icons",
  opts = function(_, opts)
    opts.default = {
      file = { glyph = " " },
    }
  end,
}

lmk if it worked!

sanjapm commented 7 hours ago

It did not work unfortunately :(. Do you think I should open an issue in the mini.icons or LazyVim repo instead?

florianAriasu commented 7 hours ago

Yes, you could try this as well!

sanjapm commented 7 hours ago

Thanks for your help Ariasu! I'll keep this issue open until I get a fix.