From f90036774cab54b932474a00de0b53649b0c9dc7 Mon Sep 17 00:00:00 2001 From: zackartz Date: Tue, 19 Mar 2024 11:58:56 -0400 Subject: [PATCH] 215 current 2024-03-19 11:58:48 24.05.20240316.c75037b 6.8.0-zen1 * --- modules/home-manager/vim.nix | 449 +---------------------------------- 1 file changed, 8 insertions(+), 441 deletions(-) diff --git a/modules/home-manager/vim.nix b/modules/home-manager/vim.nix index 944faf3..fa00761 100644 --- a/modules/home-manager/vim.nix +++ b/modules/home-manager/vim.nix @@ -113,157 +113,7 @@ # colorschemes.catppuccin.enable = true; # colorschemes.kanagawa.enable = true; # colorschemes.oxocarbon.enable = true; - colorschemes.tokyonight = { - enable = true; - style = "night"; - onColors = '' function(colors) - colors.gitSigns.add = colors.green - colors.gitSigns.change = colors.blue - colors.gitSigns.delete = colors.red - colors.gitSigns.ignored = colors.bg - colors.status_line = colors.none - return colors - end''; - onHighlights = '' function(hl, c) - local highlights = { - NormalSB = { bg = nil }, - NormalFloat = { bg = nil }, - FloatBorder = { fg = c.dark3 }, - FloatTitle = { fg = c.dark3 }, - CursorLineNr = { fg = c.blue }, - Breakpoint = { fg = c.orange }, - WinSeparator = { fg = c.terminal_black }, - WinBar = { bg = nil }, - WinBarNC = { bg = nil }, - LspInlayHint = { fg = c.comment }, - DiagnosticSignError = { fg = c.red }, - DiagnosticSignWarn = { fg = c.yellow }, - DiagnosticSignHint = { fg = c.blue }, - DiagnosticSignInfo = { fg = c.blue }, - DiagnosticError = { fg = c.red }, - DiagnosticWarn = { fg = c.yellow }, - DiagnosticHint = { fg = c.blue }, - DiagnosticInfo = { fg = c.blue }, - - BufferLineFill = { bg = c.bg }, - BufferLineCloseButtonSelected = { fg = c.red }, - BufferLineError = { fg = c.red, bg = c.bg, bold = true }, - BufferLineWarning = { fg = c.yellow, bg = c.bg, bold = true }, - BufferLineHint = { fg = c.blue, bg = c.bg, bold = true }, - BufferLineInfo = { fg = c.blue, bg = c.bg, bold = true }, - BufferLineModified = { fg = c.green, bg = c.bg }, - BufferLineDuplicate = { fg = c.comment, bg = c.bg, bold = true }, - BufferLineDuplicateSelected = { fg = c.fg, bg = c.bg, bold = true, italic = true }, - BufferLineTruncMarker = { bg = c.bg }, - - NeoTreeDirectoryName = { fg = c.fg }, - NeoTreeNormalNC = { bg = c.bg }, - NeoTreeNormal = { bg = c.bg }, - NeoTreeGitUntracked = { fg = c.orange }, - NeoTreeGitUnstaged = { fg = c.cyan }, - - WhichKeyFloat = { bg = c.bg }, - FlashLabel = { fg = c.red, bg = c.bg }, - FlashCurrent = { bg = c.fg }, - - TelescopeNormal = { bg = nil }, - TelescopePromptPrefix = { fg = c.dark3 }, - TelescopeBorder = { link = "FloatBorder" }, - - NotifyINFOBorder = { fg = c.blue }, - NotifyINFOTitle = { fg = c.blue }, - NotifyINFOIcon = { fg = c.blue }, - NotifyERRORBorder = { fg = c.red }, - NotifyERRORTitle = { fg = c.red }, - NotifyERRORIcon = { fg = c.red }, - NotifyWARNBorder = { fg = c.yellow }, - NotifyWARNTitle = { fg = c.yellow }, - NotifyWARNIcon = { fg = c.yellow }, - ErrorMsg = { fg = c.red }, - - diffAdded = { fg = c.green }, - diffRemoved = { fg = c.red }, - diffChanged = { fg = c.blue }, - diffNewFile = { fg = c.cyan }, - diffOldFile = { fg = c.comment }, - DiffAdd = { fg = c.green }, - DiffChange = { fg = c.blue }, - DiffDelete = { fg = c.red }, - DiffText = { fg = c.purple }, - - DropBarSeparator = { fg = c.dark5 }, - DropBarPick = { fg = c.red, bold = true, italic = true }, - DropBarKind = { fg = c.fg }, - DropBarKindFolder = { fg = c.dark5 }, - DropBarIconUIPickPivot = { link = "DropBarPick" }, - DropBarIconUISeparator = { link = "DropBarSeparator" }, - } - - for key, value in pairs(highlights) do - hl[key] = value - end - - local dropbar_hl = { - "Array", - "Boolean", - "Constant", - "Constructor", - "Enum", - "EnumMember", - "Field", - "Function", - "Identifier", - "List", - "Macro", - "Number", - "Object", - "Operator", - "Package", - "Property", - "Reference", - "String", - "Type", - "TypeParameter", - "Unit", - "Value", - "Variable", - "Null", - "Specifier", - "BreakStatement", - "CaseStatement", - "ContinueStatement", - "Declaration", - "Delete", - "DoStatement", - "ElseStatement", - "ForStatement", - "IfStatement", - "Repeat", - "Scope", - "Specifier", - "Statement", - "SwitchStatement", - "WhileStatement", - "Class", - "Event", - "Interface", - "Method", - "Module", - "Namespace", - "MarkdownH1", - "MarkdownH2", - "MarkdownH3", - "MarkdownH4", - "MarkdownH5", - "MarkdownH6", - } - - for _, value in pairs(dropbar_hl) do - hl["DropBarKind" .. value] = { link = "DropBarKind" } - end - end''; - }; options = { number = true; relativenumber = true; @@ -442,301 +292,18 @@ { plugin = lualine-nvim; } + { + plugin = base46; + } ]; extraConfigLua = '' - local Terminal = require('toggleterm.terminal').Terminal - local lazygit = Terminal:new({ cmd = "lazygit", hidden = true, direction = "float" }) + local Terminal = require('toggleterm.terminal').Terminal + local lazygit = Terminal:new({ cmd = "lazygit", hidden = true, direction = "float" }) - function _lazygit_toggle() - lazygit:toggle() - end - - local colors = require("tokyonight.colors") - local tokyonight = require("lualine.themes.tokyonight") - - - local sources = {} - - local icons = { - Vim = "", - Config = "", - Normal = "󰡛", - Insert = "󰌌", - Terminal = "", - Visual = "󰉸", - Command = "", - Save = "󰳻", - NotSaved = "󱙃", - Restore = "", - Trash = "", - Fedora = "", - Lua = "", - Github = "", - Git = "󰊢", - GitDiff = "", - GitBranch = "", - GitCommit = "", - Add = "󰐕", - Modified = "󰜥", - Removed = "󰍴", - DiffRemoved = "", - Error = "󰅚", - Info = "󰋽", - Warn = "", - Hint = "", - Package = "󰏖", - FileTree = "󰙅", - Folder = "", - EmptyFolder = "", - FolderClock = "󰪻", - FolderOpened = "", - File = "", - NewFile = "", - DefaultFile = "󰈙", - Color = "", - ColorPicker = "󰴱", - ColorOn = "󰌁", - ColorOff = "󰹊", - Swap = "󰓡", - Minimap = "", - Window = "", - Windows = "", - Ellipsis = "…", - Search = "", - TextSearch = "󱩾", - TabSearch = "󱦞", - FileSearch = "󰱼", - Clear = "", - Braces = "󰅩", - Exit = "", - Debugger = "", - Breakpoint = "", - History = "", - Check = "󰄵", - SmallDot = "󰧞", - Dots = "󰇘", - Install = "", - Help = "󰋖", - Clipboard = "󰅌", - Indent = "", - LineWrap = "󰖶", - Comment = "󱋄", - Close = "󰅘", - Open = "󰏋", - Toggle = "󰔡", - Stop = "", - Restart = "", - CloseMultiple = "󰱞", - NextBuffer = "󰮱,", - PrevBuffer = "󰮳", - FoldClose = "", - FoldOpen = "", - Popup = "󰕛", - Vertical = "", - Horizontal = "", - Markdown = "󰽛", - Up = "", - Down = "", - Left = "", - Right = "", - Variable = "", - Symbol = "", - Stack = "", - Format = "󰉣", - Edit = "󰤌", - Fix = "", - Run = "󰐍", - Twilight = "󰖚", - Recording = "󰑋", - Notification = "󰍢", - NotificationDismiss = "󱙍", - NotificationLog = "󰍩", - Code = "", - DropDown = "󰁊", - Web = "󰖟", - Dependencies = "", - Update = "󰚰", - Database = "", - Pin = "", - Book = "󰂽", - BookmarkSearch = "󰺄", - Download = "󰇚", - } - - local fmt = function(icon, text, space) return icons[icon] .. string.rep(" ", space or 1) .. text end - - sources.mode = { - "mode", - fmt = function(name) - local map = { - NORMAL = icons.Normal, - INSERT = icons.Insert, - TERMINAL = icons.Terminal, - VISUAL = icons.Visual, - ["V-LINE"] = icons.Visual, - ["V-BLOCK"] = icons.Visual, - ["O-PENDING"] = icons.Ellipsis, - COMMAND = icons.Command, - REPLACE = icons.Edit, - SELECT = icons.Visual, - } - local icon = map[name] and map[name] or icons.Vim - return icon .. " " .. name - end, - color = function() - local colors = require("tokyonight.colors") - local mode = vim.fn.mode() - local map = { - n = colors.default.blue, - i = colors.default.green, - c = colors.default.yellow, - t = colors.default.cyan, - R = colors.default.red, - v = colors.default.magenta, - V = colors.default.magenta, - s = colors.default.magenta, - S = colors.default.magenta, - } - return { - fg = map[mode] or colors.default.magenta, - bg = colors.night.bg, - } - end, - } - - sources.branch = { - "branch", - icon = icons.GitBranch, - color = function() - local colors = require("tokyonight.colors") - return { bg = colors.night.bg } - end, - } - - sources.diff = { - "diff", - symbols = { - added = fmt("Add", ""), - modified = fmt("Modified", ""), - removed = fmt("Removed", ""), - }, - color = function() - local colors = require("tokyonight.colors") - return { bg = colors.night.bg } - end, - } - - sources.filetype = { "filetype" } - - sources.diagnostics = { - "diagnostics", - color = function() - local colors = require("tokyonight.colors") - return { bg = colors.night.bg } - end, - } - - sources.encoding = { - "encoding", - color = function() - local colors = require("tokyonight.colors") - return { fg = colors.default.blue, bg = colors.night.bg } - end, - } - - sources.fileformat = { - "fileformat", - color = function() - local colors = require("tokyonight.colors") - return { fg = colors.default.blue, bg = colors.night.bg } - end, - } - - sources.indentation = { - "indentation", - fmt = function() - local type = vim.bo[0].expandtab and "spaces" or "tabs" - local value = vim.bo[0].shiftwidth - return type .. ": " .. value - end, - color = function() - local colors = require("tokyonight.colors") - return { fg = colors.default.blue, bg = colors.night.bg } - end, - } - - sources.progress = { - "progress", - fmt = function(location) return vim.trim(location) end, - color = function() - local colors = require("tokyonight.colors") - return { fg = colors.default.purple, bg = colors.night.bg } - end, - } - - sources.location = { - "location", - fmt = function(location) return vim.trim(location) end, - color = function() - local colors = require("tokyonight.colors") - return { fg = colors.default.purple, bg = colors.night.bg } - end, - } - - sources.macro = { - function() return vim.fn.reg_recording() end, - icon = icons.Recording, - color = function() - local colors = require("tokyonight.colors") - return { fg = colors.default.red } - end, - } - - sources.lsp = { - function() - local bufnr = vim.api.nvim_get_current_buf() - local clients = vim.lsp.get_clients({ bufnr = bufnr }) - if next(clients) == nil then return "" end - local attached_clients = vim.tbl_map(function(client) return client.name end, clients) - return table.concat(attached_clients, ", ") - end, - icon = icons.Braces, - color = function() - local colors = require("tokyonight.colors") - return { fg = colors.default.comment, bg = colors.night.bg } - end, - } - - sources.gap = { - function() return " " end, - color = function() - local colors = require("tokyonight.colors") - return { bg = colors.night.bg } - end, - padding = 0, - } - - local opts = { - options = { - component_separators = { left = "", right = "" }, - section_separators = { left = "", right = "" }, - }, - sections = { - lualine_a = { sources.mode }, - lualine_b = { sources.branch, sources.diff }, - lualine_c = { sources.filetype, sources.macro }, - lualine_x = { sources.lsp, sources.diagnostics }, - lualine_y = { sources.indentation, sources.encoding, sources.fileformat }, - lualine_z = { sources.progress, sources.location }, - }, - }; - - vim.opt.laststatus = 3 - tokyonight.normal.c.bg = colors.night.bg - opts.options.theme = tokyonight - - require("lualine").setup(opts) + function _lazygit_toggle() + lazygit:toggle() + end ''; }; }