neovim

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README

commit dfd1fc28a3f636abfb1fc7b2f6e734eea281cab8
parent 28a657883df91ab268076e03e29e9cd84da7b679
Author: mrgrouse <bdmfegys@duck.com>
Date:   Thu,  9 May 2024 23:31:07 -0400

add custom pywal plugin

Diffstat:
Mlua/index.lua | 1+
Alua/pywal/config.lua | 257+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alua/pywal/core.lua | 29+++++++++++++++++++++++++++++
Alua/pywal/feline.lua | 432+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alua/pywal/highlights.lua | 11+++++++++++
Alua/pywal/init.lua | 11+++++++++++
6 files changed, 741 insertions(+), 0 deletions(-)

diff --git a/lua/index.lua b/lua/index.lua @@ -1,3 +1,4 @@ require("options") require("lazy-nvim") +require("pywal/init") require("autostart") diff --git a/lua/pywal/config.lua b/lua/pywal/config.lua @@ -0,0 +1,257 @@ +local M = {} + +M.highlights_base = function (colors) + return { + Normal = { fg = colors.foreground, bg = colors.background }, + StatusLineNC = { bg = colors.background, fg = colors.background }, + StatusLine = { bg = colors.background, fg = colors.background }, + SignColumn = { bg = colors.background, fg = colors.background }, + MsgArea = { fg = colors.foreground, bg = colors.background }, + ModeMsg = { fg = colors.foreground, bg = colors.background }, + MsgSeparator = { fg = colors.foreground, bg = colors.background }, + SpellBad = { fg = colors.color2 }, + SpellCap = { fg = colors.color6 }, + SpellLocal = { fg = colors.color4 }, + SpellRare = { fg = colors.color6 }, + NormalNC = { fg = colors.foreground, bg = colors.background }, + Pmenu = { fg = colors.foreground, bg = colors.background }, + PmenuSel = { fg = colors.background, bg = colors.color4 }, + WildMenu = { fg = colors.color7, bg = colors.color4 }, + CursorLineNr = { fg = colors.color1 }, + Comment = { fg = colors.color1 }, + Folded = { fg = colors.color4, bg = colors.background }, + FoldColumn = { fg = colors.color4, bg = colors.background }, + LineNr = { fg = colors.color9, bg = colors.background }, + FloatBorder = { fg = colors.foreground, bg = colors.background }, + Whitespace = { fg = colors.color1 }, + VertSplit = { fg = colors.background, bg = colors.color1 }, + CursorLine = { bg = colors.background }, + CursorColumn = { bg = colors.background }, + ColorColumn = { bg = colors.background }, + NormalFloat = { bg = colors.background }, + Visual = { bg = colors.color1, fg = colors.foreground }, + VisualNOS = { bg = colors.background }, + WarningMsg = { fg = colors.color3, bg = colors.background }, + DiffAdd = { fg = colors.background, bg = colors.color4 }, + DiffChange = { fg = colors.background, bg = colors.color5 }, + DiffDelete = { fg = colors.background, bg = colors.color11 }, + QuickFixLine = { bg = colors.color2 }, + PmenuSbar = { bg = colors.background }, + PmenuThumb = { bg = colors.color2 }, + MatchParen = { fg = colors.color4, bg = colors.background }, + Cursor = { fg = colors.foreground, bg = colors.cursor }, + lCursor = { fg = colors.foreground, bg = colors.cursor }, + CursorIM = { fg = colors.foreground, bg = colors.cursor }, + TermCursor = { fg = colors.foreground, bg = colors.cursor }, + TermCursorNC = { fg = colors.foreground, bg = colors.cursor }, + Conceal = { fg = colors.color4, bg = colors.background }, + Directory = { fg = colors.color4 }, + SpecialKey = { fg = colors.color4 }, + Title = { fg = colors.color4 }, + ErrorMsg = { fg = colors.color11, bg = colors.background }, + Search = { fg = colors.foreground, bg = colors.color1 }, + IncSearch = { fg = colors.foreground, bg = colors.color1 }, + Substitute = { fg = colors.color1, bg = colors.color6 }, + MoreMsg = { fg = colors.color5 }, + Question = { fg = colors.color5 }, + EndOfBuffer = { fg = colors.background }, + NonText = { fg = colors.color1 }, + Variable = { fg = colors.color5 }, + String = { fg = colors.color12 }, + Character = { fg = colors.color12 }, + Constant = { fg = colors.color5 }, + Number = { fg = colors.color5 }, + Boolean = { fg = colors.color5 }, + Float = { fg = colors.color5 }, + Identifier = { fg = colors.color5 }, + Function = { fg = colors.color6 }, + Operator = { fg = colors.color6 }, + Type = { fg = colors.color5 }, + StorageClass = { fg = colors.color7 }, + Structure = { fg = colors.color6 }, + Typedef = { fg = colors.color6 }, + Keyword = { fg = colors.color6 }, + Statement = { fg = colors.color6 }, + Conditional = { fg = colors.color6 }, + Repeat = { fg = colors.color6 }, + Label = { fg = colors.color4 }, + Exception = { fg = colors.color6 }, + Include = { fg = colors.color6 }, + PreProc = { fg = colors.color6 }, + Define = { fg = colors.color6 }, + Macro = { fg = colors.color6 }, + PreCondit = { fg = colors.color6 }, + Special = { fg = colors.color6 }, + SpecialChar = { fg = colors.foreground }, + Tag = { fg = colors.color4 }, + Debug = { fg = colors.color11 }, + Delimiter = { fg = colors.foreground }, + SpecialComment = { fg = colors.color2 }, + Ignore = { fg = colors.color7, bg = colors.background }, + Todo = { fg = colors.color11, bg = colors.background }, + Error = { fg = colors.color11, bg = colors.background }, + TabLine = { fg = colors.color2, bg = colors.background }, + TabLineSel = { fg = colors.foreground, bg = colors.background }, + TabLineFill = { fg = colors.foreground, bg = colors.background }, + CmpDocumentationBorder = { fg = colors.foreground, bg = colors.background }, + CmpItemAbbr = { fg = colors.foreground, bg = colors.background }, + CmpItemAbbrDeprecated = { fg = colors.color2, bg = colors.background }, + CmpItemAbbrMatch = { fg = colors.color7, bg = colors.background }, + CmpItemAbbrMatchFuzzy = { fg = colors.color7, bg = colors.background }, + CmpItemKind = { fg = colors.color4, bg = colors.background }, + CmpItemMenu = { fg = colors.color2, bg = colors.background }, + + -- treesitter + + -- These groups are for the neovim tree-sitter highlights. + -- As of writing, tree-sitter support is a WIP, group names may color5. + -- By default, most of these groups link to an appropriate Vim group, + -- TSError -> Error for example, so you do not have to define these unless + -- you explicitly want to support Treesitter's improved syntax awareness. + + -- TSAnnotation = { }; -- For C++/Dart attributes, annotations that can be attached to the code to denote some kind of meta information. + -- TSAttribute = { }; -- (unstable) TODO: docs + -- TSBoolean = { }; -- For booleans. + -- TSCharacter = { }; -- For characters. + -- TSComment = { }; -- For color1 blocks. + TSNote = { fg = colors.background, bg = colors.color5 }, + TSComment = { fg = colors.color1 }, + TSWarning = { fg = colors.background, bg = colors.color5 }, + TSDanger = { fg = colors.background, bg = colors.color3 }, + TSConstructor = { fg = colors.color6 }, -- For constructor calls and definitions: `= { }` in Lua, and Java constructors. + -- TSConditional = { }; -- For keywords related to conditionnals. + -- TSConstant = { }; -- For constants + -- TSConstBuiltin = { }; -- For constant that are built in the language: `nil` in Lua. + -- TSConstMacro = { }; -- For constants that are defined by macros: `NULL` in C. + -- TSError = { }; -- For syntax/parser errors. + -- TSException = { }; -- For exception related keywords. + TSField = { fg = colors.color12 }, -- For fields. + -- TSFloat = { }; -- For floats. + -- TSFunction = { }; -- For function (calls and definitions). + -- TSFuncBuiltin = { }; -- For builtin functions: `table.insert` in Lua. + -- TSFuncMacro = { }; -- For macro defined fuctions (calls and definitions): each `macro_rules` in Rust. + -- TSInclude = { }; -- For includes: `#include` in C, `use` or `extern crate` in Rust, or `require` in Lua. + TSKeyword = { fg = colors.color6 }, -- For keywords that don't fall in previous categories. + TSKeywordFunction = { fg = colors.color6 }, -- For keywords used to define a fuction. + TSLabel = { fg = colors.color7 }, -- For labels: `label:` in C and `:label:` in Lua. + -- TSMethod = { }; -- For method calls and definitions. + -- TSNamespace = { }; -- For identifiers referring to modules and namespaces. + -- TSNone = { }; -- TODO: docs + -- TSNumber = { }; -- For all numbers + TSOperator = { fg = colors.color7 }, -- For any operator: `+`, but also `->` and `*` in C. + TSParameter = { fg = colors.color5 }, -- For parameters of a function. + -- TSParameterReference= { }; -- For references to parameters of a function. + TSProperty = { fg = colors.color4 }, -- Same as `TSField`. + TSPunctDelimiter = { fg = colors.color7 }, -- For delimiters ie: `.` + TSPunctBracket = { fg = colors.foreground }, -- For brackets and parens. + TSPunctSpecial = { fg = colors.color7 }, -- For special punctutation that does not fall in the catagories before. + -- TSRepeat = { }; -- For keywords related to loops. + -- TSString = { }; -- For strings. + TSStringRegex = { fg = colors.color7 }, -- For regexes. + TSStringEscape = { fg = colors.color6 }, -- For escape characters within a string. + -- TSSymbol = { }; -- For identifiers referring to symbols or atoms. + -- TSType = { }; -- For types. + -- TSTypeBuiltin = { }; -- For builtin types. + TSVariableBuiltin = { fg = colors.color11 }, -- Variable names that are defined by the languages, like `this` or `self`. + + -- TSTag = { }; -- Tags like html tag names. + -- TSTagDelimiter = { }; -- Tag delimiter like `<` `>` `/` + -- TSText = { }; -- For strings considered text in a markup language. + TSTextReference = { fg = colors.color8 }, + -- TSEmphasis = { }; -- For text to be represented with emphasis. + -- TSUnderline = { }; -- For text to be represented with an underline. + -- TSStrike = { }; -- For strikethrough text. + -- TSTitle = { }; -- Text that is part of a title. + -- TSLiteral = { }; -- Literal text. + -- TSURI = { }; -- Any URI like a link or email. + + -- LspTrouble + LspTroubleText = { fg = colors.foreground }, + LspTroubleCount = { fg = colors.color6, bg = colors.foreground }, + LspTroubleNormal = { fg = colors.foreground, bg = colors.background }, + + -- Illuminate + illuminatedWord = { bg = colors.foreground }, + illuminatedCurWord = { bg = colors.foreground }, + + -- diff + diffAdded = { fg = colors.color4 }, + diffRemoved = { fg = colors.color11 }, + diffChanged = { fg = colors.color5 }, + diffOldFile = { fg = colors.color5 }, + diffNewFile = { fg = colors.color5 }, + diffFile = { fg = colors.color7 }, + diffLine = { fg = colors.color1 }, + diffIndexLine = { fg = colors.color6 }, + + -- Neogit + NeogitBranch = { fg = colors.color6 }, + NeogitRemote = { fg = colors.color6 }, + NeogitHunkHeader = { bg = colors.background, fg = colors.foreground }, + NeogitHunkHeaderHighlight = { bg = colors.foreground, fg = colors.color7 }, + NeogitDiffContextHighlight = { bg = colors.background, fg = colors.foreground }, + NeogitDiffDeleteHighlight = { fg = colors.color11, bg = colors.color11 }, + NeogitDiffAddHighlight = { fg = colors.color4, bg = colors.color4 }, + + -- GitGutter + GitGutterAdd = { fg = colors.color4 }, -- diff mode: Added line |diff.txt| + GitGutterChange = { fg = colors.color5 }, -- diff mode: Changed line |diff.txt| + GitGutterDelete = { fg = colors.color11 }, -- diff mode: Deleted line |diff.txt| + + -- GitSigns + GitSignsAdd = { fg = colors.color4 }, -- diff mode: Added line |diff.txt| + GitSignsChange = { fg = colors.color5 }, -- diff mode: Changed line |diff.txt| + GitSignsDelete = { fg = colors.color11 }, -- diff mode: Deleted line |diff.txt| + + -- Telescope + TelescopeBorder = { fg = colors.color1, bg = colors.background }, + TelescopeNormal = { fg = colors.foreground, bg = colors.background }, + TelescopeSelection = { fg = colors.background, bg = colors.color1 }, + + -- Indent Blank Line + IndentBlanklineChar = { fg = colors.color1, bg = colors.background }, + + -- NvimTree + NvimTreeNormal = { fg = colors.foreground, bg = colors.background }, + NvimTreeNormalNC = { fg = colors.foreground, bg = colors.background }, + NvimTreeRootFolder = { fg = colors.color1 }, + NvimTreeGitDirty = { fg = colors.color5 }, + NvimTreeGitNew = { fg = colors.color4 }, + NvimTreeGitDeleted = { fg = colors.color11 }, + NvimTreeSpecialFile = { fg = colors.color6 }, + NvimTreeIndentMarker = { fg = colors.foreground }, + NvimTreeImageFile = { fg = colors.foreground }, + NvimTreeSymlink = { fg = colors.color7 }, + NvimTreeFolderIcon = { fg = colors.color2, bg = colors.background }, + NvimTreeStatusLineNC = { bg = colors.background, fg = colors.background }, + + -- LspSaga + LspFloatWinNormal = { bg = colors.background }, + LspFloatWinBorder = { fg = colors.foreground }, + LspSagaBorderTitle = { fg = colors.color7 }, + LspSagaHoverBorder = { fg = colors.color7 }, + LspSagaRenameBorder = { fg = colors.color4 }, + LspSagaDefPreviewBorder = { fg = colors.color4 }, + LspSagaCodeActionBorder = { fg = colors.color7 }, + LspSagaFinderSelection = { fg = colors.color1 }, + LspSagaCodeActionTitle = { fg = colors.color7 }, + LspSagaCodeActionContent = { fg = colors.color6 }, + LspSagaSignatureHelpBorder = { fg = colors.color11 }, + ReferencesCount = { fg = colors.color6 }, + DefinitionCount = { fg = colors.color6 }, + DefinitionIcon = { fg = colors.color7 }, + ReferencesIcon = { fg = colors.color7 }, + TargetWord = { fg = colors.color7 }, + + -- NeoVim + healthError = { fg = colors.color11 }, + healthSuccess = { fg = colors.color4 }, + healthWarning = { fg = colors.color5 }, + + -- BufferLine + BufferLineIndicatorSelected = { fg = colors.color5 }, + BufferLineFill = { bg = colors.background }, + } +end + +return M diff --git a/lua/pywal/core.lua b/lua/pywal/core.lua @@ -0,0 +1,29 @@ +local M = {} + +function M.get_colors() + vim.cmd [[ source $HOME/.config/nvim/colors/colors-wal.vim ]] + + return { + background = vim.g.background, + foreground = vim.g.foreground, + cursor = vim.g.cursor, + color0 = vim.g.color0, + color1 = vim.g.color1, + color2 = vim.g.color2, + color3 = vim.g.color3, + color4 = vim.g.color4, + color5 = vim.g.color5, + color6 = vim.g.color6, + color7 = vim.g.color7, + color8 = vim.g.color8, + color9 = vim.g.color9, + color10 = vim.g.color10, + color11 = vim.g.color11, + color12 = vim.g.color12, + color13 = vim.g.color13, + color14 = vim.g.color14, + color15 = vim.g.color15, + } +end + +return M diff --git a/lua/pywal/feline.lua b/lua/pywal/feline.lua @@ -0,0 +1,432 @@ +local lsp = require("feline.providers.lsp") +local lsp_severity = vim.diagnostic.severity +local b = vim.b + +local assets = { + left_semicircle = "", + right_semicircle = "", + right_semicircle_cut = "", + left_semicircle_cut = "", + vertical_bar_chubby = "█", + vertical_bar_medium = "┃", + vertical_bar_thin = "│", + left_arrow_thin = "", + right_arrow_thin = "", + left_arrow_filled = "", + right_arrow_filled = "", + slant_left = "", + slant_left_thin = "", + slant_right = "", + slant_right_thin = "", + slant_left_2 = "", + slant_left_2_thin = "", + slant_right_2 = "", + slant_right_2_thin = "", + chubby_dot = "●", + slim_dot = '•', +} + +local colors = require('pywal.core').get_colors() + +-- settings +local sett = { + bkg = colors.background, + diffs = colors.color1, + extras = colors.color5, + curr_file = colors.color4, + curr_dir = colors.color4, +} + +local mode_colors = { + ["n"] = { "NORMAL", colors.color1 }, + ["no"] = { "N-PENDING", colors.color1 }, + ["i"] = { "INSERT", colors.color1 }, + ["ic"] = { "INSERT", colors.color1 }, + ["t"] = { "TERMINAL", colors.color1 }, + ["v"] = { "VISUAL", colors.color3 }, + ["V"] = { "V-LINE", colors.color3 }, + [""] = { "V-BLOCK", colors.color3 }, + ["R"] = { "REPLACE", colors.color4 }, + ["Rv"] = { "V-REPLACE", colors.color4 }, + ["s"] = { "SELECT", colors.color4 }, + ["S"] = { "S-LINE", colors.color4 }, + [""] = { "S-BLOCK", colors.color4 }, + ["c"] = { "COMMAND", colors.color6 }, + ["cv"] = { "COMMAND", colors.color6 }, + ["ce"] = { "COMMAND", colors.color6 }, + ["r"] = { "PROMPT", colors.color7 }, + ["rm"] = { "MORE", colors.color7 }, + ["r?"] = { "CONFIRM", colors.color2 }, + ["!"] = { "SHELL", colors.color1 }, +} + +local shortline = false + +-- Initialize the components table +local components = { + active = {}, + inactive = {}, +} + +table.insert(components.active, {}) -- (1) left +table.insert(components.active, {}) -- (2) center +table.insert(components.active, {}) -- (3) right + +-- global components +local invi_sep = { + str = " ", + hl = { + fg = sett.bkg, + bg = sett.bkg + }, +} + +-- helpers +local function any_git_changes() + local gst = b.gitsigns_status_dict -- git stats + if gst then + if gst["added"] and gst["added"] > 0 or gst["removed"] and gst["removed"] > 0 or gst["changed"] and gst["changed"] > 0 then + return true + end + end + return false +end + + +-- #################### STATUSLINE -> + + +-- ######## Left + +-- Current vi mode ------> +local vi_mode_hl = function() + return { + fg = sett.bkg, + bg = mode_colors[vim.fn.mode()][2], + style = "bold" + } +end + +components.active[1][1] = { + provider = assets.vertical_bar_chubby, + hl = function() + return { + fg = mode_colors[vim.fn.mode()][2], + bg = sett.bkg, + } + end, +} + +components.active[1][2] = { + provider = "", + hl = function() + return { + fg = sett.bkg, + bg = mode_colors[vim.fn.mode()][2], + } + end, +} + +components.active[1][3] = { + provider = function() + return " " .. mode_colors[vim.fn.mode()][1] .. " " + end, + hl = vi_mode_hl, +} + +-- there is a dilema: we need to hide Diffs if ther is no git info. We can do that, but this will +-- leave the right_semicircle colored with purple, and since we can't change the color conditonally +-- then the solution is to create two right_semicircles: one with a color2 sett.bkg and the other one normal +-- sett.bkg; both have the same fg (vi mode). The color2 one appears if there is git info, else the one with +-- the normal sett.bkg appears. Fixed :) + +-- enable if git diffs are not available +components.active[1][4] = { + provider = assets.right_semicircle, + hl = function() + return { + fg = mode_colors[vim.fn.mode()][2], + bg = sett.bkg + } + end, + enabled = function() + return not any_git_changes() + end +} + +-- enable if git diffs are available +components.active[1][5] = { + provider = assets.right_semicircle, + hl = function() + return { + fg = mode_colors[vim.fn.mode()][2], + bg = sett.diffs + } + end, + enabled = function() + return any_git_changes() + end +} +-- Current vi mode ------> + +-- Diffs ------> +components.active[1][6] = { + provider = "git_diff_added", + hl = { + fg = sett.bkg, + bg = sett.diffs, + }, + icon = "  ", +} + +components.active[1][7] = { + provider = "git_diff_changed", + hl = { + fg = sett.bkg, + bg = sett.diffs, + }, + icon = "  ", +} + +components.active[1][8] = { + provider = "git_diff_removed", + hl = { + fg = sett.bkg, + bg = sett.diffs, + }, + icon = "  ", +} + +components.active[1][9] = { + provider = assets.right_semicircle, + hl = { + fg = sett.diffs, + bg = sett.bkg, + }, + enabled = function() + return any_git_changes() + end +} +-- Diffs ------> + +-- Extras ------> + +-- file progess +components.active[1][10] = { + provider = function() + local current_line = vim.fn.line(".") + local total_line = vim.fn.line("$") + + if current_line == 1 then + return " Top " + elseif current_line == vim.fn.line("$") then + return " Bot " + end + local result, _ = math.modf((current_line / total_line) * 100) + return " " .. result .. "%% " + end, + -- enabled = shortline or function(winid) + -- return vim.api.nvim_win_get_width(winid) > 90 + -- end, + hl = { + fg = sett.extras, + bg = sett.bkg + }, + left_sep = invi_sep, +} + +-- position +components.active[1][11] = { + provider = "position", + -- enabled = shortline or function(winid) + -- return vim.api.nvim_win_get_width(winid) > 90 + -- end, + hl = { + fg = sett.extras, + bg = sett.bkg + }, + left_sep = invi_sep, +} +-- Extras ------> + +-- ######## Left + +-- ######## Center + +-- Diagnostics ------> +-- workspace loader +components.active[2][1] = { + provider = function() + local Lsp = vim.lsp.util.get_progress_messages()[1] + + if Lsp then + local msg = Lsp.message or "" + local percentage = Lsp.percentage or 0 + local title = Lsp.title or "" + local spinners = { + "", + "", + "", + } + local success_icon = { + "", + "", + "", + } + local ms = vim.loop.hrtime() / 1000000 + local frame = math.floor(ms / 120) % #spinners + + if percentage >= 70 then + return string.format(" %%<%s %s %s (%s%%%%) ", success_icon[frame + 1], title, msg, percentage) + end + + return string.format(" %%<%s %s %s (%s%%%%) ", spinners[frame + 1], title, msg, percentage) + end + + return "" + end, + enabled = shortline or function(winid) + return vim.api.nvim_win_get_width(winid) > 80 + end, + hl = { + fg = colors.rosewater, + bg = sett.bkg + }, +} + +-- genral diagnostics (errors, warnings. info and hints) +components.active[2][2] = { + provider = "diagnostic_errors", + enabled = function() + return lsp.diagnostics_exist(lsp_severity.ERROR) + end, + + hl = { + fg = colors.red, + bg = sett.bkg, + }, + icon = "  ", +} + +components.active[2][3] = { + provider = "diagnostic_warnings", + enabled = function() + return lsp.diagnostics_exist(lsp_severity.WARN) + end, + hl = { + fg = colors.yellow, + bg = sett.bkg, + }, + icon = "  ", +} + +components.active[2][4] = { + provider = "diagnostic_info", + enabled = function() + return lsp.diagnostics_exist(lsp_severity.INFO) + end, + hl = { + fg = colors.sky, + bg = sett.bkg, + }, + icon = "  ", +} + +components.active[2][5] = { + provider = "diagnostic_hints", + enabled = function() + return lsp.diagnostics_exist(lsp_severity.HINT) + end, + hl = { + fg = colors.rosewater, + bg = sett.bkg, + }, + icon = "  ", +} +-- Diagnostics ------> + +-- ######## Center + +-- ######## Right + +components.active[3][1] = { + provider = "git_branch", + enabled = shortline or function(winid) + return vim.api.nvim_win_get_width(winid) > 70 + end, + hl = { + fg = sett.extras, + bg = sett.bkg + }, + icon = "  ", + left_sep = invi_sep, + right_sep = invi_sep, +} + +components.active[3][2] = { + provider = function() + if next(vim.lsp.buf_get_clients()) ~= nil then + return " " + else + return "" + end + end, + hl = { + fg = sett.extras, + bg = sett.bkg + }, + right_sep = invi_sep, +} + +components.active[3][3] = { + provider = function() + local filename = vim.fn.expand("%:t") + local extension = vim.fn.expand("%:e") + local icon = require("nvim-web-devicons").get_icon(filename, extension) + if icon == nil then + icon = "  " + return icon + end + return " " .. icon .. " " .. filename .. " " + end, + enabled = shortline or function(winid) + return vim.api.nvim_win_get_width(winid) > 70 + end, + hl = { + fg = sett.bkg, + bg = sett.curr_file, + }, + left_sep = { + str = assets.left_semicircle, + hl = { + fg = sett.curr_file, + bg = sett.bkg, + }, + }, +} + +components.active[3][4] = { + provider = function() + local dir_name = vim.fn.fnamemodify(vim.fn.getcwd(), ":t") + return "  " .. dir_name .. " " + end, + + enabled = shortline or function(winid) + return vim.api.nvim_win_get_width(winid) > 80 + end, + + hl = { + fg = sett.bkg, + bg = sett.curr_dir, + }, + left_sep = { + str = assets.left_semicircle, + hl = { + fg = sett.curr_dir, + bg = sett.curr_file, + }, + }, +} +-- ######## Right + +return components diff --git a/lua/pywal/highlights.lua b/lua/pywal/highlights.lua @@ -0,0 +1,11 @@ +local M = {} +local config = require('pywal.config') + +function M.highlight_all(colors) + local base_highlights = config.highlights_base(colors) + for group, properties in pairs(base_highlights) do + vim.api.nvim_set_hl(0, group, properties) + end +end + +return M diff --git a/lua/pywal/init.lua b/lua/pywal/init.lua @@ -0,0 +1,11 @@ +local M = {} +local core = require('pywal.core') +local highlights = require('pywal.highlights') + +function M.setup () + local colors = core.get_colors() + vim.opt.termguicolors = true + highlights.highlight_all(colors) +end + +return M