From c2181ca89e0a143d92cda3cb21aeb2092cda0de6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=86=B7=E9=85=94=E9=96=91=E5=90=9F?= <50296129+Jint-lzxy@users.noreply.github.com> Date: Sun, 7 May 2023 12:24:48 +0800 Subject: [PATCH] fix(icons)!: update icon codepoints (#447) --- dots.tutor | 4 +- init.lua | 17 ++++ lua/core/settings.lua | 8 +- lua/modules/configs/completion/lsp.lua | 2 +- lua/modules/configs/tool/nvim-tree.lua | 8 +- lua/modules/configs/ui/alpha.lua | 8 +- lua/modules/configs/ui/lualine.lua | 1 + lua/modules/utils/icons.lua | 117 +++++++++++++------------ 8 files changed, 92 insertions(+), 73 deletions(-) diff --git a/dots.tutor b/dots.tutor index 3f899cc2f..3e14150f7 100644 --- a/dots.tutor +++ b/dots.tutor @@ -48,9 +48,9 @@ Back to the left window, the status line is showed at the bottom of the window. You will see different content under different conditions. It will looks like this if you switch to the right window and move cursor to the second line. ------------------------------------------------------------------------------- -|Normal|main|  autocmd |~/.config/nvim|utf-8|LF|1%|2:1| +|Normal|main| 󰅩 autocmd |~/.config/nvim|utf-8|LF|1%|2:1| ------------------------------------------------------------------------------- -" autocmd" indicates this line has a variable named "autocmd". So this part of +"󰅩 autocmd" indicates this line has a variable named "autocmd". So this part of status line will show you the context of your cursor position. This feature is based on lsp, so it is disabled if corresponding lsp is not attach to current buffer. diff --git a/init.lua b/init.lua index 15445091f..66fc38337 100644 --- a/init.lua +++ b/init.lua @@ -1,3 +1,20 @@ if not vim.g.vscode then require("core") + + -- Release note + vim.schedule(function() + vim.notify_once( + [[ +We've released version v3.0.0! +Visit https://github.com/ayamir/nvimdots/releases to see the release notes. +If you have icons that can't be rendered correctly (e.g., 𑨩 and � ) or icons with incorrect size, be sure to read this! + +To silence this message, remove it from `init.lua` at the config's root directory. + +To check the glyphs size, make sure the following icons are very close to the crosses but there is no overlap: +XXXXXXXXX +]], + vim.log.levels.WARN + ) + end) end diff --git a/lua/core/settings.lua b/lua/core/settings.lua index 468b525ce..9c96cb313 100644 --- a/lua/core/settings.lua +++ b/lua/core/settings.lua @@ -9,6 +9,10 @@ settings["use_ssh"] = true ---@type boolean settings["format_on_save"] = true +-- Set it to false if diagnostics virtual text is annoying for you +---@type boolean +settings["diagnostics_virtual_text"] = true + -- Set the format disabled directories here, files under these dirs won't be formatted on save. ---@type string[] settings["format_disabled_dirs"] = { @@ -89,8 +93,4 @@ settings["null_ls_deps"] = { "vint", } --- Set the inline_diagnostic_virtual_text to false if they are annoying for you ----@type boolean -settings["inline_diagnostic_virtual_text"] = true - return settings diff --git a/lua/modules/configs/completion/lsp.lua b/lua/modules/configs/completion/lsp.lua index d3bc425dc..ba36d8cdc 100644 --- a/lua/modules/configs/completion/lsp.lua +++ b/lua/modules/configs/completion/lsp.lua @@ -40,7 +40,7 @@ return function() vim.lsp.handlers["textDocument/publishDiagnostics"] = vim.lsp.with(vim.lsp.diagnostic.on_publish_diagnostics, { signs = true, underline = true, - virtual_text = require("core.settings").inline_diagnostic_virtual_text, + virtual_text = require("core.settings").diagnostics_virtual_text, -- set update_in_insert to false bacause it was enabled by lspsaga update_in_insert = false, }) diff --git a/lua/modules/configs/tool/nvim-tree.lua b/lua/modules/configs/tool/nvim-tree.lua index 2979c4a78..d903ee868 100644 --- a/lua/modules/configs/tool/nvim-tree.lua +++ b/lua/modules/configs/tool/nvim-tree.lua @@ -66,17 +66,17 @@ return function() git = true, }, padding = " ", - symlink_arrow = "  ", + symlink_arrow = " 󰁔 ", glyphs = { default = icons.documents.Default, -- symlink = icons.documents.Symlink, -- bookmark = icons.ui.Bookmark, git = { unstaged = icons.git.Mod_alt, - staged = icons.git.Add, -- + staged = icons.git.Add, --󰄬 unmerged = icons.git.Unmerged, - renamed = icons.git.Rename, -- - untracked = icons.git.Untracked, -- "ﲉ" + renamed = icons.git.Rename, --󰁔 + untracked = icons.git.Untracked, -- "󰞋" deleted = icons.git.Remove, -- ignored = icons.git.Ignore, --◌ }, diff --git a/lua/modules/configs/ui/alpha.lua b/lua/modules/configs/ui/alpha.lua index aad83724d..372213b14 100644 --- a/lua/modules/configs/ui/alpha.lua +++ b/lua/modules/configs/ui/alpha.lua @@ -77,7 +77,7 @@ return function() require("telescope").extensions.frecency.frecency() end, }), - button("space f e", " File history", leader, nil, { + button("space f e", "󰋚 File history", leader, nil, { noremap = true, silent = true, nowait = true, @@ -93,7 +93,7 @@ return function() require("telescope").extensions.projects.projects({}) end, }), - button("space f f", " File find", leader, nil, { + button("space f f", "󰈞 File find", leader, nil, { noremap = true, silent = true, nowait = true, @@ -124,13 +124,13 @@ return function() local stats = require("lazy").stats() local ms = (math.floor(stats.startuptime * 100 + 0.5) / 100) return "  Have Fun with neovim" - .. "  v" + .. " 󰀨 v" .. vim.version().major .. "." .. vim.version().minor .. "." .. vim.version().patch - .. "  " + .. " 󰂖 " .. stats.count .. " plugins in " .. ms diff --git a/lua/modules/configs/ui/lualine.lua b/lua/modules/configs/ui/lualine.lua index 6d84339ae..0d6a3096c 100644 --- a/lua/modules/configs/ui/lualine.lua +++ b/lua/modules/configs/ui/lualine.lua @@ -122,6 +122,7 @@ return function() error = icons.diagnostics.Error, warn = icons.diagnostics.Warning, info = icons.diagnostics.Information, + hint = icons.diagnostics.Hint_alt, }, }, { get_cwd }, diff --git a/lua/modules/utils/icons.lua b/lua/modules/utils/icons.lua index 3d5703e67..365143e4f 100644 --- a/lua/modules/utils/icons.lua +++ b/lua/modules/utils/icons.lua @@ -2,34 +2,34 @@ local icons = {} local data = { kind = { - Class = "ﴯ", - Color = "", - Constant = "", + Class = "󰠱", + Color = "󰏘", + Constant = "󰏿", Constructor = "", Enum = "", EnumMember = "", Event = "", - Field = "", - File = "", - Folder = "", - Function = "", + Field = "󰇽", + File = "󰈙", + Folder = "󰉋", + Function = "󰊕", Interface = "", - Keyword = "", - Method = "", + Keyword = "󰌋", + Method = "󰆧", Module = "", - Namespace = "", + Namespace = "󰌗", Number = "", - Operator = "", + Operator = "󰆕", Package = "", - Property = "ﰠ", + Property = "󰜢", Reference = "", Snippet = "", Struct = "", - Text = "", - TypeParameter = "", - Unit = "", + Text = "󰉿", + TypeParameter = "󰅲", Undefined = "", - Value = "", + Unit = "", + Value = "󰎠", Variable = "", -- ccls-specific icons. TypeAlias = "", @@ -38,18 +38,18 @@ local data = { Macro = "", }, type = { - Array = "", + Array = "󰅪", Boolean = "", - Null = "ﳠ", + Null = "󰟢", Number = "", - Object = "", - String = "", + Object = "󰅩", + String = "󰉿", }, documents = { Default = "", File = "", Files = "", - FileTree = "פּ", + FileTree = "󰙅", Import = "", Symlink = "", }, @@ -57,15 +57,15 @@ local data = { Add = "", Branch = "", Diff = "", - Git = "", + Git = "󰊢", Ignore = "", Mod = "M", Mod_alt = "", Remove = "", Rename = "", Repo = "", - Unmerged = "שׂ", - Untracked = "ﲉ", + Unmerged = "󰘬", + Untracked = "󰞋", Unstaged = "", Staged = "", Conflict = "", @@ -75,55 +75,55 @@ local data = { ArrowOpen = "", BigCircle = "", BigUnfilledCircle = "", - BookMark = "", + BookMark = "󰃃", Bug = "", Calendar = "", - Check = "", + Check = "󰄳", ChevronRight = "", Circle = "", - Close = "", + Close = "󰅖", Close_alt = "", CloudDownload = "", - Comment = "", - CodeAction = "", + Comment = "󰅺", + CodeAction = "󰌵", Dashboard = "", - Emoji = "", + Emoji = "󰱫", EmptyFolder = "", EmptyFolderOpen = "", - File = "", + File = "󰈤", Fire = "", Folder = "", FolderOpen = "", Gear = "", - History = "", - Incoming = "", + History = "󰄉", + Incoming = "󰏷", Indicator = "", Keyboard = "", Left = "", List = "", Square = "", SymlinkFolder = "", - Lock = "", + Lock = "󰍁", Modified = "✥", Modified_alt = "", NewFile = "", Newspaper = "", - Note = "", - Outgoing = "", + Note = "󰍨", + Outgoing = "󰏻", Package = "", - Pencil = "", - Perf = "", + Pencil = "󰏫", + Perf = "󰅒", Play = "", Project = "", Right = "", RootFolderOpened = "", - Search = "", + Search = "󰍉", Separator = "", - DoubleSeparator = "", + DoubleSeparator = "󰄾", SignIn = "", SignOut = "", Sort = "", - Spell = "暈", + Spell = "󰓆", Symlink = "", Table = "", Telescope = "", @@ -133,21 +133,21 @@ local data = { Warning = "", Information = "", Question = "", - Hint = "", + Hint = "󰌵", -- Holo version - Error_alt = "", - Warning_alt = "", + Error_alt = "󰅚", + Warning_alt = "󰀪", Information_alt = "", Question_alt = "", - Hint_alt = "", + Hint_alt = "󰌶", }, misc = { - Campass = "", + Campass = "󰀹", Code = "", - EscapeST = "✺", + EscapeST = "", Gavel = "", - Glass = "", - PyEnv = "", + Glass = "󰂖", + PyEnv = "󰌠", Squirrel = "", Tag = "", Tree = "", @@ -156,7 +156,7 @@ local data = { Vbar = "│", Add = "+", Added = "", - Ghost = "", + Ghost = "󰊠", ManUp = "", Vim = "", }, @@ -164,6 +164,7 @@ local data = { Codeium = "", TabNine = "", Copilot = "", + Copilot_alt = "", -- Add source-specific icons here buffer = "", cmp_tabnine = "", @@ -171,30 +172,30 @@ local data = { copilot = "", copilot_alt = "", latex_symbols = "", - luasnip = "", + luasnip = "󰃐", nvim_lsp = "", nvim_lua = "", orgmode = "", path = "", - spell = "暈", + spell = "󰓆", tmux = "", treesitter = "", undefined = "", }, dap = { - Breakpoint = "", - BreakpointCondition = "ﳁ", + Breakpoint = "󰝥", + BreakpointCondition = "󰟃", BreakpointRejected = "", LogPoint = "", Pause = "", Play = "", RunLast = "↻", StepBack = "", - StepInto = "", - StepOut = "", - StepOver = "", + StepInto = "󰆹", + StepOut = "󰆸", + StepOver = "󰆷", Stopped = "", - Terminate = "ﱢ", + Terminate = "󰝤", }, }