vim: move most icons to a dedicated file
This commit is contained in:
parent
04acdd05a1
commit
f5e1ac20eb
10 changed files with 197 additions and 107 deletions
|
@ -1,5 +1,7 @@
|
||||||
local M = {}
|
local M = {}
|
||||||
|
|
||||||
|
local icons = require('fschauen.icons')
|
||||||
|
|
||||||
-- Show/navigate warning and errors by default.
|
-- Show/navigate warning and errors by default.
|
||||||
M.severity = vim.diagnostic.severity.WARN
|
M.severity = vim.diagnostic.severity.WARN
|
||||||
|
|
||||||
|
@ -80,7 +82,7 @@ M.setup = function()
|
||||||
underline = false,
|
underline = false,
|
||||||
virtual_text = {
|
virtual_text = {
|
||||||
spacing = 6,
|
spacing = 6,
|
||||||
prefix = '●',
|
prefix = icons.ui.Circle,
|
||||||
severity = {
|
severity = {
|
||||||
min = M.severity,
|
min = M.severity,
|
||||||
}
|
}
|
||||||
|
@ -91,14 +93,7 @@ M.setup = function()
|
||||||
severity_sort = true,
|
severity_sort = true,
|
||||||
}
|
}
|
||||||
|
|
||||||
local signs = {
|
for type, icon in pairs(icons.diagnostics) do
|
||||||
Error = ' ',
|
|
||||||
Warn = ' ',
|
|
||||||
Info = ' ',
|
|
||||||
Hint = ' ',
|
|
||||||
}
|
|
||||||
|
|
||||||
for type, icon in pairs(signs) do
|
|
||||||
local hl = 'DiagnosticSign' .. type
|
local hl = 'DiagnosticSign' .. type
|
||||||
vim.fn.sign_define(hl, { text = icon, texthl = hl, numhl = hl })
|
vim.fn.sign_define(hl, { text = icon, texthl = hl, numhl = hl })
|
||||||
end
|
end
|
||||||
|
|
122
config/nvim/lua/fschauen/icons.lua
Normal file
122
config/nvim/lua/fschauen/icons.lua
Normal file
|
@ -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
|
||||||
|
|
|
@ -89,44 +89,7 @@ M.config = function()
|
||||||
path = '',
|
path = '',
|
||||||
},
|
},
|
||||||
|
|
||||||
-- Custom mix of lspkind defaults and VS Code codicons :)
|
symbol_map = require('fschauen.icons').kind,
|
||||||
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 = '',
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
|
@ -1,13 +1,15 @@
|
||||||
local M = { 'lukas-reineke/indent-blankline.nvim' }
|
local M = { 'lukas-reineke/indent-blankline.nvim' }
|
||||||
|
|
||||||
|
local icons = require('fschauen.icons')
|
||||||
|
|
||||||
M.config = function()
|
M.config = function()
|
||||||
require('ibl').setup {
|
require('ibl').setup {
|
||||||
enabled = false,
|
enabled = false,
|
||||||
indent = {
|
indent = {
|
||||||
char = '▏',
|
char = icons.ui.LineLeft,
|
||||||
},
|
},
|
||||||
scope = {
|
scope = {
|
||||||
char = '▎',
|
char = icons.ui.LineLeftBold,
|
||||||
enabled = false,
|
enabled = false,
|
||||||
show_start = false,
|
show_start = false,
|
||||||
show_end = false,
|
show_end = false,
|
||||||
|
|
|
@ -1,8 +1,9 @@
|
||||||
|
local M = { 'nvim-lualine/lualine.nvim' }
|
||||||
|
|
||||||
|
local icons = require('fschauen.icons')
|
||||||
local orange = '#d65d0e'
|
local orange = '#d65d0e'
|
||||||
local bright = '#ffffff' -- alternative: '#f9f5d7'
|
local bright = '#ffffff' -- alternative: '#f9f5d7'
|
||||||
|
|
||||||
local M = { 'nvim-lualine/lualine.nvim' }
|
|
||||||
|
|
||||||
M.dependencies = {
|
M.dependencies = {
|
||||||
'nvim-tree/nvim-web-devicons',
|
'nvim-tree/nvim-web-devicons',
|
||||||
}
|
}
|
||||||
|
@ -52,26 +53,26 @@ M.config = function()
|
||||||
local C = require('lualine.component'):extend()
|
local C = require('lualine.component'):extend()
|
||||||
|
|
||||||
C.map = {
|
C.map = {
|
||||||
['n'] = '', -- 'Normal ', -- Normal
|
['n'] = icons.modes.Normal, -- 'Normal ', -- Normal
|
||||||
['no'] = '', -- 'O-Pend ', -- Operator-pending
|
['no'] = icons.modes.OperatorPending, -- 'O-Pend ', -- Operator-pending
|
||||||
['ni'] = '', -- 'Normal ', -- Normal via i_CTRL-O
|
['ni'] = icons.modes.NormalI, -- 'Normal ', -- Normal via i_CTRL-O
|
||||||
['v'] = '', -- 'Visual ', -- Visual by character
|
['v'] = icons.modes.Visual, -- 'Visual ', -- Visual by character
|
||||||
[''] = '', -- 'V-Block', -- Visual blockwise
|
[''] = icons.modes.VisualBlock, -- 'V-Block', -- Visual blockwise
|
||||||
['s'] = '', -- 'Select ', -- Select by character
|
['s'] = icons.modes.Select, -- 'Select ', -- Select by character
|
||||||
[''] = '', -- 'S-Block', -- Select blockwise
|
[''] = icons.modes.SelectBlock, -- 'S-Block', -- Select blockwise
|
||||||
['i'] = '', -- 'Insert ', -- Insert
|
['i'] = icons.modes.Insert, -- 'Insert ', -- Insert
|
||||||
['r'] = '', -- 'Replace', -- Replace
|
['r'] = icons.modes.Replace, -- 'Replace', -- Replace
|
||||||
['rv'] = '', -- 'V-Repl ', -- Virtual Replace
|
['rv'] = icons.modes.VirtualReplace, -- 'V-Repl ', -- Virtual Replace
|
||||||
['c'] = '', -- 'Command', -- Command-line
|
['c'] = icons.modes.Command, -- 'Command', -- Command-line
|
||||||
['cv'] = '', -- ' Ex ', -- Ex mode
|
['cv'] = icons.modes.Ex, -- ' Ex ', -- Ex mode
|
||||||
['rm'] = '', -- ' modeore ', -- -- modeORE --
|
['rm'] = icons.modes.modeore, -- ' modeore ', -- -- modeORE --
|
||||||
['r?'] = '', -- 'Confirm', -- :confirm
|
['r?'] = icons.modes.Cofirm, -- 'Confirm', -- :confirm
|
||||||
['!'] = '', -- ' Shell ', -- External command executing
|
['!'] = icons.modes.Shell, -- ' Shell ', -- External command executing
|
||||||
['t'] = '', -- ' Term ', -- Terminal
|
['t'] = icons.modes.Term, -- ' Term ', -- Terminal
|
||||||
}
|
}
|
||||||
|
|
||||||
function C:update_status(is_focused)
|
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 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
|
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
|
if next(count) == nil then return '' end
|
||||||
|
|
||||||
local denominator = count.total > count.maxcount and '' or string.format('%d', count.total)
|
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
|
end
|
||||||
|
|
||||||
return C
|
return C
|
||||||
|
@ -142,7 +143,7 @@ M.config = function()
|
||||||
local lineno = vim.fn.search(trailing, 'nwc')
|
local lineno = vim.fn.search(trailing, 'nwc')
|
||||||
if lineno == 0 then return '' end
|
if lineno == 0 then return '' end
|
||||||
|
|
||||||
local result = ' ' .. lineno
|
local result = icons.ui.Attention .. lineno
|
||||||
|
|
||||||
local total = vim.fn.searchcount({ pattern = trailing }).total
|
local total = vim.fn.searchcount({ pattern = trailing }).total
|
||||||
if total > 1 then result = result .. string.format(' (%d total)', total) end
|
if total > 1 then result = result .. string.format(' (%d total)', total) end
|
||||||
|
@ -157,9 +158,8 @@ M.config = function()
|
||||||
end,
|
end,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
local paste = {
|
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 = {
|
color = {
|
||||||
bg = orange,
|
bg = orange,
|
||||||
},
|
},
|
||||||
|
@ -169,8 +169,8 @@ M.config = function()
|
||||||
local status = {
|
local status = {
|
||||||
colored_if_focused(function(_)
|
colored_if_focused(function(_)
|
||||||
local status = ''
|
local status = ''
|
||||||
if vim.bo.modified then status = status .. '' end
|
if vim.bo.modified then status = status .. icons.ui.Modified end
|
||||||
if vim.bo.readonly or not vim.bo.modifiable then status = status .. 'RO' end
|
if vim.bo.readonly or not vim.bo.modifiable then status = status .. icons.ui.ReadOnly end
|
||||||
return status
|
return status
|
||||||
end),
|
end),
|
||||||
color = {
|
color = {
|
||||||
|
@ -184,7 +184,7 @@ M.config = function()
|
||||||
mode
|
mode
|
||||||
},
|
},
|
||||||
lualine_b = {
|
lualine_b = {
|
||||||
{ 'branch', icon = '', cond = window.is_medium },
|
{ 'branch', icon = icons.git.Branch, cond = window.is_medium },
|
||||||
},
|
},
|
||||||
lualine_c = {
|
lualine_c = {
|
||||||
filename,
|
filename,
|
||||||
|
|
|
@ -9,12 +9,14 @@ M.keys = {
|
||||||
}
|
}
|
||||||
|
|
||||||
M.config = function()
|
M.config = function()
|
||||||
|
local icons = require('fschauen.icons')
|
||||||
|
|
||||||
require('neogit').setup {
|
require('neogit').setup {
|
||||||
disable_hint = true,
|
disable_hint = true,
|
||||||
signs = {
|
signs = {
|
||||||
section = { '', '' },
|
section = { icons.ui.Folder, icons.ui.EmptyFolderOpen },
|
||||||
item = { '', '' },
|
item = { icons.ui.ChevronRight, icons.ui.ChevronDown },
|
||||||
hunk = { '', '' },
|
hunk = { icons.ui.ChevronSmallRight, icons.ui.ChevronSmallDown },
|
||||||
},
|
},
|
||||||
mappings = {
|
mappings = {
|
||||||
status = {
|
status = {
|
||||||
|
|
|
@ -11,6 +11,8 @@ M.keys = {
|
||||||
}
|
}
|
||||||
|
|
||||||
M.config = function()
|
M.config = function()
|
||||||
|
local icons = require('fschauen.icons')
|
||||||
|
|
||||||
require('nvim-tree').setup {
|
require('nvim-tree').setup {
|
||||||
disable_netrw = true, -- replace netrw with nvim-tree
|
disable_netrw = true, -- replace netrw with nvim-tree
|
||||||
hijack_cursor = true, -- keep the cursor on begin of the filename
|
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
|
webdev_colors = false, -- highlight icons with NvimTreeFileIcon
|
||||||
git_placement = 'signcolumn',
|
git_placement = 'signcolumn',
|
||||||
glyphs = {
|
glyphs = {
|
||||||
default = '',
|
default = icons.ui.File,
|
||||||
symlink = '',
|
symlink = icons.ui.FileSymlink,
|
||||||
modified = '●',
|
modified = icons.ui.Circle,
|
||||||
folder = {
|
folder = {
|
||||||
arrow_closed = '', --
|
arrow_closed = icons.ui.ChevronSmallRight,
|
||||||
arrow_open = '', --
|
arrow_open = icons.ui.ChevronSmallDown,
|
||||||
default = '', --
|
default = icons.ui.Folder,
|
||||||
open = '', --
|
open = icons.ui.FolderOpen,
|
||||||
empty = '',
|
empty = icons.ui.EmptyFolder,
|
||||||
empty_open = '',
|
empty_open = icons.ui.EmptyFolderOpen,
|
||||||
symlink = '',
|
symlink = icons.ui.FolderSymlink,
|
||||||
symlink_open = '',
|
symlink_open = icons.ui.FolderSymlink,
|
||||||
},
|
},
|
||||||
git = {
|
git = {
|
||||||
untracked = '',
|
untracked = icons.git.file.Untracked,
|
||||||
unstaged = '✶',
|
unstaged = icons.git.file.Unstaged,
|
||||||
staged = '✓',
|
staged = icons.git.file.Staged,
|
||||||
deleted = '✗',
|
deleted = icons.git.file.Deleted,
|
||||||
unmerged = '',
|
unmerged = icons.git.file.Unmerged,
|
||||||
renamed = '➜',
|
renamed = icons.git.file.Renamed,
|
||||||
ignored = '◌',
|
ignored = icons.git.file.Ignored,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
|
@ -118,6 +118,8 @@ M.keys = {
|
||||||
{ '<leader>f<leader>', pickers.resume ' Resume' , desc = ' Telescope Resume ' },
|
{ '<leader>f<leader>', pickers.resume ' Resume' , desc = ' Telescope Resume ' },
|
||||||
}
|
}
|
||||||
|
|
||||||
|
local icons = require('fschauen.icons')
|
||||||
|
|
||||||
M.config = function()
|
M.config = function()
|
||||||
local actions = require('telescope.actions')
|
local actions = require('telescope.actions')
|
||||||
local layout = require('telescope.actions.layout')
|
local layout = require('telescope.actions.layout')
|
||||||
|
@ -143,10 +145,10 @@ M.config = function()
|
||||||
n = mappings,
|
n = mappings,
|
||||||
},
|
},
|
||||||
|
|
||||||
prompt_prefix = ' ', -- Alternatives: ❯
|
prompt_prefix = ' ',
|
||||||
selection_caret = ' ', -- Alternatives: ➔
|
selection_caret = icons.ui.Play,
|
||||||
|
|
||||||
multi_icon = ' ', -- Alternatives:
|
multi_icon = icons.ui.Checkmark,
|
||||||
scroll_strategy = 'limit', -- Don't wrap around in results.
|
scroll_strategy = 'limit', -- Don't wrap around in results.
|
||||||
|
|
||||||
dynamic_preview_title = true,
|
dynamic_preview_title = true,
|
||||||
|
|
|
@ -14,16 +14,18 @@ M.keys = {
|
||||||
{ '<leader>ft', '<cmd>TodoTelescope<cr>' },
|
{ '<leader>ft', '<cmd>TodoTelescope<cr>' },
|
||||||
}
|
}
|
||||||
|
|
||||||
|
local icons = require('fschauen.icons')
|
||||||
|
|
||||||
M.config = function()
|
M.config = function()
|
||||||
require('todo-comments').setup {
|
require('todo-comments').setup {
|
||||||
keywords = {
|
keywords = {
|
||||||
TODO = { icon = ' ' },
|
TODO = { icon = icons.ui.Checkmark },
|
||||||
FIX = { icon = ' ' },
|
FIX = { icon = icons.ui.Bug },
|
||||||
HACK = { icon = ' ' },
|
HACK = { icon = icons.ui.Fire },
|
||||||
WARN = { icon = ' ' },
|
WARN = { icon = icons.ui.Warning },
|
||||||
PERF = { icon = ' ' },
|
PERF = { icon = icons.ui.Gauge },
|
||||||
NOTE = { icon = '' },
|
NOTE = { icon = icons.ui.Note },
|
||||||
TEST = { icon = ' ' },
|
TEST = { icon = icons.ui.TestTube },
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
|
@ -19,7 +19,7 @@ M.keys = {
|
||||||
|
|
||||||
M.config = function()
|
M.config = function()
|
||||||
require('virt-column').setup {
|
require('virt-column').setup {
|
||||||
char = '│',
|
char = require('fschauen.icons').ui.LineMiddle,
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue