From dd738ade403769650a7cae756cd4e2d3a3fa118c Mon Sep 17 00:00:00 2001 From: Tomas Mirchev Date: Thu, 25 Sep 2025 07:22:36 +0000 Subject: [PATCH] update --- config/linux-dev/nvim/colors/invero.lua | 98 +-------- config/linux-dev/nvim/init.lua | 7 +- config/linux-dev/nvim/lua/config/autocmds.lua | 37 ++++ config/linux-dev/nvim/lua/config/options.lua | 30 +-- .../linux-dev/nvim/lua/plugins/neo-tree.lua | 79 -------- .../linux-dev/nvim/lua/plugins/nvim-tree.lua | 187 ++++++++++++++++++ .../linux-dev/nvim/lua/plugins/telescope.lua | 51 +---- .../nvim/lua/themes/invero/colors.lua | 19 ++ .../nvim/lua/themes/invero/groups/editor.lua | 37 ++++ .../invero/groups/integrations/nvim-tree.lua | 13 ++ .../invero/groups/integrations/telescope.lua | 13 ++ .../groups/integrations/tree-sitter.lua | 19 ++ .../nvim/lua/themes/invero/groups/syntax.lua | 9 + .../lua/themes/invero/groups/terminal.lua | 31 +++ .../linux-dev/nvim/lua/themes/invero/init.lua | 12 ++ .../nvim/lua/themes/invero/palette.lua | 37 ++++ .../nvim/lua/themes/invero/setup.lua | 79 ++++++++ config/linux-dev/nvim/lua/utils/palette.lua | 51 ----- config/linux-dev/tmux | 7 +- 19 files changed, 516 insertions(+), 300 deletions(-) create mode 100644 config/linux-dev/nvim/lua/config/autocmds.lua delete mode 100644 config/linux-dev/nvim/lua/plugins/neo-tree.lua create mode 100644 config/linux-dev/nvim/lua/plugins/nvim-tree.lua create mode 100644 config/linux-dev/nvim/lua/themes/invero/colors.lua create mode 100644 config/linux-dev/nvim/lua/themes/invero/groups/editor.lua create mode 100644 config/linux-dev/nvim/lua/themes/invero/groups/integrations/nvim-tree.lua create mode 100644 config/linux-dev/nvim/lua/themes/invero/groups/integrations/telescope.lua create mode 100644 config/linux-dev/nvim/lua/themes/invero/groups/integrations/tree-sitter.lua create mode 100644 config/linux-dev/nvim/lua/themes/invero/groups/syntax.lua create mode 100644 config/linux-dev/nvim/lua/themes/invero/groups/terminal.lua create mode 100644 config/linux-dev/nvim/lua/themes/invero/init.lua create mode 100644 config/linux-dev/nvim/lua/themes/invero/palette.lua create mode 100644 config/linux-dev/nvim/lua/themes/invero/setup.lua delete mode 100644 config/linux-dev/nvim/lua/utils/palette.lua diff --git a/config/linux-dev/nvim/colors/invero.lua b/config/linux-dev/nvim/colors/invero.lua index aad10f2..c3f6a36 100644 --- a/config/linux-dev/nvim/colors/invero.lua +++ b/config/linux-dev/nvim/colors/invero.lua @@ -1,97 +1 @@ --- colors/inStatusLinevero.lua - -local palette = require("utils.palette") - --- reset highlights -vim.cmd("hi clear") -if vim.fn.exists("syntax_on") == 1 then - vim.cmd("syntax reset") -end - -vim.opt.background = "light" -vim.g.colors_name = "invero" - -local colors = { - -- neutrals - base = palette[255], -- #eeeeee, white (bg) - surface = palette[253], -- #dadada, light gray (cursor line bg) - text = palette[238], -- #444444, dark gray (terminal fg) - muted = palette[247], -- #9e9e9e, gray (comments, line numbers, dividers) - accent = palette[27], -- #005fff, standard blue (cursor, dirs) - accent_light = palette[153], -- #afd7ff light sky blue (selection bg) - syntax = palette[60], -- #5f5f87, slate / gray-blue (syntax fg) - red = palette[196], -- #ff0000, red - orange = palette[166], -- #d75f00, orange - orange_light = palette[180], -- #ffd7af, orange light - yellow = palette[184], -- #ffd75f, yellow - green = palette[34], -- #00af5f, green - none = "NONE" -- no color / transparent -} - -local theme = { - Normal = { fg = colors.text, bg = colors.none }, - LineNr = { fg = colors.muted }, - CursorLineNr = { fg = colors.accent, bold = true }, - CursorLine = { bg = colors.surface }, - Visual = { bg = colors.accent_light }, - Search = { fg = colors.orange }, - CurSearch = { fg = colors.base, bg = colors.orange, bold = true }, - IncSearch = { fg = colors.base, bg = colors.orange, bold = true }, - WinSeparator = { fg = colors.muted }, - StatusLine = { fg = colors.text, bg = colors.none }, - TabLine = { fg = colors.red }, - TabLineSel = { fg = colors.red, bold = true }, - TabLineFill = { bg = colors.red }, - - -- Telescope - TelescopeBorder = { fg = colors.muted }, - TelescopePromptPrefix = { fg = colors.accent }, - TelescopeSelection = { bg = colors.surface }, - - -- Neo-tree - NeoTreeDirectoryName = { fg = colors.accent }, - NeoTreeFileName = { fg = colors.text }, - -- NeoTreeNormal = { bg = colors.muted }, - -- NeoTreeNormalNC = { bg = colors.muted }, -} - --- apply theme groups -for group, opts in pairs(theme) do - vim.api.nvim_set_hl(0, group, opts) -end - --- apply Tree-sitter defaults: all base4, comments special-case -local highlights = vim.fn.getcompletion("@", "highlight") -for _, hl in ipairs(highlights) do - vim.api.nvim_set_hl(0, hl, { fg = colors.syntax }) -end - -vim.api.nvim_set_hl(0, "@comment", { fg = colors.muted, italic = true }) - -vim.api.nvim_create_autocmd({ "WinEnter" }, { - callback = function() vim.wo.cursorline = true end, -}) -vim.api.nvim_create_autocmd({ "WinLeave" }, { - callback = function() vim.wo.cursorline = false end, -}) - --- TEST >> - - -vim.opt.laststatus = 3 -vim.opt.fillchars:append({ stl = '─', stlnc = '─' }) - --- vim.o.statusline = " " --- vim.api.nvim_set_hl(0, "WinSeparator", { bg = colors.surface }) -- vertical bg --- vim.api.nvim_set_hl(0, "StatusLine", { bg = colors.surface }) -- horizontal bg --- vim.api.nvim_set_hl(0, "StatusLineNC", { bg = colors.surface }) -- horizontal bg - --- vim.api.nvim_create_autocmd("FileType", { --- pattern = "neo-tree", --- callback = function(ev) --- -- force your own winhighlight --- vim.api.nvim_win_set_option(ev.win, "winhighlight", "WinSeparator:WinSeparator") --- -- force fillchars --- vim.wo[ev.win].fillchars = "vert:│,horiz:─,horizup:┴,horizdown:┬,vertleft:├,vertright:┤,verthoriz:┼" --- end, --- }) +require("themes.invero").load() diff --git a/config/linux-dev/nvim/init.lua b/config/linux-dev/nvim/init.lua index 94396f2..2157826 100644 --- a/config/linux-dev/nvim/init.lua +++ b/config/linux-dev/nvim/init.lua @@ -1,3 +1,4 @@ -require('config.options') -- vim options -require('config.keymaps') -- keymaps -require('config.lazy') -- plugin manager and plugins +require('config.options') +require('config.keymaps') +require('config.lazy') +require("config.autocmds") diff --git a/config/linux-dev/nvim/lua/config/autocmds.lua b/config/linux-dev/nvim/lua/config/autocmds.lua new file mode 100644 index 0000000..1d8f7f9 --- /dev/null +++ b/config/linux-dev/nvim/lua/config/autocmds.lua @@ -0,0 +1,37 @@ +-- Highlight when yanking (copying) text +vim.api.nvim_create_autocmd("TextYankPost", { + callback = function() + vim.highlight.on_yank() + end, +}) + +-- cursorline only on active window +vim.api.nvim_create_autocmd({ "WinEnter" }, { + callback = function() + local ft = vim.bo.filetype + if ft ~= "NvimTree" then + vim.wo.cursorline = true + end + end, +}) +vim.api.nvim_create_autocmd({ "WinLeave" }, { + callback = function() + local ft = vim.bo.filetype + if ft ~= "NvimTree" then + vim.wo.cursorline = false + end + end, +}) + +-- Reload Invero colorscheme without restarting Neovim +vim.api.nvim_create_user_command("ReloadInvero", function() + -- clear the cached modules so require() reloads them + for k in pairs(package.loaded) do + if k:match("^themes%.invero") then + package.loaded[k] = nil + end + end + + -- reload the colorscheme + vim.cmd("colorscheme invero") +end, { desc = "Reload the Invero theme" }) diff --git a/config/linux-dev/nvim/lua/config/options.lua b/config/linux-dev/nvim/lua/config/options.lua index d9ceca3..a028c3b 100644 --- a/config/linux-dev/nvim/lua/config/options.lua +++ b/config/linux-dev/nvim/lua/config/options.lua @@ -3,17 +3,16 @@ vim.g.mapleader = " " vim.g.maplocalleader = " " -- Use Nerd Font -vim.g.have_nerd_font = true +vim.g.have_nerd_font = false -- Add vertical line -- vim.opt.colorcolumn = "100" --- vim.opt.laststatus = 3 +vim.opt.laststatus = 3 vim.opt.signcolumn = "no" -- Enable TrueColor -vim.opt.termguicolors = true - +vim.opt.termguicolors = false -- Scroll lines/columns vim.opt.mousescroll = "hor:1,ver:1" @@ -40,7 +39,9 @@ vim.opt.relativenumber = true vim.opt.mouse = "a" -- Full path on status line -vim.opt.statusline = "> %F%m%r%h%w %= %l,%c %P " +vim.opt.statusline = "%= %F%m%r%h%w ─ (%l,%c %P) %=" +vim.opt.fillchars:append({ stl = '─', stlnc = '─' }) + -- Sync clipboard between OS and Neovim vim.schedule(function() @@ -76,22 +77,5 @@ vim.opt.guicursor = "n-v-i-c:block" -- Minimal number of screen lines to keep above and below the cursor vim.opt.scrolloff = 10 --- Highlight when yanking (copying) text -vim.api.nvim_create_autocmd("TextYankPost", { - callback = function() - vim.highlight.on_yank() - end, -}) - -vim.diagnostic.config({ - severity_sort = true, - severities = { - [vim.diagnostic.severity.ERROR] = 4, - [vim.diagnostic.severity.WARN] = 3, - [vim.diagnostic.severity.INFO] = 2, - [vim.diagnostic.severity.HINT] = 1, - } -}) - --- Now load the colorscheme (this will trigger the autocmd) +-- Load the colorscheme vim.cmd.colorscheme("invero") diff --git a/config/linux-dev/nvim/lua/plugins/neo-tree.lua b/config/linux-dev/nvim/lua/plugins/neo-tree.lua deleted file mode 100644 index 4a2a6d5..0000000 --- a/config/linux-dev/nvim/lua/plugins/neo-tree.lua +++ /dev/null @@ -1,79 +0,0 @@ -return { - "nvim-tree/nvim-tree.lua", - version = "*", - lazy = false, - keys = { - { "et", ":NvimTreeToggle", desc = "Explorer Toggle", silent = true }, - }, - config = function() - require("nvim-tree").setup { - renderer = { - icons = { - show = { - file = false, - folder = false, - folder_arrow = false, - git = false, - modified = false, - hidden = false, - diagnostics = false, - bookmarks = false, - }, - }, - }, - } - end, -} - --- return { --- "nvim-neo-tree/neo-tree.nvim", --- version = "*", --- dependencies = { --- "nvim-lua/plenary.nvim", --- "nvim-tree/nvim-web-devicons", --- "MunifTanjim/nui.nvim", --- }, --- cmd = "Neotree", --- keys = { --- { "et", ":Neotree position=left toggle", desc = "Explorer Toggle", silent = true }, --- { "E", ":Neotree focus", desc = "Explorer Focus", silent = true }, --- { "ef", ":Neotree float", desc = "Explorer Float", silent = true }, --- { "eb", ":Neotree buffers", desc = "Explorer Buffers", silent = true }, --- { "eg", ":Neotree git_status", desc = "Explorer Git", silent = true }, --- }, --- opts = { --- event_handlers = { --- { --- event = require("neo-tree.ui.events").NEO_TREE_WINDOW_AFTER_OPEN, --- handler = function(args) --- if args and args.winid and vim.api.nvim_win_is_valid(args.winid) then --- vim.api.nvim_win_set_option(args.winid, "colorcolumn", "") --- vim.api.nvim_win_set_option(args.winid, "signcolumn", "no") --- end --- end, --- }, --- }, --- popup_border_style = "single", --- window = { --- mappings = { --- ["e"] = "close_window", --- }, --- }, --- default_component_configs = { --- icon = { enabled = false }, --- git_status = { symbols = {}, align = "none" }, --- name = { trailing_slash = true } --- }, --- enable_git_status = false, --- enable_diagnostics = false, --- filesystem = { --- follow_current_file = { --- enabled = true, -- Enable this feature --- leave_dirs_open = true, -- Leave directories open when following --- }, --- filtered_items = { --- visible = true, --- } --- }, --- }, --- } diff --git a/config/linux-dev/nvim/lua/plugins/nvim-tree.lua b/config/linux-dev/nvim/lua/plugins/nvim-tree.lua new file mode 100644 index 0000000..3109785 --- /dev/null +++ b/config/linux-dev/nvim/lua/plugins/nvim-tree.lua @@ -0,0 +1,187 @@ +return { + "nvim-tree/nvim-tree.lua", + version = "*", + lazy = false, + keys = { + { "et", ":NvimTreeToggle", desc = "Explorer Toggle", silent = true }, + }, + config = function() + require("nvim-tree").setup { + hijack_cursor = true, + disable_netrw = true, + hijack_netrw = true, + hijack_unnamed_buffer_when_opening = true, + root_dirs = { ".git", "package.json" }, + prefer_startup_root = true, + sync_root_with_cwd = true, + reload_on_bufenter = true, + respect_buf_cwd = true, + view = { + centralize_selection = false, + cursorline = true, + cursorlineopt = "both", + debounce_delay = 15, + side = "left", + preserve_window_proportions = false, + number = false, + relativenumber = false, + signcolumn = "no", + width = 30, + }, + renderer = { + add_trailing = false, + group_empty = false, + full_name = false, + root_folder_label = false, + special_files = { "Cargo.toml", "Makefile", "README.md", "readme.md" }, + symlink_destination = true, + icons = { + padding = "", + glyphs = { + folder = { + arrow_closed = "+", + arrow_open = "-", + }, + }, + show = { + file = false, + folder = false, + folder_arrow = true, + git = false, + modified = false, + hidden = false, + diagnostics = false, + bookmarks = false, + }, + } + }, + hijack_directories = { + enable = true, + auto_open = true, + }, + update_focused_file = { + enable = true, + update_root = { + enable = true, + ignore_list = {}, + }, + exclude = false, + }, + filters = { + enable = true, + git_ignored = true, + dotfiles = false, + git_clean = false, + no_buffer = false, + no_bookmark = false, + custom = {}, + exclude = {}, + }, + live_filter = { + prefix = "[FILTER]: ", + always_show_folders = true, + }, + filesystem_watchers = { + enable = true, + debounce_delay = 50, + ignore_dirs = { + -- C / C++ + "/.ccls-cache", + "/build", + "/out", + "/cmake-build-*", + + -- Node.js / Web + "/node_modules", + "/dist", + "/.next", + "/.nuxt", + "/coverage", + "/storybook-static", + + -- Rust + "/target", + + -- Java / JVM + "/target", -- (Maven) + "/build", -- (Gradle) + "/out", -- (IDEA / javac) + + -- Python + "/.venv", + "/venv", + "/__pycache__", + "/.mypy_cache", + "/.pytest_cache", + + -- Go + "/bin", + "/pkg", + + -- General + "/tmp", + "/.cache", + "/.idea", + "/.vscode", + "/logs", + } + }, + trash = { + cmd = "gio trash", + }, + } + end, +} + +-- return { +-- "nvim-neo-tree/neo-tree.nvim", +-- version = "*", +-- dependencies = { +-- "nvim-lua/plenary.nvim", +-- "nvim-tree/nvim-web-devicons", +-- "MunifTanjim/nui.nvim", +-- }, +-- cmd = "Neotree", +-- keys = { +-- { "et", ":Neotree position=left toggle", desc = "Explorer Toggle", silent = true }, +-- { "E", ":Neotree focus", desc = "Explorer Focus", silent = true }, +-- { "ef", ":Neotree float", desc = "Explorer Float", silent = true }, +-- { "eb", ":Neotree buffers", desc = "Explorer Buffers", silent = true }, +-- { "eg", ":Neotree git_status", desc = "Explorer Git", silent = true }, +-- }, +-- opts = { +-- event_handlers = { +-- { +-- event = require("neo-tree.ui.events").NEO_TREE_WINDOW_AFTER_OPEN, +-- handler = function(args) +-- if args and args.winid and vim.api.nvim_win_is_valid(args.winid) then +-- vim.api.nvim_win_set_option(args.winid, "colorcolumn", "") +-- vim.api.nvim_win_set_option(args.winid, "signcolumn", "no") +-- end +-- end, +-- }, +-- }, +-- popup_border_style = "single", +-- window = { +-- mappings = { +-- ["e"] = "close_window", +-- }, +-- }, +-- default_component_configs = { +-- icon = { enabled = false }, +-- git_status = { symbols = {}, align = "none" }, +-- name = { trailing_slash = true } +-- }, +-- enable_git_status = false, +-- enable_diagnostics = false, +-- filesystem = { +-- follow_current_file = { +-- enabled = true, -- Enable this feature +-- leave_dirs_open = true, -- Leave directories open when following +-- }, +-- filtered_items = { +-- visible = true, +-- } +-- }, +-- }, +-- } diff --git a/config/linux-dev/nvim/lua/plugins/telescope.lua b/config/linux-dev/nvim/lua/plugins/telescope.lua index 5695c71..7fb2cba 100644 --- a/config/linux-dev/nvim/lua/plugins/telescope.lua +++ b/config/linux-dev/nvim/lua/plugins/telescope.lua @@ -1,68 +1,30 @@ local remap = require("utils.remap") -return { -- Fuzzy Finder (files, lsp, etc) +return { "nvim-telescope/telescope.nvim", event = "VimEnter", branch = "0.1.x", dependencies = { "nvim-lua/plenary.nvim", - { -- If encountering errors, see telescope-fzf-native README for installation instructions + { "nvim-telescope/telescope-fzf-native.nvim", - - -- `build` is used to run some command when the plugin is installed/updated. - -- This is only run then, not every time Neovim starts up. build = "make", - - -- `cond` is a condition used to determine whether this plugin should be - -- installed and loaded. cond = function() return vim.fn.executable("make") == 1 end, }, { "nvim-telescope/telescope-ui-select.nvim" }, - - -- Useful for getting pretty icons, but requires a Nerd Font. { "nvim-tree/nvim-web-devicons", enabled = vim.g.have_nerd_font }, }, config = function() - -- Telescope is a fuzzy finder that comes with a lot of different things that - -- it can fuzzy find! It's more than just a "file finder", it can search - -- many different aspects of Neovim, your workspace, LSP, and more! - -- - -- The easiest way to use Telescope, is to start by doing something like: - -- :Telescope help_tags - -- - -- After running this command, a window will open up and you're able to - -- type in the prompt window. You'll see a list of `help_tags` options and - -- a corresponding preview of the help. - -- - -- Two important keymaps to use while in Telescope are: - -- - Insert mode: - -- - Normal mode: ? - -- - -- This opens a window that shows you all of the keymaps for the current - -- Telescope picker. This is really useful to discover what Telescope can - -- do as well as how to actually do it! - - -- [[ Configure Telescope ]] - -- See `:help telescope` and `:help telescope.setup()` require("telescope").setup({ - -- You can put your default mappings / updates / etc. in here - -- All the info you're looking for is in `:help telescope.setup()` - -- - -- defaults = { - -- mappings = { - -- i = { [''] = 'to_fuzzy_refine' }, - -- }, - -- }, - -- pickers = {} defaults = { layout_strategy = "vertical", layout_config = { - width = { 0.95, max = 100 }, - height = 0.95, - preview_cutoff = 1, - preview_height = 0.7 + width = { 0.95, max = 100 }, + height = 0.95, + preview_cutoff = 1, + preview_height = 0.7, }, mappings = { n = { @@ -72,7 +34,6 @@ return { -- Fuzzy Finder (files, lsp, etc) }, }) - -- Enable Telescope extensions if they are installed pcall(require("telescope").load_extension, "fzf") pcall(require("telescope").load_extension, "ui-select") diff --git a/config/linux-dev/nvim/lua/themes/invero/colors.lua b/config/linux-dev/nvim/lua/themes/invero/colors.lua new file mode 100644 index 0000000..4a39106 --- /dev/null +++ b/config/linux-dev/nvim/lua/themes/invero/colors.lua @@ -0,0 +1,19 @@ +local M = {} + +function M.get(P) + local colors = { + base = P.white, + surface = P.gray_light, + text = P.black, + muted = P.gray, + accent = P.blue, + accent_light = P.blue_light, + syntax = 60, + none = "NONE", + } + + return vim.tbl_extend("force", P, colors) +end + +return M + diff --git a/config/linux-dev/nvim/lua/themes/invero/groups/editor.lua b/config/linux-dev/nvim/lua/themes/invero/groups/editor.lua new file mode 100644 index 0000000..b59fe1f --- /dev/null +++ b/config/linux-dev/nvim/lua/themes/invero/groups/editor.lua @@ -0,0 +1,37 @@ +local M = {} + +function M.get(C) + return { + Normal = { fg = C.text, bg = C.none }, + LineNr = { fg = C.muted }, + CursorLineNr = { fg = C.accent, bold = true }, + CursorLine = { bg = C.surface }, + Visual = { bg = C.accent_light }, + + Search = { fg = C.yellow }, + CurSearch = { fg = C.base, bg = C.yellow, bold = true }, + IncSearch = { fg = C.base, bg = C.yellow, bold = true }, + + MatchParen = { fg = C.base, bg = C.accent }, + EndOfBuffer = { fg = C.base }, -- End-of-buffer marker (~ lines) + + WinSeparator = { fg = C.muted }, + StatusLine = { fg = C.muted, bg = C.none }, -- Active statusline (where filename) + MsgArea = { fg = C.text, bg = C.none }, -- Command-line / message area + MsgSeparator = { fg = C.text, bg = C.surface }, -- Separator for messages + ModeMsg = { fg = C.text }, + + TabLine = { fg = C.muted }, -- Unselected tab + TabLineSel = { fg = C.text, bold = true }, -- Selected tab + TabLineFill = { bg = C.none }, -- Empty space in the tabline + + -- DiagnosticError = { undercurl = true, sp = C.red }, + -- DiagnosticWarn = { undercurl = true, sp = C.yellow }, + -- DiagnosticInfo = { underline = true, sp = C.accent }, + -- DiagnosticHint = { underline = true, sp = C.green }, + + Directory = { fg = C.accent }, + } +end + +return M diff --git a/config/linux-dev/nvim/lua/themes/invero/groups/integrations/nvim-tree.lua b/config/linux-dev/nvim/lua/themes/invero/groups/integrations/nvim-tree.lua new file mode 100644 index 0000000..cd2b791 --- /dev/null +++ b/config/linux-dev/nvim/lua/themes/invero/groups/integrations/nvim-tree.lua @@ -0,0 +1,13 @@ +local M = {} + +function M.get(C) + return { + NvimTreeFolderIcon = { fg = C.accent }, + NvimTreeRootFolder = { fg = C.text, bold = true }, + -- NvimTreeOpenedHL = { bg = C.surface }, + } +end + +return M + + diff --git a/config/linux-dev/nvim/lua/themes/invero/groups/integrations/telescope.lua b/config/linux-dev/nvim/lua/themes/invero/groups/integrations/telescope.lua new file mode 100644 index 0000000..798aaf0 --- /dev/null +++ b/config/linux-dev/nvim/lua/themes/invero/groups/integrations/telescope.lua @@ -0,0 +1,13 @@ +local M = {} + +function M.get(C) + return { + -- TelescopeBorder = { fg = C.muted, bg = C.green }, + -- TelescopeNormal = { fg = C.text, bg = C.base, ctermbg = 1 }, + TelescopePrompt = { fg = C.text, bg = C.base, ctermbg = 1 }, + -- TelescopePromptPrefix = { fg = C.accent, bg = C.red }, + -- TelescopeSelection = { bg = C.surface }, + } +end + +return M diff --git a/config/linux-dev/nvim/lua/themes/invero/groups/integrations/tree-sitter.lua b/config/linux-dev/nvim/lua/themes/invero/groups/integrations/tree-sitter.lua new file mode 100644 index 0000000..f9c27ff --- /dev/null +++ b/config/linux-dev/nvim/lua/themes/invero/groups/integrations/tree-sitter.lua @@ -0,0 +1,19 @@ +local M = {} + +function M.get(C) + local theme = { + ["@comment"] = { fg = C.muted, italic = true }, + } + + for _, hl in ipairs(vim.fn.getcompletion("@", "highlight")) do + if theme[hl] == nil then + theme[hl] = { fg = C.syntax } + end + end + + return theme +end + +return M + + diff --git a/config/linux-dev/nvim/lua/themes/invero/groups/syntax.lua b/config/linux-dev/nvim/lua/themes/invero/groups/syntax.lua new file mode 100644 index 0000000..0be0ac6 --- /dev/null +++ b/config/linux-dev/nvim/lua/themes/invero/groups/syntax.lua @@ -0,0 +1,9 @@ +local M = {} + +-- fallback for vim without tree-sitter +function M.get(C) + return {} +end + +return M + diff --git a/config/linux-dev/nvim/lua/themes/invero/groups/terminal.lua b/config/linux-dev/nvim/lua/themes/invero/groups/terminal.lua new file mode 100644 index 0000000..919f81f --- /dev/null +++ b/config/linux-dev/nvim/lua/themes/invero/groups/terminal.lua @@ -0,0 +1,31 @@ +local M = {} + +function M.get(C) + return { + terminal_color_0 = { fg = C.black }, + terminal_color_8 = { fg = C.black }, + + terminal_color_1 = { fg = C.red }, + terminal_color_9 = { fg = C.red }, + + terminal_color_2 = { fg = C.green }, + terminal_color_10 = { fg = C.green }, + + terminal_color_3 = { fg = C.yellow }, + terminal_color_11 = { fg = C.yellow }, + + terminal_color_4 = { fg = C.blue }, + terminal_color_12 = { fg = C.blue }, + + terminal_color_5 = { fg = C.magenta }, + terminal_color_13 = { fg = C.magenta }, + + terminal_color_6 = { fg = C.cyan }, + terminal_color_14 = { fg = C.cyan }, + + terminal_color_7 = { fg = C.white }, + terminal_color_15 = { fg = C.white }, + } +end + +return M diff --git a/config/linux-dev/nvim/lua/themes/invero/init.lua b/config/linux-dev/nvim/lua/themes/invero/init.lua new file mode 100644 index 0000000..f2db87c --- /dev/null +++ b/config/linux-dev/nvim/lua/themes/invero/init.lua @@ -0,0 +1,12 @@ +local M = { + name = "invero", + variant = "light", +} + +function M.load() + local setup = require("themes." .. M.name .. ".setup") + setup.reset(M) + setup.apply(M) +end + +return M diff --git a/config/linux-dev/nvim/lua/themes/invero/palette.lua b/config/linux-dev/nvim/lua/themes/invero/palette.lua new file mode 100644 index 0000000..b2aafde --- /dev/null +++ b/config/linux-dev/nvim/lua/themes/invero/palette.lua @@ -0,0 +1,37 @@ +local M = {} + +function M.get() + return { + black = 0, + gray = 247, + gray_light = 253, + red = 1, + green = 2, + yellow = 3, + yellow_light = 180, + blue = 4, + blue_light = 153, + magenta = 5, + cyan = 6, + white = 7, + } + + -- return { + -- black = 238, + -- gray = 247, + -- gray_light = 253, + -- red = 196, + -- green = 35, + -- yellow = 221, + -- orange = 166, + -- orange_light = 180, + -- blue = 27, + -- blue_light = 153, + -- magenta = 125, + -- cyan = 30, + -- white = 255, + -- } +end + +return M + diff --git a/config/linux-dev/nvim/lua/themes/invero/setup.lua b/config/linux-dev/nvim/lua/themes/invero/setup.lua new file mode 100644 index 0000000..8e59a55 --- /dev/null +++ b/config/linux-dev/nvim/lua/themes/invero/setup.lua @@ -0,0 +1,79 @@ +local M = {} + +function M.reset(theme) + vim.opt.background = (theme.variant == "light") and "light" or "dark" + vim.g.colors_name = theme.name +end + +local function list_integrations(theme_name) + local path = vim.fn.stdpath("config") .. "/lua/themes/" .. theme_name .. "/groups/integrations/" + + local files = {} + for name, type in vim.fs.dir(path) do + if type == "file" then + local mod_name = vim.fn.fnamemodify(name, ":r") + table.insert(files, mod_name) + end + end + return files +end + +function M.apply(theme) + local base = "themes." .. theme.name + local P = require(base .. ".palette").get() + local C = require(base .. ".colors").get(P) + + local modules = { + require(base .. ".groups.editor"), + require(base .. ".groups.syntax"), + require(base .. ".groups.terminal"), + } + + local exclude = theme.exclude_integrations or {} + + local function should_load(name) + return not vim.tbl_contains(exclude, name) + end + + -- auto-discover integrations + for _, plugin in ipairs(list_integrations(theme.name)) do + if should_load(plugin) then + local ok_mod, mod = pcall(require, base .. ".groups.integrations." .. plugin) + if ok_mod then + table.insert(modules, mod) + end + end + end + + -- Apply highlights + for _, mod in ipairs(modules) do + local groups = mod.get(C) or {} + for group, opts in pairs(groups) do + if type(opts) ~= "table" then + print("Non-table opts detected in group:", group, "value:", vim.inspect(opts)) + end + local hl = {} + + -- ALT: Use both scenarios + -- if type(v) == "number" then + -- hl.ctermfg = v + -- else + -- hl.fg = v + -- end + + for k, v in pairs(opts) do + if k == "fg" then + hl.ctermfg = v + elseif k == "bg" then + hl.ctermbg = v + else + hl[k] = v -- bold, italic, underline, sp, etc. + end + end + + vim.api.nvim_set_hl(0, group, hl) + end + end +end + +return M diff --git a/config/linux-dev/nvim/lua/utils/palette.lua b/config/linux-dev/nvim/lua/utils/palette.lua deleted file mode 100644 index 387b4b5..0000000 --- a/config/linux-dev/nvim/lua/utils/palette.lua +++ /dev/null @@ -1,51 +0,0 @@ -local function xterm256_palette() - local colors = {} - - -- 0–15: system colors (manual) - local ansi = { - "#000000", -- 0 black - "#d70000", -- 1 red - "#5f8700", -- 2 green - "#af8700", -- 3 yellow/brown - "#005faf", -- 4 blue - "#5f5faf", -- 5 magenta/indigo - "#008787", -- 6 cyan - "#bcbcbc", -- 7 light gray - - "#808080", -- 8 dark gray - "#ff5f5f", -- 9 bright red - "#87d75f", -- 10 bright green - "#ffd700", -- 11 bright yellow - "#5f87d7", -- 12 bright blue - "#8787ff", -- 13 bright magenta - "#5fd7d7", -- 14 bright cyan - "#ffffff", -- 15 white - } - for i, hex in ipairs(ansi) do - colors[i-1] = hex - end - - -- 16–231: 6x6x6 cube - local steps = {0, 95, 135, 175, 215, 255} - local idx = 16 - for r = 1,6 do - for g = 1,6 do - for b = 1,6 do - colors[idx] = string.format("#%02x%02x%02x", steps[r], steps[g], steps[b]) - idx = idx + 1 - end - end - end - - -- 232–255: grayscale - for gray = 0,23 do - local level = 8 + gray * 10 - colors[idx] = string.format("#%02x%02x%02x", level, level, level) - idx = idx + 1 - end - - return colors -end - -return xterm256_palette() - diff --git a/config/linux-dev/tmux b/config/linux-dev/tmux index cb351ae..33c8c74 100644 --- a/config/linux-dev/tmux +++ b/config/linux-dev/tmux @@ -5,9 +5,9 @@ bind-key C-Space send-prefix set-option -g set-clipboard on -#set -g default-terminal "tmux-256color" +set -g default-terminal "xterm-256color" #set -as terminal-features ",*:RGB" -set-option -a terminal-features 'xterm-256color:RGB' +# set-option -a terminal-features 'xterm-256color:RGB' set-option -sg escape-time 10 set-option -g repeat-time 0 set-option -g focus-events on @@ -27,6 +27,7 @@ set -g status-right '' # set -g pane-border-status bottom # or 'bottom' if status is at top # set -g pane-border-format '─' # This will fill the entire width automatically +# set -g pane-border-format '#[align=centre]╱╲' # Window status format - light theme with terminal blue setw -g window-status-format '#[fg=#6c6f85]#I#[fg=#9ca0b0]:#[fg=#4c4f69]#W#[fg=#9ca0b0]#F' @@ -35,6 +36,8 @@ setw -g window-status-current-format '#[fg=blue,bold]#I#[fg=#9ca0b0]:#[fg=blue,b # Pane border - light theme set -g pane-border-style fg='#ccd0da' set -g pane-active-border-style fg=blue +# set -g pane-border-style "fg=#ccd0da,bg=green" +# set -g pane-active-border-style "fg=blue,bg=green" # Message text - light theme set -g message-style bg='#eff1f5',fg=blue