1
0
Fork 0

icon rework and small refactor

This commit is contained in:
Luca Bilke 2024-01-26 17:21:37 +01:00
parent c8a407b681
commit 1a18a8ef30
17 changed files with 185 additions and 434 deletions

View File

@ -1,163 +1,80 @@
return { return {
Diagnostic = "󰒡", Diagnostic = "󰭷",
DiagnosticError = "", Error = "󰅗",
DiagnosticHint = "󰌵", Hint = "󰌵",
DiagnosticInfo = "󰋼", Info = "󰋼",
DiagnosticWarn = "", Warn = "󰀦",
PackageInstalled = "", Bug = "󰠭",
PackagePending = "", True = "󰸞",
PackageUninstalled = "", Pending = "󰁪",
Selected = "", False = "󱎘",
Close = "󱎘",
Selected = "󰅂",
kind = { Console = "󰆍",
Array = "", Gear = "󰒓",
Boolean = "", Event = "󱐋",
Class = "", File = "󰈔",
Color = "", NewFile = "󰝒",
Constant = "", FileTree = "󰙅",
Constructor = "", Import = "󰈠",
Enum = "", Keyboard = "󰌌",
EnumMember = "", Sleep = "󰒲",
Event = "", Package = "󰏗",
Field = "", Runtime = "",
File = "", Source = "󰈮",
Folder = "󰉋", Code = "",
Function = "", Start = "",
Interface = "", Task = "󰱒",
Key = "", Buffer = "󰧭",
Keyword = "", Search = "",
Method = "", Speed = "󰾆",
Module = "", Test = "",
Namespace = "", Flame = "",
Null = "󰟢", Leave = "",
Number = "", Git = "󰊢",
Object = "", Loaded = "󰜄",
Operator = "", Unloaded = "󰛲",
Package = "", Added = "󰜄",
Property = "", Modified = "󱗝",
Reference = "", Removed = "󰛲",
Snippet = "", Untracked = "",
String = "", ChangeDelete = "󰅘",
Struct = "", Truncate = "",
Text = "", -- kind = {
TypeParameter = "", -- Array = "",
Unit = "", -- Boolean = "",
Value = "", -- Class = "",
Variable = "", -- Color = "",
}, -- Constant = "",
git = { -- Constructor = "",
LineAdded = "", -- Enum = "",
LineModified = "", -- EnumMember = "",
LineRemoved = "", -- Event = "",
FileDeleted = "", -- Field = "",
FileIgnored = "", -- File = "",
FileRenamed = "", -- Folder = "󰉋",
FileStaged = "S", -- Function = "",
FileUnmerged = "", -- Interface = "",
FileUnstaged = "", -- Key = "",
FileUntracked = "U", -- Keyword = "",
Diff = "", -- Method = "",
Repo = "", -- Module = "",
Octoface = "", -- Namespace = "",
Branch = "", -- Null = "󰟢",
}, -- Number = "",
ui = { -- Object = "",
ArrowCircleDown = "", -- Operator = "",
ArrowCircleLeft = "", -- Package = "",
ArrowCircleRight = "", -- Property = "",
ArrowCircleUp = "", -- Reference = "",
BoldArrowDown = "", -- Snippet = "",
BoldArrowLeft = "", -- String = "",
BoldArrowRight = "", -- Struct = "",
BoldArrowUp = "", -- Text = "",
BoldClose = "", -- TypeParameter = "",
BoldDividerLeft = "", -- Unit = "",
BoldDividerRight = "", -- Value = "",
BoldLineLeft = "", -- Variable = "",
BookMark = "", -- },
BoxChecked = "",
Bug = "",
Stacks = "",
Scopes = "",
Watches = "󰂥",
Debug = "",
Calendar = "",
Check = "",
ChevronRight = ">",
ChevronShortDown = "",
ChevronShortLeft = "",
ChevronShortRight = "",
ChevronShortUp = "",
Circle = "",
Clear = "󰃢",
Close = "󰅖",
CloudDownload = "",
CMD = "",
Code = "",
Comment = "",
Dashboard = "",
DividerLeft = "",
DividerRight = "",
DoubleChevronRight = "󰄾",
DoubleChevronLeft = "󰄽",
Ellipsis = "",
EmptyFolder = "",
EmptyFolderOpen = "",
EmptyFile = "",
File = "",
Files = "",
FileSymlink = "",
FindFile = "󰈞",
FindText = "󰊄",
Fire = "",
Folder = "󰉋",
FolderOpen = "",
FolderSymlink = "",
Forward = "",
Gear = "",
History = "",
Import = "",
Keyboard = "",
Lightbulb = "",
LineLeft = "",
LineMiddle = "",
List = "",
Lock = "",
MinusCircle = "",
Note = "",
Package = "",
Pencil = "󰏫",
Plus = "",
Project = "",
Search = "",
SignIn = "",
SignOut = "",
Sleep = "󰒲",
Save = "",
Tab = "󰓩",
Table = "",
Target = "",
Telescope = "",
Text = "",
Terminal = "",
Tree = "",
Triangle = "󰐊",
triangleshortarrowdown = "",
triangleshortarrowleft = "",
triangleshortarrowright = "",
triangleshortarrowup = "",
},
-- progress = { "", "", "", "", "", "", "", "", "", "", "", "", "" }, -- progress = { "", "", "", "", "", "", "", "", "", "", "", "", "" },
misc = {
Robot = "󰚩",
Squirrel = "",
Tag = "",
Watch = "",
Smiley = "",
Package = "",
CircuitBoard = "",
Vim = "",
Git = ""
},
} }

