Switch theme to norrsken instead of ayu.

This commit is contained in:
Martin Larsson 2026-03-22 23:29:51 +01:00
parent a7c85f076d
commit 0c4bf88aea
21 changed files with 613 additions and 4890 deletions

View file

@ -1,38 +1,6 @@
local utils = require("utils")
local function setup_colors()
-- 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 = {
info = ayu_dark_blue,
hint = ayu_turquoise,
warning = utils.ayu_colors.warning,
error = utils.ayu_colors.error,
}
for _, highlight in ipairs({
{ "DiagnosticUnderlineInfo", { undercurl = true, sp = colors.info } },
{ "DiagnosticUnderlineHint", { undercurl = true, sp = colors.hint } },
{ "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
utils.create_user_event_cb("ColorsyncThemeChanged", setup_colors, "ColorsyncEvents")
setup_colors()
local sev = vim.diagnostic.severity
vim.diagnostic.config({
underline = true,
-- underline = true,
-- This enables the diagnostics at end of line
-- virtual_text = {
-- prefix = "●",

View file

@ -1,153 +0,0 @@
local uv = vim.loop
local utils = require("utils")
local function force_color_from_reference_on_others(others, reference)
local reference_hl = vim.api.nvim_get_hl(0, { name = reference })
for _, member in ipairs(others) do
local property = vim.api.nvim_get_hl(0, { name = member })
property.fg = reference_hl.fg
vim.api.nvim_set_hl(0, member, property)
end
end
local function reset_hl_groups_for_ft(groups_to_reset)
for _, group in ipairs(groups_to_reset) do
local ft = group[1]
local groups = group[2]
vim.api.nvim_create_autocmd("FileType", {
pattern = ft,
callback = function()
for _, group_name in ipairs(groups) do
vim.api.nvim_set_hl(0, group_name, {})
end
end,
})
end
end
return {
"Shatur/neovim-ayu",
priority = 1010,
config = function()
local function set_colorscheme()
utils.colorsync_theme = vim.fn.system({ "colorsync", "get" }):gsub("%s+", "")
vim.o.background = utils.colorsync_theme == "ayulight" and "light" or "dark"
local is_mirage = utils.colorsync_theme == "ayumirage"
local ayu = require("ayu")
utils.ayu_colors = require("ayu.colors")
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,
["@lsp.type.namespace.zig"] = overrides.namespace,
["@type.builtin.zig"] = overrides.default_type,
["@function.builtin.zig"] = overrides.default_type,
["@lsp.type.struct.zig"] = overrides.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.
-- These changes needs to run after the colorscheme is set.
force_color_from_reference_on_others({
"@property",
"@variable.member.go",
"@variable.member",
"@variable.member.zig",
}, "@variable")
reset_hl_groups_for_ft({
{ "go", { "@property", } },
})
end
}

View file

@ -98,8 +98,6 @@ return {
end
return {
guibg = utils.ayu_colors.panel_bg,
guifg = utils.ayu_colors.fg,
{ " " },
{ get_diagnostic_label() },
{ get_git_diff() },

View file

@ -32,7 +32,7 @@ return {
local function setup_lualine()
require("lualine").setup({
options = {
theme = "ayu",
theme = require("norrsken.integrations.lualine"),
globalstatus = true,
section_separators = {
left = "",

View file

@ -0,0 +1,14 @@
return {
"LarssonMartin1998/nvim-norrsken",
priority = 1010,
opts = {
integrations = {
lualine = true,
blink = true,
noice = true,
incline = true,
neogit = true,
tiny_inline_diagnostics = true,
},
},
}

View file

@ -1,7 +1,6 @@
local M = {}
M.colorsync_theme = nil
M.ayu_colors = nil
function M.set_keymap_list(keymap_list, mode)
mode = mode or "n"

View file

@ -10,7 +10,7 @@ opt.clipboard = "unnamedplus"
-- Highlight the currently selected row
opt.cursorline = true
opt.cursorlineopt = "number"
opt.cursorlineopt = "both"
opt.breakindent = true
opt.breakindentopt = "list:-1"