LunarVim / Neovim-from-scratch

📚 A Neovim config designed from scratch to be understandable
https://www.chrisatmachine.com/
GNU General Public License v3.0
5.31k stars 1.18k forks source link

fix: change broken glyphs after Nerd Fonts v3.0.0 update #302

Closed AbheetChaudhary closed 1 year ago

AbheetChaudhary commented 1 year ago

fixes #301

Replace any broken glyph caused by the update with newer or similar looking ones.

Mention in README.md about the requirement of latest Nerd Fonts

BREAKING CHANGE: requires Nerd Fonts v3.0.0 or higher to be installed

Munzu commented 1 year ago

Thank you for this! Out of curiosity, how did you go about finding and replacing the missing glyphs?

AbheetChaudhary commented 1 year ago

Since there are only a few places where glyphs are used in this repo so I manually searched and replaced them. Most of the broken glyps were in alpha.lua and cmp.lua and some in other files here and there. Often they were used along with some text which provided context. I searched for keywords inspired from those texts at nerdfonts-cheat-sheet.

I also had a pretty good collection of useful glyphs and a large part of it was unaffected after the NerdFonts v3.0.0 update so that also helped. Here is that updated collection:

vim.g.use_nerd_icons = true
if vim.fn.has "mac" == 1 or vim.g.use_nerd_icons then
  -- elseif vim.fn.has "mac" == 1 then
  return {
    kind = {
      Text = "󰉿",
      Method = "󰆧",
      Function = "󰊕",
      Constructor = "",
      Field = " ",
      Variable = "󰀫",
      Class = "󰠱",
      Interface = "",
      Module = "",
      Property = "󰜢",
      Unit = "󰑭",
      Value = "󰎠",
      Enum = "",
      Keyword = "󰌋",
      Snippet = "",
      Color = "󰏘",
      File = "󰈙",
      Reference = "",
      Folder = "󰉋",
      EnumMember = "",
      Constant = "󰏿",
      Struct = "",
      Event = "",
      Operator = "󰆕",
      TypeParameter = " ",
      Misc = " ",
    },
    type = {
      Array = "",
      Number = "",
      String = "󱌯",
      Boolean = "",
      Object = "",
    },
    documents = {
      File = "",
      Files = "",
      Folder = "",
      OpenFolder = "",
    },
    git = {
      Add = "",
      Mod = "",
      Remove = "",
      Ignore = "",
      Rename = "",
      Diff = "",
      Repo = "",
      Octoface = "",
    },
    ui = {
      ArrowClosed = "",
      ArrowOpen = "",
      Lock = "",
      Circle = "",
      BigCircle = "",
      BigUnfilledCircle = "",
      Close = "",
      NewFile = "",
      Search = "",
      Lightbulb = "",
      Project = "",
      Dashboard = "",
      History = "",
      Comment = "",
      Bug = "",
      Code = "",
      Telescope = "",
      Gear = "",
      Package = "",
      List = "",
      SignIn = "",
      SignOut = "",
      Check = "",
      Fire = "",
      Note = "",
      BookMark = "",
      Pencil = "󰏫",
      ChevronRight = "",
      Table = "",
      Calendar = "",
      CloudDownload = "󰅢",
    },
    diagnostics = {
      Error = "",
      Warning = "",
      Information = "",
      Question = "",
      Hint = "󱩎",
    },
    misc = {
      Robot = "󱙺",
      Squirrel = "",
      Tag = "",
      Watch = "",
      Smiley = "",
      Package = "",
      CircuitBoard = "",
    },
  }
else
  return {
    kind = {
      Text = " ",
      Method = " ",
      Function = "󰊕 ",
      Constructor = " ",
      Field = " ",
      Variable = " ",
      Class = " ",
      Interface = " ",
      Module = " ",
      Property = " ",
      Unit = " ",
      Value = " ",
      Enum = " ",
      Keyword = " ",
      Snippet = " ",
      Color = " ",
      File = " ",
      Reference = " ",
      Folder = " ",
      EnumMember = " ",
      Constant = " ",
      Struct = " ",
      Event = " ",
      Operator = " ",
      TypeParameter = " ",
      Misc = " ",
    },
    type = {
      Array = " ",
      Number = " ",
      String = " ",
      Boolean = " ",
      Object = " ",
    },
    documents = {
      File = " ",
      Files = " ",
      Folder = " ",
      OpenFolder = " ",
    },
    git = {
      Add = " ",
      Mod = " ",
      Remove = " ",
      Ignore = " ",
      Rename = " ",
      Diff = " ",
      Repo = " ",
      Octoface = " ",
    },
    ui = {
      ArrowClosed = "",
      ArrowOpen = "",
      Lock = " ",
      Circle = " ",
      BigCircle = " ",
      BigUnfilledCircle = " ",
      Close = " ",
      NewFile = " ",
      Search = " ",
      Lightbulb = " ",
      Project = " ",
      Dashboard = " ",
      History = " ",
      Comment = " ",
      Bug = " ",
      Code = " ",
      Telescope = " ",
      Gear = " ",
      Package = " ",
      List = " ",
      SignIn = " ",
      SignOut = " ",
      NoteBook = " ",
      Check = " ",
      Fire = " ",
      Note = " ",
      BookMark = " ",
      Pencil = " ",
      ChevronRight = "",
      Table = " ",
      Calendar = " ",
      CloudDownload = " ",
    },
    diagnostics = {
      Error = " ",
      Warning = " ",
      Information = " ",
      Question = " ",
      Hint = " ",
    },
    misc = {
      Robot = " ",
      Squirrel = " ",
      Tag = " ",
      Watch = " ",
      Smiley = " ",
      Package = " ",
      CircuitBoard = " ",
    },
  }
end

If I remember correctly then at some point these were part of an icons.lua file in this repo.

gnmearacaun commented 1 year ago

Thanks @AbheetChaudhary this gives me the idea to update the gitsigns from the same NerdFonts cheatsheet you linked