View File

@ -3,14 +3,14 @@ local icons = require("config.icons")
local maps = f.empty_map_table() local maps = f.empty_map_table()
local sections = { local sections = {
p = { desc = " " .. icons.ui.Package .. " Packages" }, p = { desc = icons.Package .. " Packages" },
b = { desc = " " .. icons.ui.Tab .. " Buffers" }, b = { desc = icons.Buffer .. " Buffers" },
bs = { desc = " " .. icons.ui.Tab .. " Sort Buffers" }, bs = { desc = "Sort Buffers" },
d = { desc = " " .. icons.ui.Debug .. " Debugger" }, d = { desc = icons.Bug .. " Debugger" },
g = { desc = " " .. icons.misc.Git .. " Git" }, g = { desc = icons.Git .. " Git" },
f = { desc = " " .. icons.ui.Search .. " Find" }, f = { desc = icons.Search .. " Find" },
l = { desc = " " .. icons.ui.Note .. " LSP" }, l = { desc = icons.Code .. " LSP" },
t = { desc = " " .. icons.ui.Terminal .. " Terminal" }, t = { desc = icons.Console .. " Terminal" },
} }
-- Standard -- -- Standard --
@ -31,9 +31,6 @@ maps.n["<Leader>q"] = { f.buf_close, desc = "Close buffer" }
maps.n["<C-b>"] = { "<C-a>" } maps.n["<C-b>"] = { "<C-a>" }
maps.n["<C-f>"] = { "<Nop>" } maps.n["<C-f>"] = { "<Nop>" }
maps.i["<C-h>"] = { "<C-W>" } maps.i["<C-h>"] = { "<C-W>" }
-- TODO: Remove this when implemented in lsp_on_attach
maps.n["<Leader>lf"] = { vim.lsp.buf.format, desc = "Format" }
-- TODO: Add compiler script back (or don't tbh)
-- Window Navigation -- -- Window Navigation --
maps.n["<C-h>"] = { "<C-w>h", desc = "Move to left split" } maps.n["<C-h>"] = { "<C-w>h", desc = "Move to left split" }
@ -50,6 +47,7 @@ maps.t["<C-k>"] = { "<cmd>wincmd k<cr>", desc = "Terminal up window navigation"
maps.t["<C-l>"] = { "<cmd>wincmd l<cr>", desc = "Terminal right window navigation" } maps.t["<C-l>"] = { "<cmd>wincmd l<cr>", desc = "Terminal right window navigation" }
-- Plugin Manager -- -- Plugin Manager --
maps.n["<Leader>p"] = sections.p
maps.n["<Leader>ph"] = { function() require("lazy").home() end, desc = "Home" } maps.n["<Leader>ph"] = { function() require("lazy").home() end, desc = "Home" }
maps.n["<Leader>pi"] = { function() require("lazy").install() end, desc = "Install" } maps.n["<Leader>pi"] = { function() require("lazy").install() end, desc = "Install" }
maps.n["<Leader>pu"] = { function() require("lazy").update() end, desc = "Update" } maps.n["<Leader>pu"] = { function() require("lazy").update() end, desc = "Update" }

View File

@ -250,7 +250,7 @@ function M.lsp_on_attach(client, bufnr)
function() vim.lsp.codelens.run() end, function() vim.lsp.codelens.run() end,
desc = "Run CodeLens", desc = "Run CodeLens",
} }
lsp_mappings.n["<Leader>u"] = { desc = " " .. icons.ui.Gear .. " Utility" } lsp_mappings.n["<Leader>u"] = { desc = " " .. icons.Gear .. " Utility" }
lsp_mappings.n["<leader>uL"] = { lsp_mappings.n["<leader>uL"] = {
function() vim.lsp.codelens.clear() end, function() vim.lsp.codelens.clear() end,
desc = "Toggle CodeLens" desc = "Toggle CodeLens"
@ -309,7 +309,7 @@ function M.lsp_on_attach(client, bufnr)
-- TODO: Check this on 0.10.0 release -- TODO: Check this on 0.10.0 release
if client.supports_method "textDocument/semanticTokens/full" and vim.lsp.semantic_tokens then if client.supports_method "textDocument/semanticTokens/full" and vim.lsp.semantic_tokens then
vim.b[bufnr].semantic_tokens_enabled = true vim.b[bufnr].semantic_tokens_enabled = true
lsp_mappings.n["<Leader>u"] = { desc = " " .. icons.ui.Gear .. " Utility" } lsp_mappings.n["<Leader>u"] = { desc = " " .. icons.Gear .. " Utility" }
lsp_mappings.n["<leader>uY"] = { lsp_mappings.n["<leader>uY"] = {
function() function()
vim.b[bufnr].semantic_tokens_enabled = not vim.b[bufnr].semantic_tokens_enabled vim.b[bufnr].semantic_tokens_enabled = not vim.b[bufnr].semantic_tokens_enabled
@ -370,7 +370,7 @@ function M.lsp_on_attach(client, bufnr)
-- TODO: Check this on 0.10.0 release -- TODO: Check this on 0.10.0 release
if vim.lsp.inlay_hint then if vim.lsp.inlay_hint then
if vim.b.inlay_hints_enabled then vim.lsp.inlay_hint.enable(bufnr, true) end if vim.b.inlay_hints_enabled then vim.lsp.inlay_hint.enable(bufnr, true) end
lsp_mappings.n["<Leader>u"] = { desc = " " .. icons.ui.Gear .. " Utility" } lsp_mappings.n["<Leader>u"] = { desc = " " .. icons.Gear .. " Utility" }
lsp_mappings.n["<leader>uH"] = { lsp_mappings.n["<leader>uH"] = {
function() function()
vim.b[bufnr].inlay_hints_enabled = not vim.b[bufnr].inlay_hints_enabled vim.b[bufnr].inlay_hints_enabled = not vim.b[bufnr].inlay_hints_enabled
@ -423,8 +423,8 @@ function M.lsp_on_attach(client, bufnr)
end end
if not vim.tbl_isempty(lsp_mappings.v) then if not vim.tbl_isempty(lsp_mappings.v) then
if lsp_mappings.v["<leader>l"] then lsp_mappings.v["<leader>l"] = { desc = " " .. icons.ui.Note .. " LSP" } end if lsp_mappings.v["<leader>l"] then lsp_mappings.v["<leader>l"] = { desc = " " .. icons.Code .. " LSP" } end
if lsp_mappings.v["<leader>u"] then lsp_mappings.v["<leader>u"] = { desc = " " .. icons.ui.Note .. " LSP" } end if lsp_mappings.v["<leader>u"] then lsp_mappings.v["<leader>u"] = { desc = " " .. icons.Code .. " LSP" } end
end end
M.set_mappings(lsp_mappings, { buffer = bufnr }) M.set_mappings(lsp_mappings, { buffer = bufnr })

View File

@ -1,122 +0,0 @@
local M = { "hrsh7th/nvim-cmp" }
M.dependencies = {
{ "onsails/lspkind.nvim" },
{ "saadparwaiz1/cmp_luasnip" },
{ "hrsh7th/cmp-nvim-lsp" },
{ "hrsh7th/cmp-buffer" },
{ "hrsh7th/cmp-path" },
"LuaSnip",
"nvim-autopairs",
}
M.event = { "BufReadPost", "BufNewFile" }
local opts = function()
local has_words_before = function()
unpack = unpack or table.unpack
local line, col = unpack(vim.api.nvim_win_get_cursor(0))
return col ~= 0 and vim.api.nvim_buf_get_lines(0, line - 1, line, true)[1]:sub(col, col):match("%s") == nil
end
local cmp_window = require('cmp.utils.window')
cmp_window.info_ = cmp_window.info
cmp_window.info = function(self)
local info = self:info_()
info.scrollable = false
return info
end
local luasnip = require('luasnip')
local cmp = require('cmp')
return {
window = {
completion = {
winhighlight = "Normal:Pmenu,FloatBorder:Pmenu,Search:None",
col_offset = -3,
side_padding = 0,
},
},
formatting = {
fields = { "kind", "abbr", "menu" },
format = function(entry, vim_item)
local kind = require("lspkind").cmp_format({ mode = "symbol_text", maxwidth = 50 })(entry, vim_item)
local strings = vim.split(kind.kind, "%s", { trimempty = true })
kind.kind = " " .. (strings[1] or "") .. " "
kind.menu = " (" .. (strings[2] or "") .. ")"
return kind
end,
},
snippet = {
expand = function(args)
luasnip.lsp_expand(args.body)
end,
},
mapping = {
["<C-j>"] = cmp.mapping(cmp.mapping.scroll_docs(-1), { "i", "c" }),
["<C-k>"] = cmp.mapping(cmp.mapping.scroll_docs(1), { "i", "c" }),
["<CR>"] = cmp.mapping({
i = function(fallback)
if cmp.visible() and cmp.get_active_entry() then
cmp.confirm({ behavior = cmp.ConfirmBehavior.Replace, select = false })
else
fallback()
end
end,
s = cmp.mapping.confirm({ select = true }),
c = cmp.mapping.confirm({ behavior = cmp.ConfirmBehavior.Replace, select = true }),
}),
["<C-e>"] = cmp.mapping({
i = cmp.mapping.abort(),
c = cmp.mapping.close(),
}),
["<Tab>"] = cmp.mapping(function(fallback)
if cmp.visible() then
cmp.select_next_item()
elseif luasnip.expand_or_jumpable() then
luasnip.expand_or_jump()
elseif has_words_before() then
cmp.complete()
else
fallback()
end
end, { "i", "s" }),
["<S-Tab>"] = cmp.mapping(function(fallback)
if cmp.visible() then
cmp.select_prev_item()
elseif luasnip.jumpable(-1) then
luasnip.jump(-1)
else
fallback()
end
end, { "i", "s" }),
},
sources = {
{ name = "nvim_lsp" },
{ name = "luasnip" },
{ name = "buffer" },
{ name = "path" },
},
experimental = {
ghost_text = true,
},
confirm_opts = {
behavior = cmp.ConfirmBehavior.Replace,
select = false,
}
}
end
M.config = function()
local cmp_autopairs = require('nvim-autopairs.completion.cmp')
local cmp = require('cmp')
cmp.setup(opts())
cmp.event:on(
'confirm_done',
cmp_autopairs.on_confirm_done()
)
end
return M

View File

@ -1,4 +0,0 @@
return {
-- require('plugins.cmp.luasnip'),
-- require('plugins.cmp.cmp'),
}

View File

@ -1,47 +0,0 @@
local M = { "L3MON4D3/LuaSnip" }
M.build = "make install_jsregexp"
local opts = function()
local luasnip = require('luasnip')
local f = luasnip.function_node
return {
history = true,
enable_autosnippets = true,
update_events = { "TextChanged", "TextChangedI" },
snip_env = {
s = function(...)
local snip = luasnip.s(...)
table.insert(getfenv(2).ls_file_snippets, snip)
end,
parse = function(...)
local snip = luasnip.parser.parse_snippet(...)
table.insert(getfenv(2).ls_file_snippets, snip)
end,
reference = function(node)
return f(function(args, _) return args[1][1] end, node)
end,
capture = function(index)
return f(function(_, snip, user_arg1) return snip.captures[user_arg1] end, nil, { user_args = { index } })
end
},
}
end
M.config = function()
require('luasnip').setup(opts())
require('luasnip.loaders.from_lua').load({ paths = os.getenv("XDG_CONFIG_HOME") .. "/nvim/lua/snippets" })
--require('luasnip.loaders.from_vscode').load({ paths = os.getenv("XDG_CONFIG_HOME") .. "/nvim/lua/snippets" })
vim.api.nvim_create_autocmd("InsertLeave", {
callback = function()
local luasnip = require('luasnip')
if luasnip.session.current_nodes[vim.api.nvim_get_current_buf()]
and not luasnip.session.jump_active
then
luasnip.unlink_current()
end
end,
})
end
return M

View File

@ -13,7 +13,7 @@ M.config = function()
vim.fn.sign_define( vim.fn.sign_define(
"DapBreakpoint", "DapBreakpoint",
{ {
text = icons.ui.Bug, text = icons.Bug,
texthl = "DiagnosticSignError", texthl = "DiagnosticSignError",
linehl = "", linehl = "",
numhl = "", numhl = "",

View File

@ -1,32 +1,25 @@
local M = { "folke/lazy.nvim" } local M = { "folke/lazy.nvim" }
local icons = require('config.icons') local icons = require('config.icons')
M.opts = { M.opts = {
ui = { ui = {
border = "single", border = "single",
icons = { icons = {
cmd = icons.ui.CMD .. " ", cmd = icons.Console .. " ",
config = icons.ui.Gear, config = icons.Gear,
event = icons.misc.Bolt, event = icons.Event,
ft = icons.ui.File .. " ", ft = icons.File .. " ",
init = icons.ui.Gear .. " ", init = icons.Gear .. " ",
import = icons.ui.Import .. " ", import = icons.Import .. " ",
keys = icons.ui.Keyboard .. " ", keys = icons.Keyboard .. " ",
lazy = icons.ui.Sleep .. " ", lazy = icons.Sleep .. " ",
loaded = icons.ui.CircleFull, loaded = icons.Loaded,
not_loaded = icons.ui.CircleEmpty, not_loaded = icons.Unloaded,
plugin = icons.misc.Package, plugin = icons.Package,
runtime = icons.misc.Vim .. " ", runtime = icons.Runtime .. " ",
source = icons.ui.Code .. " ", source = icons.Source .. " ",
start = icons.ui.Start, start = icons.Start,
task = icons.ui.Check .. " ", task = icons.Task,
list = {
icons.ui.CircleFull,
icons.ui.BoldArrowRight,
icons.misc.Star,
icons.ui.LineHorizontal,
},
}, },
}, },
} }

View File

@ -28,10 +28,10 @@ M.cmd = { "LspInstall", "LspUninstall" }
M.config = function() M.config = function()
local icons = require("config.icons") local icons = require("config.icons")
local signs = { local signs = {
{ name = "DiagnosticSignError", text = icons.DiagnosticError, texthl = "DiagnosticSignError" }, { name = "DiagnosticSignError", text = icons.Error, texthl = "DiagnosticSignError" },
{ name = "DiagnosticSignWarn", text = icons.DiagnosticWarn, texthl = "DiagnosticSignWarn" }, { name = "DiagnosticSignWarn", text = icons.Warn, texthl = "DiagnosticSignWarn" },
{ name = "DiagnosticSignHint", text = icons.DiagnosticHint, texthl = "DiagnosticSignHint" }, { name = "DiagnosticSignHint", text = icons.Hint, texthl = "DiagnosticSignHint" },
{ name = "DiagnosticSignInfo", text = icons.DiagnosticInfo, texthl = "DiagnosticSignInfo" }, { name = "DiagnosticSignInfo", text = icons.Info, texthl = "DiagnosticSignInfo" },
{ name = "DapStopped", text = icons.DapStopped, texthl = "DiagnosticWarn" }, { name = "DapStopped", text = icons.DapStopped, texthl = "DiagnosticWarn" },
{ name = "DapBreakpoint", text = icons.DapBreakpoint, texthl = "DiagnosticInfo" }, { name = "DapBreakpoint", text = icons.DapBreakpoint, texthl = "DiagnosticInfo" },
{ name = "DapBreakpointRejected", text = icons.DapBreakpointRejected, texthl = "DiagnosticError" }, { name = "DapBreakpointRejected", text = icons.DapBreakpointRejected, texthl = "DiagnosticError" },
@ -46,10 +46,10 @@ M.config = function()
virtual_text = true, virtual_text = true,
signs = { signs = {
text = { text = {
[vim.diagnostic.severity.ERROR] = icons.DiagnosticError, [vim.diagnostic.severity.ERROR] = icons.Error,
[vim.diagnostic.severity.HINT] = icons.DiagnosticHint, [vim.diagnostic.severity.HINT] = icons.Hint,
[vim.diagnostic.severity.WARN] = icons.DiagnosticWarn, [vim.diagnostic.severity.WARN] = icons.Warn,
[vim.diagnostic.severity.INFO] = icons.DiagnosticInfo, [vim.diagnostic.severity.INFO] = icons.Info,
}, },
active = signs, active = signs,
}, },

View File

@ -17,9 +17,9 @@ M.opts = {
ui = { ui = {
border = "none", border = "none",
icons = { icons = {
package_installed = icons.PackageInstalled, package_installed = icons.True,
package_pending = icons.PackagePending, package_pending = icons.Pending,
package_uninstalled = icons.PackageUninstalled, package_uninstalled = icons.False,
}, },
}, },
log_level = vim.log.levels.INFO, log_level = vim.log.levels.INFO,

View File

@ -1,8 +1,11 @@
local M = { "goolord/alpha-nvim" } local M = { "goolord/alpha-nvim" }
local icons = require('config.icons')
M.opts = function() M.opts = function()
local dashboard = require('alpha.themes.dashboard') local icons = require("config.icons")
local dashboard = require("alpha.themes.dashboard")
dashboard.section.header.opts.hl = "DashboardHeader"
dashboard.section.footer.opts.hl = "DashboardFooter"
local banner = { local banner = {
"⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣠⣴⣶⣿⣿⣿⣷⣶⣤⡀⠀⠀⠀⠀⠀⠀", "⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣠⣴⣶⣿⣿⣿⣷⣶⣤⡀⠀⠀⠀⠀⠀⠀",
@ -36,19 +39,42 @@ M.opts = function()
dashboard.section.header.val = banner dashboard.section.header.val = banner
dashboard.section.buttons.val = { dashboard.section.buttons.val = {
dashboard.button("n", icons.ui.EmptyFile .. " New file", "<CMD>ene<CR>"), dashboard.button("n", icons.File .. " New file", "<Cmd>ene<CR>"),
dashboard.button("e", icons.ui.FindFile .. " Open file", "<CMD>Lf<CR>"), dashboard.button("f", icons.Search .. " Find file", "<Cmd>:lua require('telescope.builtin').find_files()<CR>"),
dashboard.button("q", icons.ui.SignOut .. " Quit", "<CMD>qa<CR>"), dashboard.button("e", icons.FileTree .. " Browse files", "<Cmd>Lf<CR>"),
dashboard.button("q", icons.Leave .. " Quit", "<Cmd>qa<CR>"),
} }
dashboard.section.footer.val = "Behold: a Snail's Vim" dashboard.section.footer.val = "Behold: a Snail's Vim"
dashboard.section.footer.opts.hl = "Type" dashboard.config.layout = {
dashboard.section.header.opts.hl = "Include" { type = "padding", val = vim.fn.max { 2, vim.fn.floor(vim.fn.winheight(0) * 0.2) } },
dashboard.section.buttons.opts.hl = "Keyword" dashboard.section.header,
{ type = "padding", val = 5 },
dashboard.section.buttons,
{ type = "padding", val = 3 },
dashboard.section.footer,
}
-- dashboard.opts.opts.noautocmd = true dashboard.config.opts.noautocmd = true
return dashboard.opts
return dashboard
end
M.config = function(_, opts)
require("alpha").setup(opts.config)
vim.api.nvim_create_autocmd("User", {
pattern = "LazyVimStarted",
desc = "Add Alpha dashboard footer",
once = true,
callback = function()
local stats = require("lazy").stats()
local ms = math.floor(stats.startuptime * 100 + 0.5) / 100
opts.section.footer.val = { stats.count .. "" .. ms .. "ms" }
pcall(vim.cmd.AlphaRedraw)
end,
})
end end
return M return M

View File

@ -8,9 +8,9 @@ M.opts = function()
local function diagnostics_indicator(_, _, diagnostics, _) local function diagnostics_indicator(_, _, diagnostics, _)
local result = {} local result = {}
local symbols = { local symbols = {
error = icons.DiagnosticError, error = icons.Error,
warning = icons.DiagnosticWarning, warning = icons.Warn,
info = icons.DiagnosticInformation, info = icons.Info,
} }
for name, count in pairs(diagnostics) do for name, count in pairs(diagnostics) do
if symbols[name] and count > 0 then if symbols[name] and count > 0 then
@ -36,11 +36,11 @@ M.opts = function()
indicator = { indicator = {
style = "none", style = "none",
}, },
buffer_close_icon = icons.ui.Close, buffer_close_icon = icons.Close,
modified_icon = icons.ui.Circle, modified_icon = icons.Modified,
close_icon = icons.ui.BoldClose, close_icon = icons.Close,
left_trunc_marker = icons.ui.ArrowCircleLeft, left_trunc_marker = icons.Truncate,
right_trunc_marker = icons.ui.ArrowCircleRight, right_trunc_marker = icons.Truncate,
diagnostics = "nvim_lsp", diagnostics = "nvim_lsp",
diagnostics_indicator = diagnostics_indicator, diagnostics_indicator = diagnostics_indicator,
offsets = {}, offsets = {},

View File

@ -6,12 +6,12 @@ local icons = require('config.icons')
M.opts = { M.opts = {
signs = { signs = {
add = { text = icons.git.LineAdded }, add = { text = icons.Added },
change = { text = icons.git.LineModified }, change = { text = icons.Modified },
delete = { text = icons.git.LineRemoved }, delete = { text = icons.Removed },
topdelete = { text = icons.git.LineRemoved }, topdelete = { text = icons.Removed },
changedelete = { text = icons.git.FileRenamed }, changedelete = { text = icons.ChangeDelete },
untracked = { text = icons.git.FileIgnored }, untracked = { text = icons.Untracked },
}, },
} }

View File

@ -4,24 +4,6 @@ M.main = "ibl"
M.event = { "BufReadPost", "BufNewFile" } M.event = { "BufReadPost", "BufNewFile" }
-- FIX: This keybind is broken and should be moved to config/keymaps.lua
-- M.keys = {
-- {
-- "<c-c>",
-- function()
-- local ok, start = require("indent_blankline.utils").get_current_context(
-- vim.g.indent_blankline_context_patterns,
-- vim.g.indent_blankline_use_treesitter_scope
-- )
-- if ok then
-- vim.api.nvim_win_set_cursor(vim.api.nvim_get_current_win(), { start, 0 })
-- vim.cmd [[normal! _]]
-- end
-- end,
-- desc = "Jump to context",
-- },
-- }
M.dependencies = { M.dependencies = {
"nvim-treesitter", "nvim-treesitter",
} }

View File

@ -179,9 +179,9 @@ M.opts = function()
'diagnostics', 'diagnostics',
sources = { 'nvim_diagnostic' }, sources = { 'nvim_diagnostic' },
symbols = { symbols = {
error = icons.DiagnosticError .. ' ', error = icons.Error .. ' ',
warn = icons.DiagnosticWarn .. ' ', warn = icons.Warn .. ' ',
info = icons.DiagnosticInfo .. ' ', info = icons.Info .. ' ',
}, },
diagnostics_color = { diagnostics_color = {
color_error = { fg = colors.red }, color_error = { fg = colors.red },

View File

@ -1,11 +1,19 @@
local M = { "folke/todo-comments.nvim" } local M = { "folke/todo-comments.nvim" }
local icons = require('config.icons')
M.event = { "BufReadPost", "BufNewFile" } M.event = { "BufReadPost", "BufNewFile" }
M.config = { M.config = {
highlight = { signs = false,
multiline = false keywords = {
} BUG = { icon = icons.Bug, color = "error", alt = { "FIXME", "FIX", "FIXIT", "ISSUE" } },
TODO = { icon = icons.Task, color = "info" },
HACK = { icon = icons.Flame, color = "warning" },
WARN = { icon = icons.Warn, color = "warning", alt = { "WARNING", "XXX" } },
PERF = { icon = icons.Speed, alt = { "OPTIM", "PERFORMANCE", "OPTIMIZE" } },
NOTE = { icon = icons.Buffer, color = "hint", alt = { "INFO" } },
TEST = { icon = icons.Test, color = "test", alt = { "TESTING", "PASSED", "FAILED" } },
},
} }
return M return M

View File

@ -17,9 +17,9 @@ M.opts = {
} }
}, },
icons = { icons = {
breadcrumb = icons.ui.DoubleChevronRight, breadcrumb = icons.Selected,
separator = icons.ui.BoldArrowRight, separator = icons.Selected,
group = icons.ui.Plus, group = icons.Buffer .. "",
}, },
hidden = { "<silent>", "<cmd>", "<Cmd>", "<CR>", "call", "lua", "^:", "^ " }, hidden = { "<silent>", "<cmd>", "<Cmd>", "<CR>", "call", "lua", "^:", "^ " },
triggers = "auto", triggers = "auto",