From 08c076f228e5556c514c0f7a5187945b7a4c9e4b 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) (cherry picked from commit 56538b791d3354dd6a5af257be0bb3eaf52765bd) --- 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 53658033e..4e5ed1ed4 100644 --- a/lua/core/settings.lua +++ b/lua/core/settings.lua @@ -8,6 +8,10 @@ settings["use_ssh"] = true -- Set it to false if there are no need to format on save. settings["format_on_save"] = false +-- 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"] = {home .. "/format_disabled_dir_under_home"} @@ -76,8 +80,4 @@ settings["null_ls_deps"] = { "editorconfig_checker", "prettier", "rustfmt", "shfmt", "stylua", "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 f0ebe3d1e..4f252cdc1 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 3d5a6eabe..0c6e2ab94 100644 --- a/lua/modules/configs/ui/alpha.lua +++ b/lua/modules/configs/ui/alpha.lua @@ -74,7 +74,7 @@ return function() require("telescope").extensions.frecency.frecency() end, }), - button("space f o", " Recent File", leader, nil, { + button("space f o", "󰋚 Recent File", leader, nil, { noremap = true, silent = true, nowait = true, @@ -91,7 +91,7 @@ return function() require("telescope").extensions.projects.projects({}) end, }), - button("space f d", " File find", leader, nil, { + button("space f d", "󰈞 File find", leader, nil, { noremap = true, silent = true, nowait = true, @@ -122,13 +122,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 67e294973..17f9f726a 100644 --- a/lua/modules/configs/ui/lualine.lua +++ b/lua/modules/configs/ui/lualine.lua @@ -160,6 +160,7 @@ return function() error = icons.diagnostics.Error, warn = icons.diagnostics.Warning, info = icons.diagnostics.Information, + hint = icons.diagnostics.Hint_alt, }, }, }, 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 = "󰝤", }, }