Merge branch 'main' of github.com:LarssonMartin1998/.dotfiles
This commit is contained in:
commit
3754b11751
14 changed files with 358 additions and 261 deletions
6
flake.lock
generated
6
flake.lock
generated
|
|
@ -42,11 +42,11 @@
|
||||||
"nixpkgs": "nixpkgs_2"
|
"nixpkgs": "nixpkgs_2"
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1753005798,
|
"lastModified": 1753265205,
|
||||||
"narHash": "sha256-k96HUXcTSRlyCl59KIWCa6vKoC3C0WI9Fv1lr0MI95w=",
|
"narHash": "sha256-/G6fub1lmVGMrARuZWiDc1ATVxteACx8wR4CNpc2yic=",
|
||||||
"owner": "LarssonMartin1998",
|
"owner": "LarssonMartin1998",
|
||||||
"repo": "colorsync",
|
"repo": "colorsync",
|
||||||
"rev": "28751b339de4560acd31f3759d9e6ccd45a2e47e",
|
"rev": "8585a2e58ea23c6bb5e41f6c1dce177db58aa975",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
|
|
||||||
|
|
@ -21,6 +21,10 @@ let
|
||||||
"YouTube"
|
"YouTube"
|
||||||
"https://www.youtube.com/"
|
"https://www.youtube.com/"
|
||||||
]
|
]
|
||||||
|
[
|
||||||
|
"ChatGPT"
|
||||||
|
"https://www.chatgpt.com/"
|
||||||
|
]
|
||||||
];
|
];
|
||||||
|
|
||||||
extensions = with nur.repos.rycee.firefox-addons; [
|
extensions = with nur.repos.rycee.firefox-addons; [
|
||||||
|
|
|
||||||
|
|
@ -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,3 +1,6 @@
|
||||||
|
local uv = vim.loop
|
||||||
|
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 })
|
||||||
for _, member in ipairs(others) do
|
for _, member in ipairs(others) do
|
||||||
|
|
@ -25,85 +28,112 @@ end
|
||||||
|
|
||||||
return {
|
return {
|
||||||
"Shatur/neovim-ayu",
|
"Shatur/neovim-ayu",
|
||||||
|
priority = 1010,
|
||||||
config = function()
|
config = function()
|
||||||
local ayu = require("ayu")
|
local function set_colorscheme()
|
||||||
local colors = require("ayu.colors")
|
utils.colorsync_theme = vim.fn.system({ "colorsync", "get" }):gsub("%s+", "")
|
||||||
colors.generate(true)
|
vim.o.background = utils.colorsync_theme == "ayulight" and "light" or "dark"
|
||||||
|
|
||||||
local overrides = {
|
local is_mirage = utils.colorsync_theme == "ayumirage"
|
||||||
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({
|
local ayu = require("ayu")
|
||||||
mirage = true,
|
utils.ayu_colors = require("ayu.colors")
|
||||||
terminal = false,
|
utils.ayu_colors.generate(is_mirage)
|
||||||
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()
|
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
|
||||||
|
|
||||||
|
vim.api.nvim_create_augroup("ColorsyncEvents", { clear = true })
|
||||||
|
|
||||||
|
local filepath = os.getenv("HOME") .. "/.local/state/colorsync/current"
|
||||||
|
local handle = uv.new_fs_event()
|
||||||
|
handle:start(filepath, {}, function(err)
|
||||||
|
if err then
|
||||||
|
vim.notify("Error watching: " .. filepath .. "\n" .. err)
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
vim.schedule(function()
|
||||||
|
set_colorscheme()
|
||||||
|
vim.api.nvim_exec_autocmds("User", { pattern = "ColorsyncThemeChanged" })
|
||||||
|
vim.api.nvim_exec_autocmds("ColorScheme", {})
|
||||||
|
end)
|
||||||
|
end)
|
||||||
|
|
||||||
|
set_colorscheme()
|
||||||
|
|
||||||
-- Fix nuances of the colorscheme in different languages.
|
-- Fix nuances of the colorscheme in different languages.
|
||||||
-- These changes needs to run after the colorscheme is set.
|
-- These changes needs to run after the colorscheme is set.
|
||||||
|
|
|
||||||
|
|
@ -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)
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,31 @@
|
||||||
format_for_tmux() {
|
THEME=$(colorsync get)
|
||||||
fg="#1F2430"
|
|
||||||
bg="#73D0FF"
|
default() {
|
||||||
|
bg="#95E6CB"
|
||||||
|
fg="#000000"
|
||||||
|
text_col="#BFBDB6"
|
||||||
|
}
|
||||||
|
|
||||||
|
case "$THEME" in
|
||||||
|
ayudark)
|
||||||
|
default
|
||||||
|
;;
|
||||||
|
ayumirage)
|
||||||
|
bg="#95E6CB"
|
||||||
|
fg="#101521"
|
||||||
text_col="#CCCAC2"
|
text_col="#CCCAC2"
|
||||||
|
;;
|
||||||
|
ayulight)
|
||||||
|
bg="#4CBF99"
|
||||||
|
fg="#F3F4F5"
|
||||||
|
text_col="#5C6166"
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
default
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
format_for_tmux() {
|
||||||
echo $1 | gawk -v bg="$bg" -v fg="$fg" -v text_col="$text_col" '{printf("#[default]#[fg="bg"]#[default]#[bg="bg", fg="fg", bold]%s #[default]#[fg="bg"]#[default]#[fg="text_col"] %s", substr($0, 1, 1), substr($0, 2))}'
|
echo $1 | gawk -v bg="$bg" -v fg="$fg" -v text_col="$text_col" '{printf("#[default]#[fg="bg"]#[default]#[bg="bg", fg="fg", bold]%s #[default]#[fg="bg"]#[default]#[fg="text_col"] %s", substr($0, 1, 1), substr($0, 2))}'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
28
tmux/tmux-statusbar-color.sh
Executable file
28
tmux/tmux-statusbar-color.sh
Executable file
|
|
@ -0,0 +1,28 @@
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
THEME=$(colorsync get)
|
||||||
|
|
||||||
|
default() {
|
||||||
|
tmux set-option -g status-bg "#000000"
|
||||||
|
tmux setw -g window-status-format "#[bg=#000000,fg=#BFBDB6] #[bold]#I #[default] #[fg=#59C2FF]#W #[default]"
|
||||||
|
tmux setw -g window-status-current-format "#[bg=#95E6CB,fg=#000000] #[bold]#I #[default] #[fg=#FF8F40]#W #[default]"
|
||||||
|
}
|
||||||
|
|
||||||
|
case "$THEME" in
|
||||||
|
ayudark)
|
||||||
|
default
|
||||||
|
;;
|
||||||
|
ayumirage)
|
||||||
|
tmux set-option -g status-bg "#101521"
|
||||||
|
tmux setw -g window-status-format "#[bg=#101521,fg=#CCCAC2] #[bold]#I #[default] #[fg=#73D0FF]#W #[default]"
|
||||||
|
tmux setw -g window-status-current-format "#[bg=#95E6CB,fg=#101521] #[bold]#I #[default] #[fg=#FFCC66]#W #[default]"
|
||||||
|
;;
|
||||||
|
ayulight)
|
||||||
|
tmux set-option -g status-bg "#F0F0F0"
|
||||||
|
tmux setw -g window-status-format "#[bg=#F0F0F0,fg=#5C6166] #[bold]#I #[default] #[fg=#399EE6]#W #[default]"
|
||||||
|
tmux setw -g window-status-current-format "#[bg=#4CBF99,fg=#F0F0F0] #[bold]#I #[default] #[fg=#FA8D3E]#W #[default]"
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
default
|
||||||
|
;;
|
||||||
|
esac
|
||||||
4
tmux/tmux-watchman-statuscolor-trigger.sh
Executable file
4
tmux/tmux-watchman-statuscolor-trigger.sh
Executable file
|
|
@ -0,0 +1,4 @@
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
watchman watch-project "$HOME/.local/state/colorsync"
|
||||||
|
watchman -- trigger "$HOME/.local/state/colorsync" tmux_statusbar_color 'current' -- bash "$HOME/.config/tmux/tmux-statusbar-color.sh"
|
||||||
|
|
@ -107,7 +107,7 @@ set -g history-limit 50000
|
||||||
set -g display-time 2500
|
set -g display-time 2500
|
||||||
|
|
||||||
# Refresh 'status-left' and 'status-right' more often, from every 15s to 5s
|
# Refresh 'status-left' and 'status-right' more often, from every 15s to 5s
|
||||||
set -g status-interval 2
|
set -g status-interval 5
|
||||||
|
|
||||||
# Focus events enabled for terminals that support them
|
# Focus events enabled for terminals that support them
|
||||||
set -g focus-events on
|
set -g focus-events on
|
||||||
|
|
@ -121,13 +121,11 @@ setw -g automatic-rename off
|
||||||
set-hook -g after-new-window "run-shell '~/.config/tmux/tmux-rename-window.sh | xargs tmux rename-window'"
|
set-hook -g after-new-window "run-shell '~/.config/tmux/tmux-rename-window.sh | xargs tmux rename-window'"
|
||||||
set-hook -g pane-focus-in "run-shell '~/.config/tmux/tmux-rename-window.sh | xargs tmux rename-window'"
|
set-hook -g pane-focus-in "run-shell '~/.config/tmux/tmux-rename-window.sh | xargs tmux rename-window'"
|
||||||
|
|
||||||
setw -g window-status-format "#[bg=#171B24,fg=#CCCAC2] #[bold]#I #[default] #[fg=#73D0FF]#W #[default]"
|
|
||||||
setw -g window-status-current-format "#[bg=#757B84,fg=#EFEDE7] #[bold]#I #[default] #[fg=#FFAD66]#W #[default]"
|
|
||||||
|
|
||||||
# Set the right status: Battery, date and time, session name
|
# Set the right status: Battery, date and time, session name
|
||||||
set -g status-right "#($HOME/.config/tmux/tmux-status-right.sh)"
|
set -g status-right "#($HOME/.config/tmux/tmux-status-right.sh)"
|
||||||
|
run-shell '~/.config/tmux/tmux-statusbar-color.sh'
|
||||||
|
run-shell '~/.config/tmux/tmux-watchman-statuscolor.sh'
|
||||||
|
|
||||||
set -g status-bg "#171B24"
|
|
||||||
set -g status-style bold
|
set -g status-style bold
|
||||||
|
|
||||||
# SSH agent forwarding
|
# SSH agent forwarding
|
||||||
|
|
|
||||||
|
|
@ -27,7 +27,6 @@ set_custom_keybindings() {
|
||||||
|
|
||||||
init() {
|
init() {
|
||||||
[ -f ~/.fzf.zsh ] && source ~/.fzf.zsh
|
[ -f ~/.fzf.zsh ] && source ~/.fzf.zsh
|
||||||
[ -f ~/.local/state/colorsync/current ] && source ~/.local/state/colorsync/current
|
|
||||||
[ -f ~/.zshrc_local ] && source ~/.zshrc_local
|
[ -f ~/.zshrc_local ] && source ~/.zshrc_local
|
||||||
eval "$(fzf --zsh)"
|
eval "$(fzf --zsh)"
|
||||||
eval "$(zoxide init --cmd cd zsh)"
|
eval "$(zoxide init --cmd cd zsh)"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue