diff --git a/lazy-lock.json b/lazy-lock.json index b4b95d3..0503087 100644 --- a/lazy-lock.json +++ b/lazy-lock.json @@ -2,7 +2,7 @@ "Comment.nvim": { "branch": "master", "commit": "e51f2b142d88bb666dcaa77d93a07f4b419aca70" }, "LuaSnip": { "branch": "master", "commit": "03c8e67eb7293c404845b3982db895d59c0d1538" }, "alpha-nvim": { "branch": "main", "commit": "41283fb402713fc8b327e60907f74e46166f4cfd" }, - "bufferline.nvim": { "branch": "main", "commit": "73edc1f2732678e7a681e3d3be49782610914f6b" }, + "bufferline.nvim": { "branch": "main", "commit": "99337f63f0a3c3ab9519f3d1da7618ca4f91cffe" }, "cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" }, "cmp-cmdline": { "branch": "main", "commit": "d250c63aa13ead745e3a40f61fdd3470efde3923" }, "cmp-nvim-lsp": { "branch": "main", "commit": "39e2eda76828d88b773cc27a3f61d2ad782c922d" }, @@ -13,6 +13,7 @@ "dressing.nvim": { "branch": "master", "commit": "572314728cb1ce012e825fd66331f52c94acac12" }, "friendly-snippets": { "branch": "main", "commit": "dd2fd1281d4b22e7b4a5bfafa3e142d958e251f2" }, "gitsigns.nvim": { "branch": "main", "commit": "76927d14d3fbd4ba06ccb5246e79d93b5442c188" }, + "gruvbox-baby": { "branch": "main", "commit": "ea71b4225d0140103d99748ca4a33ecf22c03f62" }, "indent-blankline.nvim": { "branch": "master", "commit": "d98f537c3492e87b6dc6c2e3f66ac517528f406f" }, "lazy.nvim": { "branch": "main", "commit": "8f19915175395680808de529e4220da8dafc0759" }, "lsp-progress.nvim": { "branch": "main", "commit": "55a04895ea20c365b670051a3128265d43bdfa3d" }, diff --git a/lua/core/init.lua b/lua/core/init.lua index 05aa747..1262ab7 100644 --- a/lua/core/init.lua +++ b/lua/core/init.lua @@ -1,12 +1,12 @@ -require("custom.default") -require("custom.dashboard") -require("config.lazy_lib") -require("user.colorscheme") -require("user.keymaps") +require "custom.default" +require "custom.dashboard" +require "config.lazy_lib" +require "user.colorscheme" +require "user.keymaps" -- require("user.snip") -require("core.neovide") -require("custom.autocmd") -require("custom.keymaps") +require "core.neovide" +require "custom.autocmd" +require "custom.keymaps" -- require("user.nvim-tree") -- require("user.options") -- require("user.keymaps") diff --git a/lua/custom/default.lua b/lua/custom/default.lua index ddec56a..8e18544 100644 --- a/lua/custom/default.lua +++ b/lua/custom/default.lua @@ -5,7 +5,7 @@ -- sonokai, sonokai_atlantis, -- sonokai_andromeda,sonokai_shusia,sonokai_maia,sonokai_espresso -- material, material_deepocean, material_palenight, material_lighter, material_darker --- onedark +-- onedark, onedark_vivid, onedark_dark -- lunar -- nord -- catppuccin, catppuccin-latte, catppuccin-frappe, catppuccin-macchiato, catppuccin-mocha diff --git a/lua/plugins/colorscheme.lua b/lua/plugins/colorscheme.lua index a20a349..4e819b6 100644 --- a/lua/plugins/colorscheme.lua +++ b/lua/plugins/colorscheme.lua @@ -11,7 +11,6 @@ local nightfox = false local sonokai_style = "default" local material_style = "oceanic" -local onedark_style = "dark" _G.switch = function(param, case_table) local case = case_table[param] @@ -22,116 +21,45 @@ _G.switch = function(param, case_table) return def and def() or nil end +_G.substring = function(text, key) + local index, _ = string.find(text, key) + if index then + return true + else + return false + end +end + +_G.extract = function(text) + local result = {} + for substring in string.gmatch(text, "[^_]+") do + table.insert(result, substring) + end + return result +end + local color = vim.g.pcode_colorscheme or "gruvbox-baby" -switch(color, { - ["tokyonight"] = function() - gruvbox = false - tokyonight = true - end, - ["tokyonight-night"] = function() - gruvbox = false - tokyonight = true - end, - ["tokyonight-storm"] = function() - gruvbox = false - tokyonight = true - end, - ["tokyonight-day"] = function() - gruvbox = false - tokyonight = true - end, - ["tokyonight-moon"] = function() - gruvbox = false - tokyonight = true - end, - ["sonokai"] = function() - gruvbox = false - sonokai = true - sonokai_style = "default" - end, - ["sonokai_atlantis"] = function() - gruvbox = false - sonokai = true - sonokai_style = "atlantis" - end, - ["sonokai_andromeda"] = function() - gruvbox = false - sonokai = true - sonokai_style = "andromeda" - end, - ["sonokai_shusia"] = function() - gruvbox = false - sonokai = true - sonokai_style = "shusia" - end, - ["sonokai_maia"] = function() - gruvbox = false - sonokai = true - sonokai_style = "maia" - end, - ["sonokai_espresso"] = function() - gruvbox = false - sonokai = true - sonokai_style = "espresso" - end, - ["material"] = function() - gruvbox = false - material = true - end, - ["material_deepocean"] = function() - gruvbox = false - material = true +if substring(tostring(color), "tokyonight") then + gruvbox = false + tokyonight = true +elseif substring(tostring(color), "sonokai") then + gruvbox = false + sonokai = true + sonokai_style = extract(color)[2] or "default" +elseif substring(tostring(color), "material") then + gruvbox = false + material = true + local materialstyle = extract(color)[2] or "oceanic" + if materialstyle == "deepocean" then material_style = "deep ocean" - end, - ["material_palenight"] = function() - gruvbox = false - material = true - material_style = "palenight" - end, - ["material_lighter"] = function() - gruvbox = false - material = true - material_style = "lighter" - end, - ["material_darker"] = function() - gruvbox = false - material = true - material_style = "darker" - end, - ["onedark"] = function() - gruvbox = false - onedark = true - end, - ["onedark_darker"] = function() - gruvbox = false - onedark = true - onedark_style = "darker" - end, - ["onedark_cool"] = function() - gruvbox = false - onedark = true - onedark_style = "cool" - end, - ["onedark_deep"] = function() - gruvbox = false - onedark = true - onedark_style = "deep" - end, - ["onedark_warm"] = function() - gruvbox = false - onedark = true - onedark_style = "warm" - end, - ["onedark_warmer"] = function() - gruvbox = false - onedark = true - onedark_style = "warmer" - end, - ["onedark_light"] = function() - gruvbox = false - onedark = true - onedark_style = "light" - end, + else + material_style = materialstyle + end +elseif substring(tostring(color), "onedark") then + gruvbox = false + onedark = true +end +switch(color, { ["lunar"] = function() gruvbox = false lunar = true @@ -391,132 +319,6 @@ return { } end, }, - -- { - -- "navarasu/onedark.nvim", - -- enabled = onedark, - -- priority = 1000, - -- config = function() - -- -- Lua - -- local util = require "onedark.util" - -- require("onedark").setup { - -- term_colors = true, - -- style = onedark_style, - -- colors = { - -- bg0 = "#1e222a", - -- green = "#98c379", - -- gray = "#abb2bf", - -- red = "#e06c75", - -- purple = "#c678dd", - -- yellow = "#e5c07b", - -- orange = "#d19a66", - -- blue = "#61afef", - -- cyan = "#56b6c2", - -- bg_d = "$bg", - -- bg1 = "#1e222a", - -- }, - -- code_style = { - -- comments = "italic", - -- keywords = "italic", - -- functions = "none", - -- strings = "none", - -- variables = "none", - -- }, - -- highlights = { - -- NoiceCursor = { fg = "$bg0", bg = "$fg" }, - -- Search = { fg = "$bg0", bg = "$bg_yellow" }, - -- -- BorderBG = { fg = "#333842" }, -- untuk custom brder color cmp - -- -- overide indent line fill color - -- NvimTreeNormal = { fg = "$fg", bg = "$bg0" }, - -- NvimTreeIndentMarker = { fg = "#515661" }, - -- -- NvimTreeGitIgnored = { fg = "$gray", bg = "NONE" }, - -- IblIndent = { fg = "#3E4450" }, - -- -- NvimTreeFolderIcon = { bg = "NONE", fg = "$blue" }, - -- ["@markup.link.url"] = { fg = "$cyan", fmt = "italic" }, - -- ["@text.uri"] = { fg = "$cyan", fmt = "none" }, - -- ["@tag.delimiter"] = { fg = "$gray" }, - -- ["@tag.html"] = { fg = "$red" }, - -- ["@tag.attribute"] = { fg = "$orange", fmt = "italic" }, - -- ["@tag.javascript"] = { fg = "$red" }, - -- ["@constructor.javascript"] = { fg = "$red" }, - -- ["@tag.tsx"] = { fg = "$yellow" }, - -- ["@constructor.tsx"] = { fg = "$yellow" }, - -- -- NvimTreeFolderIcon = { fg = "#FCC76A" }, - -- NvimTreeSpecialFile = { fg = "$yellow", fmt = "italic" }, - -- BufferLineFill = { bg = "$bg0" }, - -- BufferLineUnfocusedFill = { bg = "$bg0" }, - -- StatusLine = { fg = "#f8f8f2", bg = "$bg0" }, - -- StatusLineTerm = { fg = "#f8f8f2", bg = "$bg0" }, - -- illuminatedWord = { bg = "#3b4261" }, - -- illuminatedCurWord = { bg = "#3b4261" }, - -- IlluminatedWordText = { bg = "#3b4261" }, - -- IlluminatedWordRead = { bg = "#3b4261" }, - -- IlluminatedWordWrite = { bg = "#3b4261" }, - -- PmenuSel = { fg = "$fg", bg = "#333842" }, - -- -- overide lualine fill color with bg color - -- LualineNormal = { bg = "$bg0" }, - -- -- overide lualine_c fill color with bg color - -- LualineC = { bg = "$bg0" }, - -- -- overide lualine_x fill color with bg color - -- LualineX = { bg = "$bg0" }, - -- -- overide which-key fill color with bg color - -- WhichKey = { bg = "$bg0" }, - -- -- overide which-key fill color with bg color - -- WhichKeySeperator = { bg = "$bg0" }, - -- -- overide which-key fill color with bg color - -- WhichKeyDesc = { bg = "$bg0" }, - -- -- overide which-key fill color with bg color - -- WhichKeyFloat = { bg = "$bg0" }, - -- -- overide which-key fill color with bg color - -- WhichKeyValue = { bg = "$bg0" }, - -- -- overide which-key fill color with bg color - -- WhichKeyBorder = { bg = "$bg0" }, - -- -- overide Lazy fill color with bg color - -- -- LazyNormal = { bg = "$bg0" }, - -- -- -- overide lazy background color with bg color - -- -- LazyBackground = { bg = "$bg0" }, - -- -- -- overide Lazy fill color with bg color - -- -- LazyH1 = { bg = "$bg0" }, - -- -- -- overide Lazy fill color with bg color - -- -- LazyH2 = { bg = "$bg0" }, - -- -- -- overide Lazy fill color with bg color - -- -- LazyH3 = { bg = "$bg0" }, - -- -- -- overide Lazy fill color with bg color - -- -- LazyH4 = { bg = "$bg0" }, - -- -- -- overide Lazy fill color with bg color - -- -- LazyH5 = { bg = "$bg0" }, - -- -- -- overide Lazy fill color with bg color - -- -- LazyH6 = { bg = "$bg0" }, - -- -- -- overide Lazy fill color with bg color - -- -- LazyButton = { bg = "$bg0" }, - -- -- -- overide Lazy fill color with bg color - -- -- LazyButtonActive = { bg = "$bg0" }, - -- -- -- overide Lazy fill color with bg color - -- -- LazySpecial = { bg = "$bg0" }, - -- -- -- overide Lazy fill color with bg color - -- -- LazyProgress = { bg = "$bg0" }, - -- -- Pmenu = { fg = "$fg", bg = "$bg0" }, - -- CursorLine = { bg = "#333842" }, - -- Cursor = { fg = "$bg0", bg = "$fg" }, -- character under the cursor - -- lCursor = { fg = "$bg0", bg = "$fg" }, -- the character under the cursor when |language-mapping| is used (see 'guicursor') - -- CursorIM = { fg = "$bg0", bg = "$fg" }, -- like Cursor, but used when in IME mode |CursorIM| - -- CursorColumn = { bg = "#333842" }, -- Screen-column at the cursor, when 'cursorcolumn' is set. - -- -- Visual = { bg = "$orange" }, - -- DiffText = { bg = "$orange" }, - -- DiffAdd = { bg = "#595d65" }, - -- MiniIndentscopeSymbol = { fg = "$cyan", nocombine = true }, - -- -- UfoPreviewNormal = { fg = "#373d48", bg = "$bg0" }, - -- -- UfoPreviewBorder = { fg = "#373d48", bg = "$bg0" }, - -- -- UfoPreviewCursorLine = { fg = "#373d48", bg = "$bg0" }, - -- WinBarNC = { fg = "$fg", bg = "NONE" }, - -- }, - -- transparent = transparent, - -- lualine = { - -- transparent = true, - -- }, - -- } - -- require("onedark").load() - -- end, - -- }, { "olimorris/onedarkpro.nvim", priority = 1000, -- Ensure it loads first @@ -541,6 +343,7 @@ return { tags = "italic", }, colors = { + bg_statusline = "#282c34", onedark = { green = "#99c379", gray = "#8094b4", @@ -549,10 +352,12 @@ return { yellow = "#e5c07a", blue = "#61afef", cyan = "#56b6c2", - bg_statusline = "#282c34", indentline = "#3b4261", float_bg = "#282c34", }, + onedark_dark = { + bg_statusline = "#000", + }, }, options = { cursorline = true, @@ -626,6 +431,10 @@ return { -- -- overide which-key fill color with bg color -- WhichKeyBorder = { bg = "${bg}" }, LspInfoBorder = { fg = "${fg}" }, + NormalFloat = { fg = "${fg}", bg = is_transparent and "NONE" or "${bg}" }, + Normal = { fg = "${fg}", bg = is_transparent and "NONE" or "${bg}" }, + NormalNC = { fg = "${fg}", bg = is_transparent and "NONE" or "${bg}" }, + FloatBorder = { fg = "${fg}", bg = is_transparent and "NONE" or "${bg}" }, }, } end, diff --git a/lua/user/colorscheme.lua b/lua/user/colorscheme.lua index 25d0292..2ec3785 100644 --- a/lua/user/colorscheme.lua +++ b/lua/user/colorscheme.lua @@ -1,53 +1,16 @@ local colorscheme = vim.g.pcode_colorscheme or "gruvbox-baby" -local lst_style = { - "sonokai", - "sonokai_atlantis", - "sonokai_andromeda", - "sonokai_shusia", - "sonokai_maia", - "sonokai_espresso", -} -local lst_material = { - "material", - "material_deepocean", - "material_palenight", - "material_lighter", - "material_darker", -} -local lst_onedark = { - "onedark", - "onedark_darker", - "onedark_cool", - "onedark_deep,onedark_warm", - "onedark_warmer", - "onedark_light", -} - local transparent_mode = vim.g.pcode_transparent_mode or 0 if transparent_mode ~= nil then - if transparent_mode == 1 then - vim.g.gruvbox_baby_transparent_mode = 1 - vim.g.sonokai_transparent_background = 2 - end + if transparent_mode == 1 then + vim.g.gruvbox_baby_transparent_mode = 1 + vim.g.sonokai_transparent_background = 2 + end end -for _, v in pairs(lst_style) do - if v == colorscheme then - colorscheme = "sonokai" - break - end -end -for _, v in pairs(lst_material) do - if v == colorscheme then - colorscheme = "material" - break - end -end -for _, v in pairs(lst_onedark) do - if v == colorscheme then - colorscheme = "onedark" - break - end +if substring(tostring(colorscheme), "sonokai") then + colorscheme = "sonokai" +elseif substring(tostring(colorscheme), "material") then + colorscheme = "material" end vim.cmd("colorscheme " .. colorscheme)