diff --git a/config/nvim/lua/fschauen/diagnostic.lua b/config/nvim/lua/fschauen/diagnostic.lua index 614bb6b..1039019 100644 --- a/config/nvim/lua/fschauen/diagnostic.lua +++ b/config/nvim/lua/fschauen/diagnostic.lua @@ -1,5 +1,7 @@ local M = {} +local icons = require('fschauen.icons') + -- Show/navigate warning and errors by default. M.severity = vim.diagnostic.severity.WARN @@ -80,7 +82,7 @@ M.setup = function() underline = false, virtual_text = { spacing = 6, - prefix = '●', + prefix = icons.ui.Circle, severity = { min = M.severity, } @@ -91,14 +93,7 @@ M.setup = function() severity_sort = true, } - local signs = { - Error = ' ', - Warn = ' ', - Info = ' ', - Hint = ' ', - } - - for type, icon in pairs(signs) do + for type, icon in pairs(icons.diagnostics) do local hl = 'DiagnosticSign' .. type vim.fn.sign_define(hl, { text = icon, texthl = hl, numhl = hl }) end diff --git a/config/nvim/lua/fschauen/icons.lua b/config/nvim/lua/fschauen/icons.lua new file mode 100644 index 0000000..2a5f7e3 --- /dev/null +++ b/config/nvim/lua/fschauen/icons.lua @@ -0,0 +1,122 @@ +local M = {} + +M.diagnostics = { + Debug = ' ', + Error = ' ', + Hint = ' ', + Info = ' ', + Trace = '✎ ', + Warn = ' ', +} + +M.git = { + Branch = '󰘬', --  + file = { + Deleted = '✗', --  + Ignored = '◌', + Renamed = '➜', --  + Staged = '✓', -- S + Unmerged = '', --  + Unstaged = '✶', --  + Untracked = '', -- U + } +} + +-- Custom mix of lspkind defaults and VS Code codicons :) +M.kind = { + Array = ' ', + Boolean = ' ', + Class = ' ', + Color = ' ', + Constant = '󰏿 ', --  + Constructor = ' ', + Copilot = ' ', + Enum = ' ', --  + EnumMember = ' ', --  + Event = ' ', + Field = ' ', + File = ' ', + Folder = ' ', -- 󰉋 + Function = '󰊕 ', --  + Interface = ' ', + Key = ' ', + Keyword = ' ', + Method = ' ', + Module = ' ', + Namespace = ' ', + Null = ' ', -- 󰟢 + Number = ' ', + Object = ' ', + Operator = ' ', + Package = ' ', + Property = ' ', + Reference = ' ', --  + Snippet = ' ', + String = ' ', + Struct = ' ', + Text = ' ', + TypeParameter = ' ', + Unit = ' ', + Value = '󰎠 ', + Variable = '󰀫 ', --  +} + +M.modes = { + Normal = '', -- 'Normal ' 'n' + OperatorPending = '', -- 'O-Pend ' 'no' + NormalI = '', -- 'Normal ' 'ni' (normal via i_CTRL-O) + Visual = '󰒉', -- 'Visual ' 'v' + VisualBlock = '󰩭', -- 'V-Block' '' + Select = '󰒉', -- 'Select ' 's' + SelectBlock = '󰩭', -- 'S-Block' '' + Insert = '', -- 'Insert ' 'i' + Replace = '󰄾', -- 'Replace' 'r' + VirtualReplace = '󰶻', -- 'V-Repl ' 'rv' + Command = '', -- 'Command' 'c' + Ex = '', -- ' Ex ' 'cv' + modeore = '', -- ' modeore 'rm' (modeORE) + Confirm = '󰭚', -- 'Confirm' 'r?' (:confirm) + Shell = '', -- ' Shell ' '!' (external command executing) + Terminal = '', -- ' Term ' 't' +} + +M.ui = { + Attention = ' ', + Bug = ' ', --  + Checkmark = ' ', --  󰄬 󰄬  + ChevronDown = ' ', --  + ChevronLeft = ' ', --  + ChevronRight = ' ', --  + ChevronUp = ' ', --  + ChevronSmallDown = ' ', + ChevronSmallLeft = ' ', + ChevronSmallRight = ' ', + ChevronSmallUp = ' ', + Circle = '●', + EmptyFolder = ' ', + EmptyFolderOpen = ' ', + File = ' ', --  + FileSymlink = ' ', --  + Files = ' ', + Fire = ' ', --  + Folder = '󰉋 ', + FolderOpen = ' ', + FolderSymlink = ' ', + Gauge = '󰓅 ', --  + LineLeft = '▏', + LineLeftBold = '▎', + LineMiddle = '│', + LineMiddleBold = '┃', + Modified = ' ', + Note = ' ', --  + Paste = ' ', + Play = ' ', + ReadOnly = ' ', -- 'RO', + Search = ' ', --  + Sleep = '󰒲 ', + TestTube = '󰙨 ', -- 󰤑 + Warning = ' ', +} + +return M + diff --git a/config/nvim/lua/fschauen/plugins/completion.lua b/config/nvim/lua/fschauen/plugins/completion.lua index bf8f09a..5d04d92 100644 --- a/config/nvim/lua/fschauen/plugins/completion.lua +++ b/config/nvim/lua/fschauen/plugins/completion.lua @@ -89,44 +89,7 @@ M.config = function() path = '', }, - -- Custom mix of lspkind defaults and VS Code codicons :) - symbol_map = { - Array = '', - Boolean = '', - Class = '', - Color = '', - Constant = '󰏿', - Constructor = '', - Copilot = '', - Enum = '', - EnumMember = '', - Event = '', - Field = '', - File = '', - Folder = '', - Function = '󰊕', - Interface = '', - Key = '', - Keyword = '', - Method = '', - Module = '', - Namespace = '', - Null = '', - Number = '', - Object = '', - Operator = '', - Package = '', - Property = '', - Reference = '', - Snippet = '', - String = '', - Struct = '', - Text = '', - TypeParameter = '', - Unit = '', - Value = '󰎠', - Variable = '󰀫', - }, + symbol_map = require('fschauen.icons').kind, }, }, diff --git a/config/nvim/lua/fschauen/plugins/indent-blankline.lua b/config/nvim/lua/fschauen/plugins/indent-blankline.lua index a8395c6..f335999 100644 --- a/config/nvim/lua/fschauen/plugins/indent-blankline.lua +++ b/config/nvim/lua/fschauen/plugins/indent-blankline.lua @@ -1,13 +1,15 @@ local M = { 'lukas-reineke/indent-blankline.nvim' } +local icons = require('fschauen.icons') + M.config = function() require('ibl').setup { enabled = false, indent = { - char = '▏', + char = icons.ui.LineLeft, }, scope = { - char = '▎', + char = icons.ui.LineLeftBold, enabled = false, show_start = false, show_end = false, diff --git a/config/nvim/lua/fschauen/plugins/lualine.lua b/config/nvim/lua/fschauen/plugins/lualine.lua index 04c14ac..68519b9 100644 --- a/config/nvim/lua/fschauen/plugins/lualine.lua +++ b/config/nvim/lua/fschauen/plugins/lualine.lua @@ -1,8 +1,9 @@ +local M = { 'nvim-lualine/lualine.nvim' } + +local icons = require('fschauen.icons') local orange = '#d65d0e' local bright = '#ffffff' -- alternative: '#f9f5d7' -local M = { 'nvim-lualine/lualine.nvim' } - M.dependencies = { 'nvim-tree/nvim-web-devicons', } @@ -52,26 +53,26 @@ M.config = function() local C = require('lualine.component'):extend() C.map = { - ['n'] = '', -- 'Normal ', -- Normal - ['no'] = '', -- 'O-Pend ', -- Operator-pending - ['ni'] = '', -- 'Normal ', -- Normal via i_CTRL-O - ['v'] = '󰒉', -- 'Visual ', -- Visual by character - [''] = '󰩭', -- 'V-Block', -- Visual blockwise - ['s'] = '󰒉', -- 'Select ', -- Select by character - [''] = '󰩭', -- 'S-Block', -- Select blockwise - ['i'] = '', -- 'Insert ', -- Insert - ['r'] = '󰄾', -- 'Replace', -- Replace - ['rv'] = '󰶻', -- 'V-Repl ', -- Virtual Replace - ['c'] = '', -- 'Command', -- Command-line - ['cv'] = '', -- ' Ex ', -- Ex mode - ['rm'] = '', -- ' modeore ', -- -- modeORE -- - ['r?'] = '󰭚', -- 'Confirm', -- :confirm - ['!'] = '', -- ' Shell ', -- External command executing - ['t'] = '', -- ' Term ', -- Terminal + ['n'] = icons.modes.Normal, -- 'Normal ', -- Normal + ['no'] = icons.modes.OperatorPending, -- 'O-Pend ', -- Operator-pending + ['ni'] = icons.modes.NormalI, -- 'Normal ', -- Normal via i_CTRL-O + ['v'] = icons.modes.Visual, -- 'Visual ', -- Visual by character + [''] = icons.modes.VisualBlock, -- 'V-Block', -- Visual blockwise + ['s'] = icons.modes.Select, -- 'Select ', -- Select by character + [''] = icons.modes.SelectBlock, -- 'S-Block', -- Select blockwise + ['i'] = icons.modes.Insert, -- 'Insert ', -- Insert + ['r'] = icons.modes.Replace, -- 'Replace', -- Replace + ['rv'] = icons.modes.VirtualReplace, -- 'V-Repl ', -- Virtual Replace + ['c'] = icons.modes.Command, -- 'Command', -- Command-line + ['cv'] = icons.modes.Ex, -- ' Ex ', -- Ex mode + ['rm'] = icons.modes.modeore, -- ' modeore ', -- -- modeORE -- + ['r?'] = icons.modes.Cofirm, -- 'Confirm', -- :confirm + ['!'] = icons.modes.Shell, -- ' Shell ', -- External command executing + ['t'] = icons.modes.Term, -- ' Term ', -- Terminal } function C:update_status(is_focused) - if not is_focused then return ' 󰒲 ' end + if not is_focused then return ' ' .. icons.ui.Sleep end local code = vim.api.nvim_get_mode().mode:lower() local symbol = C.map[code:sub(1, 2)] or C.map[code:sub(1, 1)] or code @@ -102,7 +103,7 @@ M.config = function() if next(count) == nil then return '' end local denominator = count.total > count.maxcount and '' or string.format('%d', count.total) - return string.format(' %d/%s', count.current, denominator) + return string.format(icons.ui.Search .. '%d/%s', count.current, denominator) end return C @@ -142,7 +143,7 @@ M.config = function() local lineno = vim.fn.search(trailing, 'nwc') if lineno == 0 then return '' end - local result = ' ' .. lineno + local result = icons.ui.Attention .. lineno local total = vim.fn.searchcount({ pattern = trailing }).total if total > 1 then result = result .. string.format(' (%d total)', total) end @@ -157,9 +158,8 @@ M.config = function() end, } - local paste = { - colored_if_focused(function(has_focus) return has_focus and '' or ' ' end), + colored_if_focused(function(has_focus) return has_focus and icons.ui.Paste or ' ' end), color = { bg = orange, }, @@ -169,8 +169,8 @@ M.config = function() local status = { colored_if_focused(function(_) local status = '' - if vim.bo.modified then status = status .. '' end - if vim.bo.readonly or not vim.bo.modifiable then status = status .. 'RO' end + if vim.bo.modified then status = status .. icons.ui.Modified end + if vim.bo.readonly or not vim.bo.modifiable then status = status .. icons.ui.ReadOnly end return status end), color = { @@ -184,7 +184,7 @@ M.config = function() mode }, lualine_b = { - { 'branch', icon = '󰘬', cond = window.is_medium }, + { 'branch', icon = icons.git.Branch, cond = window.is_medium }, }, lualine_c = { filename, diff --git a/config/nvim/lua/fschauen/plugins/neogit.lua b/config/nvim/lua/fschauen/plugins/neogit.lua index b1a8af3..4b63301 100644 --- a/config/nvim/lua/fschauen/plugins/neogit.lua +++ b/config/nvim/lua/fschauen/plugins/neogit.lua @@ -9,12 +9,14 @@ M.keys = { } M.config = function() + local icons = require('fschauen.icons') + require('neogit').setup { disable_hint = true, signs = { - section = { '', '' }, - item = { '', '' }, - hunk = { '', '' }, + section = { icons.ui.Folder, icons.ui.EmptyFolderOpen }, + item = { icons.ui.ChevronRight, icons.ui.ChevronDown }, + hunk = { icons.ui.ChevronSmallRight, icons.ui.ChevronSmallDown }, }, mappings = { status = { diff --git a/config/nvim/lua/fschauen/plugins/nvim-tree.lua b/config/nvim/lua/fschauen/plugins/nvim-tree.lua index f5675b3..3d89b3c 100644 --- a/config/nvim/lua/fschauen/plugins/nvim-tree.lua +++ b/config/nvim/lua/fschauen/plugins/nvim-tree.lua @@ -11,6 +11,8 @@ M.keys = { } M.config = function() + local icons = require('fschauen.icons') + require('nvim-tree').setup { disable_netrw = true, -- replace netrw with nvim-tree hijack_cursor = true, -- keep the cursor on begin of the filename @@ -50,27 +52,27 @@ M.config = function() webdev_colors = false, -- highlight icons with NvimTreeFileIcon git_placement = 'signcolumn', glyphs = { - default = '', - symlink = '', - modified = '●', + default = icons.ui.File, + symlink = icons.ui.FileSymlink, + modified = icons.ui.Circle, folder = { - arrow_closed = '', --    - arrow_open = '', --    - default = '', --   - open = '', --   - empty = '', - empty_open = '', - symlink = '', - symlink_open = '', + arrow_closed = icons.ui.ChevronSmallRight, + arrow_open = icons.ui.ChevronSmallDown, + default = icons.ui.Folder, + open = icons.ui.FolderOpen, + empty = icons.ui.EmptyFolder, + empty_open = icons.ui.EmptyFolderOpen, + symlink = icons.ui.FolderSymlink, + symlink_open = icons.ui.FolderSymlink, }, git = { - untracked = '', - unstaged = '✶', - staged = '✓', - deleted = '✗', - unmerged = '', - renamed = '➜', - ignored = '◌', + untracked = icons.git.file.Untracked, + unstaged = icons.git.file.Unstaged, + staged = icons.git.file.Staged, + deleted = icons.git.file.Deleted, + unmerged = icons.git.file.Unmerged, + renamed = icons.git.file.Renamed, + ignored = icons.git.file.Ignored, }, }, }, diff --git a/config/nvim/lua/fschauen/plugins/telescope.lua b/config/nvim/lua/fschauen/plugins/telescope.lua index ecb3adb..888da03 100644 --- a/config/nvim/lua/fschauen/plugins/telescope.lua +++ b/config/nvim/lua/fschauen/plugins/telescope.lua @@ -118,6 +118,8 @@ M.keys = { { 'f', pickers.resume '󰐎 Resume' , desc = ' Telescope Resume ' }, } +local icons = require('fschauen.icons') + M.config = function() local actions = require('telescope.actions') local layout = require('telescope.actions.layout') @@ -143,10 +145,10 @@ M.config = function() n = mappings, }, - prompt_prefix = '  ', -- Alternatives:  ❯ - selection_caret = ' ', -- Alternatives:  ➔  + prompt_prefix = '  ', + selection_caret = icons.ui.Play, - multi_icon = '󰄬 ', -- Alternatives: 󰄬   + multi_icon = icons.ui.Checkmark, scroll_strategy = 'limit', -- Don't wrap around in results. dynamic_preview_title = true, diff --git a/config/nvim/lua/fschauen/plugins/todo-comments.lua b/config/nvim/lua/fschauen/plugins/todo-comments.lua index 55e50a0..6f08d09 100644 --- a/config/nvim/lua/fschauen/plugins/todo-comments.lua +++ b/config/nvim/lua/fschauen/plugins/todo-comments.lua @@ -14,16 +14,18 @@ M.keys = { { 'ft', 'TodoTelescope' }, } +local icons = require('fschauen.icons') + M.config = function() require('todo-comments').setup { keywords = { - TODO = { icon = '󰄬 ' }, - FIX = { icon = ' ' }, - HACK = { icon = ' ' }, - WARN = { icon = ' ' }, - PERF = { icon = '󰓅 ' }, - NOTE = { icon = '' }, - TEST = { icon = '󰙨 ' }, + TODO = { icon = icons.ui.Checkmark }, + FIX = { icon = icons.ui.Bug }, + HACK = { icon = icons.ui.Fire }, + WARN = { icon = icons.ui.Warning }, + PERF = { icon = icons.ui.Gauge }, + NOTE = { icon = icons.ui.Note }, + TEST = { icon = icons.ui.TestTube }, }, } end diff --git a/config/nvim/lua/fschauen/plugins/virt-column.lua b/config/nvim/lua/fschauen/plugins/virt-column.lua index 92890f8..71a07c2 100644 --- a/config/nvim/lua/fschauen/plugins/virt-column.lua +++ b/config/nvim/lua/fschauen/plugins/virt-column.lua @@ -19,7 +19,7 @@ M.keys = { M.config = function() require('virt-column').setup { - char = '│', + char = require('fschauen.icons').ui.LineMiddle, } end