Integrate seamless, automatic, and persistent colorscheme switching for all neovim
plugins in my config
This commit is contained in:
parent
76a2e58ab8
commit
9c5a1479b7
7 changed files with 277 additions and 262 deletions
|
|
@ -1,16 +0,0 @@
|
||||||
local has_generated = false
|
|
||||||
local colors = require("ayu.colors")
|
|
||||||
colors.generate(true)
|
|
||||||
|
|
||||||
local M = {}
|
|
||||||
|
|
||||||
function M.get()
|
|
||||||
if not has_generated then
|
|
||||||
colors.generate(true)
|
|
||||||
has_generated = true
|
|
||||||
end
|
|
||||||
|
|
||||||
return colors
|
|
||||||
end
|
|
||||||
|
|
||||||
return M
|
|
||||||
|
|
@ -1,30 +1,35 @@
|
||||||
local theme_colors = require("ayu.colors")
|
local utils = require("utils")
|
||||||
theme_colors.generate(true)
|
|
||||||
-- These are not apart of the Ayu color theme, however, I needed these
|
|
||||||
-- colors while still fitting in with the rest
|
|
||||||
local ayu_turquoise = "#5CCFE6"
|
|
||||||
local ayu_dark_blue = "#3A7BD5"
|
|
||||||
|
|
||||||
local colors = {
|
local function setup_colors()
|
||||||
info = ayu_dark_blue,
|
-- These are not apart of the Ayu color theme, however, I needed these
|
||||||
hint = ayu_turquoise,
|
-- colors while still fitting in with the rest
|
||||||
warning = theme_colors.warning,
|
local ayu_turquoise = "#5CCFE6"
|
||||||
error = theme_colors.error,
|
local ayu_dark_blue = "#3A7BD5"
|
||||||
}
|
|
||||||
|
|
||||||
for _, highlight in ipairs({
|
local colors = {
|
||||||
{ "DiagnosticUnderlineInfo", { undercurl = true, sp = colors.info } },
|
info = ayu_dark_blue,
|
||||||
{ "DiagnosticUnderlineHint", { undercurl = true, sp = colors.hint } },
|
hint = ayu_turquoise,
|
||||||
{ "DiagnosticUnderlineWarn", { undercurl = true, sp = colors.warning } },
|
warning = utils.ayu_colors.warning,
|
||||||
{ "DiagnosticUnderlineError", { undercurl = true, sp = colors.error } },
|
error = utils.ayu_colors.error,
|
||||||
{ "DiagnosticInfo", { fg = colors.info } },
|
}
|
||||||
{ "DiagnosticHint", { fg = colors.hint } },
|
|
||||||
{ "DiagnosticWarn", { fg = colors.warning } },
|
for _, highlight in ipairs({
|
||||||
{ "DiagnosticError", { fg = colors.error } },
|
{ "DiagnosticUnderlineInfo", { undercurl = true, sp = colors.info } },
|
||||||
}) do
|
{ "DiagnosticUnderlineHint", { undercurl = true, sp = colors.hint } },
|
||||||
vim.api.nvim_set_hl(0, highlight[1], highlight[2])
|
{ "DiagnosticUnderlineWarn", { undercurl = true, sp = colors.warning } },
|
||||||
|
{ "DiagnosticUnderlineError", { undercurl = true, sp = colors.error } },
|
||||||
|
{ "DiagnosticInfo", { fg = colors.info } },
|
||||||
|
{ "DiagnosticHint", { fg = colors.hint } },
|
||||||
|
{ "DiagnosticWarn", { fg = colors.warning } },
|
||||||
|
{ "DiagnosticError", { fg = colors.error } },
|
||||||
|
}) do
|
||||||
|
vim.api.nvim_set_hl(0, highlight[1], highlight[2])
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
utils.create_user_event_cb("ColorsyncThemeChanged", setup_colors, "ColorsyncEvents")
|
||||||
|
setup_colors()
|
||||||
|
|
||||||
local sev = vim.diagnostic.severity
|
local sev = vim.diagnostic.severity
|
||||||
vim.diagnostic.config({
|
vim.diagnostic.config({
|
||||||
underline = true,
|
underline = true,
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
local uv = vim.loop
|
local uv = vim.loop
|
||||||
local api = vim.api
|
local utils = require("utils")
|
||||||
|
|
||||||
local function force_color_from_reference_on_others(others, reference)
|
local function force_color_from_reference_on_others(others, reference)
|
||||||
local reference_hl = vim.api.nvim_get_hl(0, { name = reference })
|
local reference_hl = vim.api.nvim_get_hl(0, { name = reference })
|
||||||
|
|
@ -28,104 +28,109 @@ end
|
||||||
|
|
||||||
return {
|
return {
|
||||||
"Shatur/neovim-ayu",
|
"Shatur/neovim-ayu",
|
||||||
|
priority = 1010,
|
||||||
config = function()
|
config = function()
|
||||||
local ayu = require("ayu")
|
|
||||||
local colors = require("ayu.colors")
|
|
||||||
colors.generate(true)
|
|
||||||
|
|
||||||
local overrides = {
|
|
||||||
global_variable = {
|
|
||||||
underline = true,
|
|
||||||
italic = true,
|
|
||||||
},
|
|
||||||
member_variable = {
|
|
||||||
bold = true,
|
|
||||||
},
|
|
||||||
namespace = {
|
|
||||||
italic = true,
|
|
||||||
fg = colors.markup,
|
|
||||||
},
|
|
||||||
pre_process = {
|
|
||||||
fg = colors.keyword,
|
|
||||||
},
|
|
||||||
default_type = {
|
|
||||||
fg = colors.regexp
|
|
||||||
},
|
|
||||||
type = {
|
|
||||||
fg = colors.entity,
|
|
||||||
},
|
|
||||||
}
|
|
||||||
|
|
||||||
ayu.setup({
|
|
||||||
mirage = true,
|
|
||||||
terminal = false,
|
|
||||||
overrides = {
|
|
||||||
-- TRANSPARENCY
|
|
||||||
-- Normal = { bg = "none" },
|
|
||||||
-- NormalFloat = { bg = "none" },
|
|
||||||
-- ColorColumn = { bg = "none" },
|
|
||||||
-- SignColumn = { bg = "none" },
|
|
||||||
-- Folded = { bg = "none" },
|
|
||||||
-- FoldColumn = { bg = "none" },
|
|
||||||
-- CursorColumn = { bg = "none" },
|
|
||||||
-- VertSplit = { bg = "none" },
|
|
||||||
-- TRANSPARENCY
|
|
||||||
CursorLineNr = { bg = "none" },
|
|
||||||
["@property"] = overrides.member_variable,
|
|
||||||
["PreProc"] = overrides.pre_process,
|
|
||||||
--CPP
|
|
||||||
["@lsp.typemod.variable.fileScope.cpp"] = overrides.global_variable,
|
|
||||||
["@lsp.type.namespace.cpp"] = overrides.namespace,
|
|
||||||
["@type.builtin.cpp"] = overrides.default_type,
|
|
||||||
-- CPP
|
|
||||||
--
|
|
||||||
-- Rust
|
|
||||||
["@lsp.type.struct.rust"] = overrides.type,
|
|
||||||
["@lsp.type.namespace.rust"] = overrides.namespace,
|
|
||||||
["@lsp.type.builtinType.rust"] = overrides.default_type,
|
|
||||||
-- Rust
|
|
||||||
--
|
|
||||||
-- C
|
|
||||||
["@lsp.typemod.variable.globalScope.c"] = overrides.global_variable,
|
|
||||||
["@type.builtin.c"] = overrides.default_type,
|
|
||||||
-- C
|
|
||||||
--
|
|
||||||
-- Go
|
|
||||||
-- ["@module.go"] = overrides.namespace, -- The go LSP is not reliable enough for this sadly, sometimes it adds module tokens and sometimes it doesnt.
|
|
||||||
["@variable.member.go"] = overrides.member_variable,
|
|
||||||
["@type.builtin.go"] = overrides.default_type,
|
|
||||||
-- Go
|
|
||||||
--
|
|
||||||
-- Zig
|
|
||||||
["@module.zig"] = overrides.namespace,
|
|
||||||
["@type.builtin.zig"] = overrides.default_type,
|
|
||||||
["@function.builtin.zig"] = overrides.default_type,
|
|
||||||
-- ["@variable.member.zig"] = overrides.member_variable,-- Cant have bold member variable in zig, they don't differentiate function calls/accessors from variables, they are all just "members" .... BS LSP
|
|
||||||
-- ["@variable.parameter"] = {},-- Zig LSP is lacking, a parameter is marked as a regular variable outside of it's definition, can't separate between them.
|
|
||||||
-- Zig
|
|
||||||
},
|
|
||||||
})
|
|
||||||
|
|
||||||
local function set_colorscheme()
|
local function set_colorscheme()
|
||||||
local active_theme = vim.fn.system({ "colorsync", "get" }):gsub("%s+", "")
|
utils.colorsync_theme = vim.fn.system({ "colorsync", "get" }):gsub("%s+", "")
|
||||||
if active_theme == "ayulight" then
|
vim.o.background = utils.colorsync_theme == "ayulight" and "light" or "dark"
|
||||||
api.nvim_command("colorscheme ayu-light")
|
|
||||||
elseif active_theme == "ayumirage" then
|
local is_mirage = utils.colorsync_theme == "ayumirage"
|
||||||
api.nvim_command("colorscheme ayu-mirage")
|
|
||||||
else
|
local ayu = require("ayu")
|
||||||
api.nvim_command("colorscheme ayu-dark")
|
utils.ayu_colors = require("ayu.colors")
|
||||||
end
|
utils.ayu_colors.generate(is_mirage)
|
||||||
|
|
||||||
|
local overrides = {
|
||||||
|
global_variable = {
|
||||||
|
underline = true,
|
||||||
|
italic = true,
|
||||||
|
},
|
||||||
|
member_variable = {
|
||||||
|
bold = true,
|
||||||
|
},
|
||||||
|
namespace = {
|
||||||
|
italic = true,
|
||||||
|
fg = utils.ayu_colors.markup,
|
||||||
|
},
|
||||||
|
pre_process = {
|
||||||
|
fg = utils.ayu_colors.keyword,
|
||||||
|
},
|
||||||
|
default_type = {
|
||||||
|
fg = utils.ayu_colors.regexp
|
||||||
|
},
|
||||||
|
type = {
|
||||||
|
fg = utils.ayu_colors.entity,
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
ayu.setup({
|
||||||
|
mirage = is_mirage,
|
||||||
|
terminal = false,
|
||||||
|
overrides = {
|
||||||
|
-- TRANSPARENCY
|
||||||
|
-- Normal = { bg = "none" },
|
||||||
|
-- NormalFloat = { bg = "none" },
|
||||||
|
-- ColorColumn = { bg = "none" },
|
||||||
|
-- SignColumn = { bg = "none" },
|
||||||
|
-- Folded = { bg = "none" },
|
||||||
|
-- FoldColumn = { bg = "none" },
|
||||||
|
-- CursorColumn = { bg = "none" },
|
||||||
|
-- VertSplit = { bg = "none" },
|
||||||
|
-- TRANSPARENCY
|
||||||
|
CursorLineNr = { bg = "none" },
|
||||||
|
["@property"] = overrides.member_variable,
|
||||||
|
["PreProc"] = overrides.pre_process,
|
||||||
|
--CPP
|
||||||
|
["@lsp.typemod.variable.fileScope.cpp"] = overrides.global_variable,
|
||||||
|
["@lsp.type.namespace.cpp"] = overrides.namespace,
|
||||||
|
["@type.builtin.cpp"] = overrides.default_type,
|
||||||
|
-- CPP
|
||||||
|
--
|
||||||
|
-- Rust
|
||||||
|
["@lsp.type.struct.rust"] = overrides.type,
|
||||||
|
["@lsp.type.namespace.rust"] = overrides.namespace,
|
||||||
|
["@lsp.type.builtinType.rust"] = overrides.default_type,
|
||||||
|
-- Rust
|
||||||
|
--
|
||||||
|
-- C
|
||||||
|
["@lsp.typemod.variable.globalScope.c"] = overrides.global_variable,
|
||||||
|
["@type.builtin.c"] = overrides.default_type,
|
||||||
|
-- C
|
||||||
|
--
|
||||||
|
-- Go
|
||||||
|
-- ["@module.go"] = overrides.namespace, -- The go LSP is not reliable enough for this sadly, sometimes it adds module tokens and sometimes it doesnt.
|
||||||
|
["@variable.member.go"] = overrides.member_variable,
|
||||||
|
["@type.builtin.go"] = overrides.default_type,
|
||||||
|
-- Go
|
||||||
|
--
|
||||||
|
-- Zig
|
||||||
|
["@module.zig"] = overrides.namespace,
|
||||||
|
["@type.builtin.zig"] = overrides.default_type,
|
||||||
|
["@function.builtin.zig"] = overrides.default_type,
|
||||||
|
-- ["@variable.member.zig"] = overrides.member_variable,-- Cant have bold member variable in zig, they don't differentiate function calls/accessors from variables, they are all just "members" .... BS LSP
|
||||||
|
-- ["@variable.parameter"] = {},-- Zig LSP is lacking, a parameter is marked as a regular variable outside of it's definition, can't separate between them.
|
||||||
|
-- Zig
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
|
ayu.colorscheme()
|
||||||
end
|
end
|
||||||
|
|
||||||
|
vim.api.nvim_create_augroup("ColorsyncEvents", { clear = true })
|
||||||
|
|
||||||
local filepath = os.getenv("HOME") .. "/.local/state/colorsync/current"
|
local filepath = os.getenv("HOME") .. "/.local/state/colorsync/current"
|
||||||
local handle = uv.new_fs_event()
|
local handle = uv.new_fs_event()
|
||||||
handle:start(filepath, {}, function(err, filename, status)
|
handle:start(filepath, {}, function(err)
|
||||||
if err then
|
if err then
|
||||||
vim.notify("Error watching: " .. filepath .. "\n" .. err)
|
vim.notify("Error watching: " .. filepath .. "\n" .. err)
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
vim.schedule(set_colorscheme)
|
vim.schedule(function()
|
||||||
|
set_colorscheme()
|
||||||
|
vim.api.nvim_exec_autocmds("User", { pattern = "ColorsyncThemeChanged" })
|
||||||
|
vim.api.nvim_exec_autocmds("ColorScheme", {})
|
||||||
|
end)
|
||||||
end)
|
end)
|
||||||
|
|
||||||
set_colorscheme()
|
set_colorscheme()
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,5 @@
|
||||||
|
local utils = require("utils")
|
||||||
|
|
||||||
return {
|
return {
|
||||||
"b0o/incline.nvim",
|
"b0o/incline.nvim",
|
||||||
dependencies = {
|
dependencies = {
|
||||||
|
|
@ -10,111 +12,116 @@ return {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
event = "VeryLazy",
|
config = function()
|
||||||
lazy = true,
|
local function setup_incline()
|
||||||
opts = {
|
require("incline").setup({
|
||||||
window = {
|
window = {
|
||||||
padding = 0,
|
padding = 0,
|
||||||
},
|
},
|
||||||
hide = {
|
hide = {
|
||||||
cursorline = false,
|
cursorline = false,
|
||||||
},
|
},
|
||||||
render = function(props)
|
render = function(props)
|
||||||
local fullpath = vim.api.nvim_buf_get_name(props.buf)
|
local fullpath = vim.api.nvim_buf_get_name(props.buf)
|
||||||
local filename = vim.fn.fnamemodify(fullpath, ":t")
|
local filename = vim.fn.fnamemodify(fullpath, ":t")
|
||||||
if filename == "" then
|
if filename == "" then
|
||||||
filename = "[No Name]"
|
filename = "[No Name]"
|
||||||
end
|
|
||||||
|
|
||||||
local function get_ft_icon()
|
|
||||||
local ft_icon, ft_color = require("nvim-web-devicons").get_icon_color(filename)
|
|
||||||
return { (ft_icon or "") .. " ", guifg = ft_color, guibg = "none" }
|
|
||||||
end
|
|
||||||
|
|
||||||
local function get_file_path()
|
|
||||||
local path_display = ""
|
|
||||||
if fullpath == "" then
|
|
||||||
path_display = filename
|
|
||||||
else
|
|
||||||
local parts = {}
|
|
||||||
for part in string.gmatch(vim.fn.fnamemodify(fullpath, ":.:h"), "[^/]+") do
|
|
||||||
table.insert(parts, part)
|
|
||||||
end
|
end
|
||||||
|
|
||||||
local ellipsis = "…"
|
local function get_ft_icon()
|
||||||
local max_path_parts = 2
|
local ft_icon, ft_color = require("nvim-web-devicons").get_icon_color(filename)
|
||||||
if #parts > max_path_parts then
|
return { (ft_icon or "") .. " ", guifg = ft_color, guibg = "none" }
|
||||||
local start_index = #parts - max_path_parts + 1
|
|
||||||
path_display = ellipsis .. "/" .. table.concat(parts, "/", start_index)
|
|
||||||
elseif #parts > 0 then
|
|
||||||
path_display = table.concat(parts, "/")
|
|
||||||
end
|
end
|
||||||
|
|
||||||
if path_display ~= "" then
|
local function get_file_path()
|
||||||
path_display = path_display .. "/" .. filename
|
local path_display = ""
|
||||||
else
|
if fullpath == "" then
|
||||||
path_display = filename
|
path_display = filename
|
||||||
|
else
|
||||||
|
local parts = {}
|
||||||
|
for part in string.gmatch(vim.fn.fnamemodify(fullpath, ":.:h"), "[^/]+") do
|
||||||
|
table.insert(parts, part)
|
||||||
|
end
|
||||||
|
|
||||||
|
local ellipsis = "…"
|
||||||
|
local max_path_parts = 2
|
||||||
|
if #parts > max_path_parts then
|
||||||
|
local start_index = #parts - max_path_parts + 1
|
||||||
|
path_display = ellipsis .. "/" .. table.concat(parts, "/", start_index)
|
||||||
|
elseif #parts > 0 then
|
||||||
|
path_display = table.concat(parts, "/")
|
||||||
|
end
|
||||||
|
|
||||||
|
if path_display ~= "" then
|
||||||
|
path_display = path_display .. "/" .. filename
|
||||||
|
else
|
||||||
|
path_display = filename
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
return { path_display .. " ┊", gui = vim.bo[props.buf].modified and "bold,italic" or "bold" }
|
||||||
end
|
end
|
||||||
end
|
|
||||||
|
|
||||||
return { path_display .. " ┊", gui = vim.bo[props.buf].modified and "bold,italic" or "bold" }
|
local function get_git_diff()
|
||||||
end
|
local icons = { removed = "", changed = "", added = "" }
|
||||||
|
local signs = vim.b[props.buf].gitsigns_status_dict
|
||||||
local function get_git_diff()
|
local labels = {}
|
||||||
local icons = { removed = "", changed = "", added = "" }
|
if signs == nil then
|
||||||
local signs = vim.b[props.buf].gitsigns_status_dict
|
return labels
|
||||||
local labels = {}
|
end
|
||||||
if signs == nil then
|
for name, icon in pairs(icons) do
|
||||||
return labels
|
if tonumber(signs[name]) and signs[name] > 0 then
|
||||||
end
|
table.insert(labels, { icon .. " " .. signs[name] .. " ", group = "Diff" .. name })
|
||||||
for name, icon in pairs(icons) do
|
end
|
||||||
if tonumber(signs[name]) and signs[name] > 0 then
|
end
|
||||||
table.insert(labels, { icon .. " " .. signs[name] .. " ", group = "Diff" .. name })
|
if #labels > 0 then
|
||||||
|
table.insert(labels, { "┊ " })
|
||||||
|
end
|
||||||
|
return labels
|
||||||
end
|
end
|
||||||
end
|
|
||||||
if #labels > 0 then
|
|
||||||
table.insert(labels, { "┊ " })
|
|
||||||
end
|
|
||||||
return labels
|
|
||||||
end
|
|
||||||
|
|
||||||
local function get_diagnostic_label()
|
local function get_diagnostic_label()
|
||||||
local icons = { error = "", warn = "", info = "", hint = "" }
|
local icons = { error = "", warn = "", info = "", hint = "" }
|
||||||
local label = {}
|
local label = {}
|
||||||
|
|
||||||
for severity, icon in pairs(icons) do
|
for severity, icon in pairs(icons) do
|
||||||
local n = #vim.diagnostic.get(props.buf,
|
local n = #vim.diagnostic.get(props.buf,
|
||||||
{ severity = vim.diagnostic.severity[string.upper(severity)] })
|
{ severity = vim.diagnostic.severity[string.upper(severity)] })
|
||||||
if n > 0 then
|
if n > 0 then
|
||||||
table.insert(label, { icon .. " " .. n .. " ", group = "DiagnosticSign" .. severity })
|
table.insert(label, { icon .. " " .. n .. " ", group = "DiagnosticSign" .. severity })
|
||||||
|
end
|
||||||
|
end
|
||||||
|
if #label > 0 then
|
||||||
|
table.insert(label, { "┊ " })
|
||||||
|
end
|
||||||
|
return label
|
||||||
end
|
end
|
||||||
end
|
|
||||||
if #label > 0 then
|
|
||||||
table.insert(label, { "┊ " })
|
|
||||||
end
|
|
||||||
return label
|
|
||||||
end
|
|
||||||
|
|
||||||
local function get_arrow_label()
|
local function get_arrow_label()
|
||||||
local statusline = require("arrow.statusline")
|
local statusline = require("arrow.statusline")
|
||||||
if statusline.is_on_arrow_file(props.buf) == nil then
|
if statusline.is_on_arrow_file(props.buf) == nil then
|
||||||
return ""
|
return ""
|
||||||
end
|
end
|
||||||
|
|
||||||
return " " .. statusline.text_for_statusline_with_icons(props.buf)
|
return " " .. statusline.text_for_statusline_with_icons(props.buf)
|
||||||
end
|
end
|
||||||
|
|
||||||
return {
|
return {
|
||||||
guibg = "#1e2030",
|
guibg = utils.ayu_colors.panel_bg,
|
||||||
guifg = "#cad3f5",
|
guifg = utils.ayu_colors.fg,
|
||||||
{ " " },
|
{ " " },
|
||||||
{ get_diagnostic_label() },
|
{ get_diagnostic_label() },
|
||||||
{ get_git_diff() },
|
{ get_git_diff() },
|
||||||
{ get_ft_icon() },
|
{ get_ft_icon() },
|
||||||
{ get_file_path() },
|
{ get_file_path() },
|
||||||
{ get_arrow_label() .. " " .. vim.api.nvim_win_get_number(props.win), group = "DevIconWindows" },
|
{ get_arrow_label() .. " " .. vim.api.nvim_win_get_number(props.win), group = "DevIconWindows" },
|
||||||
{ " " }
|
{ " " }
|
||||||
}
|
}
|
||||||
end,
|
end,
|
||||||
},
|
})
|
||||||
|
end
|
||||||
|
|
||||||
|
utils.create_user_event_cb("ColorsyncThemeChanged", setup_incline, "ColorsyncEvents")
|
||||||
|
setup_incline()
|
||||||
|
end
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,5 @@
|
||||||
|
local utils = require("utils")
|
||||||
|
|
||||||
local saved_hlsearch = false
|
local saved_hlsearch = false
|
||||||
local saved_highlights = {}
|
local saved_highlights = {}
|
||||||
|
|
||||||
|
|
@ -23,7 +25,7 @@ end
|
||||||
|
|
||||||
local function save_and_set_invisible_inlay_hints_hl()
|
local function save_and_set_invisible_inlay_hints_hl()
|
||||||
saved_highlights = vim.api.nvim_get_hl(0, { name = "LspInlayHint" })
|
saved_highlights = vim.api.nvim_get_hl(0, { name = "LspInlayHint" })
|
||||||
vim.api.nvim_set_hl(0, "LspInlayHint", { fg = require("colors").get().bg, bg = "none" })
|
vim.api.nvim_set_hl(0, "LspInlayHint", { fg = utils.ayu_colors.bg, bg = "none" })
|
||||||
end
|
end
|
||||||
|
|
||||||
local function restore_inlay_hints_hl()
|
local function restore_inlay_hints_hl()
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,5 @@
|
||||||
|
local utils = require("utils")
|
||||||
|
|
||||||
local function resize_mode()
|
local function resize_mode()
|
||||||
if require("window_management").is_in_resizing_mode() then
|
if require("window_management").is_in_resizing_mode() then
|
||||||
return "▲ Resizing ▼ "
|
return "▲ Resizing ▼ "
|
||||||
|
|
@ -26,45 +28,52 @@ return {
|
||||||
},
|
},
|
||||||
event = "VeryLazy",
|
event = "VeryLazy",
|
||||||
lazy = true,
|
lazy = true,
|
||||||
opts = {
|
config = function()
|
||||||
options = {
|
local function setup_lualine()
|
||||||
theme = "ayu",
|
require("lualine").setup({
|
||||||
globalstatus = true,
|
options = {
|
||||||
section_separators = {
|
theme = "ayu",
|
||||||
left = "",
|
globalstatus = true,
|
||||||
right = "",
|
section_separators = {
|
||||||
},
|
left = "",
|
||||||
component_separators = {
|
right = "",
|
||||||
left = "",
|
},
|
||||||
right = ""
|
component_separators = {
|
||||||
},
|
left = "",
|
||||||
icons_enabled = true,
|
right = ""
|
||||||
},
|
},
|
||||||
sections = {
|
icons_enabled = true,
|
||||||
lualine_a = { "mode" },
|
|
||||||
lualine_b = {
|
|
||||||
"branch",
|
|
||||||
{
|
|
||||||
"diagnostics",
|
|
||||||
sources = { "nvim_lsp" },
|
|
||||||
sections = { "error", "warn", "info", "hint" },
|
|
||||||
update_in_insert = false,
|
|
||||||
},
|
},
|
||||||
resize_mode,
|
sections = {
|
||||||
},
|
lualine_a = { "mode" },
|
||||||
lualine_c = { tabs },
|
lualine_b = {
|
||||||
lualine_x = { "encoding", "fileformat", "filetype" },
|
"branch",
|
||||||
lualine_y = { "progress" },
|
{
|
||||||
lualine_z = { "location" }
|
"diagnostics",
|
||||||
},
|
sources = { "nvim_lsp" },
|
||||||
inactive_sections = {
|
sections = { "error", "warn", "info", "hint" },
|
||||||
lualine_a = {},
|
update_in_insert = false,
|
||||||
lualine_b = {},
|
},
|
||||||
lualine_c = {},
|
resize_mode,
|
||||||
lualine_x = {},
|
},
|
||||||
lualine_y = {},
|
lualine_c = { tabs },
|
||||||
lualine_z = {}
|
lualine_x = { "encoding", "fileformat", "filetype" },
|
||||||
},
|
lualine_y = { "progress" },
|
||||||
tabline = {},
|
lualine_z = { "location" }
|
||||||
}
|
},
|
||||||
|
inactive_sections = {
|
||||||
|
lualine_a = {},
|
||||||
|
lualine_b = {},
|
||||||
|
lualine_c = {},
|
||||||
|
lualine_x = {},
|
||||||
|
lualine_y = {},
|
||||||
|
lualine_z = {}
|
||||||
|
},
|
||||||
|
tabline = {},
|
||||||
|
})
|
||||||
|
end
|
||||||
|
|
||||||
|
utils.create_user_event_cb("ColorsyncThemeChanged", setup_lualine, "ColorsyncEvents")
|
||||||
|
setup_lualine()
|
||||||
|
end
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,8 @@
|
||||||
local M = {}
|
local M = {}
|
||||||
|
|
||||||
|
M.colorsync_theme = nil
|
||||||
|
M.ayu_colors = nil
|
||||||
|
|
||||||
function M.set_keymap_list(keymap_list, mode)
|
function M.set_keymap_list(keymap_list, mode)
|
||||||
mode = mode or "n"
|
mode = mode or "n"
|
||||||
M.foreach(keymap_list, function(mapping)
|
M.foreach(keymap_list, function(mapping)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue