support config color scheme

This commit is contained in:
asep komarudin 2023-03-05 10:49:03 +07:00
parent ee7e49f922
commit b6f0601d3d
5 changed files with 181 additions and 42 deletions

View file

@ -24,7 +24,7 @@
"lualine.nvim": { "branch": "master", "commit": "e99d733e0213ceb8f548ae6551b04ae32e590c80" }, "lualine.nvim": { "branch": "master", "commit": "e99d733e0213ceb8f548ae6551b04ae32e590c80" },
"mason-lspconfig.nvim": { "branch": "main", "commit": "e4badf7984f7a5f0ac7dc10657dbedbd99a82f94" }, "mason-lspconfig.nvim": { "branch": "main", "commit": "e4badf7984f7a5f0ac7dc10657dbedbd99a82f94" },
"mason-null-ls.nvim": { "branch": "main", "commit": "29ce60f9a16fef3de682a9365ef635f24ae92bf9" }, "mason-null-ls.nvim": { "branch": "main", "commit": "29ce60f9a16fef3de682a9365ef635f24ae92bf9" },
"mason.nvim": { "branch": "main", "commit": "7175340eee0b1b4a86b38794d8c21fdcfa01376b" }, "mason.nvim": { "branch": "main", "commit": "51228a60d1a5017030429ba38f018ff27a460c76" },
"mini.animate": { "branch": "main", "commit": "b0c717ed5513b5f23e7c48615449c7dc9fabd05b" }, "mini.animate": { "branch": "main", "commit": "b0c717ed5513b5f23e7c48615449c7dc9fabd05b" },
"mini.indentscope": { "branch": "main", "commit": "7998edc970610c05598c7aea3d21ece8dd87ed52" }, "mini.indentscope": { "branch": "main", "commit": "7998edc970610c05598c7aea3d21ece8dd87ed52" },
"neoscroll.nvim": { "branch": "master", "commit": "d7601c26c8a183fa8994ed339e70c2d841253e93" }, "neoscroll.nvim": { "branch": "master", "commit": "d7601c26c8a183fa8994ed339e70c2d841253e93" },

View file

@ -67,24 +67,9 @@ return {
require("user.neoscroll") require("user.neoscroll")
end, end,
}, },
-- { "ahmedkhalf/project.nvim", commit = "628de7e433dd503e782831fe150bb750e56e55d6", event = "VeryLazy" }, -- {
-- "linrongbin16/lsp-progress.nvim", -- { "ahmedkhalf/project.nvim", commit = "628de7e433dd503e782831fe150bb750e56e55d6", event = "VeryLazy" }, --
-- branch = "main",
-- event = { "VimEnter" },
-- config = function()
-- require("lsp-progress").setup({
-- format = function(client_messages)
-- local sign = "" -- nf-fa-gear \uf013
-- return #client_messages > 0 and (sign .. " " .. table.concat(client_messages, " ")) or sign
-- end,
-- })
-- end,
-- -- },
-- { "arkav/lualine-lsp-progress", event = "BufRead" },
-- { "j-hui/fidget.nvim", enabled = false },
--
-- additional plugins -- additional plugins
-- active indent guide and indent text objects
-- makes some plugins dot-repeatable like leap -- makes some plugins dot-repeatable like leap
-- { "tpope/vim-repeat", event = "VeryLazy" }, -- { "tpope/vim-repeat", event = "VeryLazy" },
-- better diagnostics list and others -- better diagnostics list and others
@ -120,18 +105,6 @@ return {
-- require("user.indent-o-matic") -- require("user.indent-o-matic")
-- end, -- end,
-- }, -- },
-- Lsp Saga
-- {
-- "glepnir/lspsaga.nvim",
-- event = "BufRead",
-- config = function()
-- require("lspsaga").setup({})
-- end,
-- dependencies = { { "kyazdani42/nvim-web-devicons" } },
-- init = function()
-- require("user.lspsaga_config")
-- end,
-- },
-- Khusus Projek laravel baru di buka -- Khusus Projek laravel baru di buka
-- { -- {
-- "adalessa/laravel.nvim", -- "adalessa/laravel.nvim",

View file

@ -44,19 +44,18 @@ m.section_separators = { left = "", right = " " }
-- custom colorscheme -- custom colorscheme
-- colorscheme ready : -- colorscheme ready :
-- tokyonight -- tokyonight, tokyonight-night, tokyonight-storm, tokyonight-day, tokyonight-moon
-- tokyonight-night
-- tokyonight-storm
-- tokyonight-day
-- tokyonight-moon
-- gruvbox-baby (default) -- gruvbox-baby (default)
-- sonokai -- sonokai, sonokai_atlantis,
-- material -- sonokai_andromeda,sonokai_shusia,sonokai_maia,sonokai_espresso
-- onedark -- material, material_deepocean, material_palenight, material_lighter, material_darker
-- onedark, onedark_darker, onedark_cool, onedark_deep,onedark_warm,
-- onedark_warmer, onedark_light
-- lunar -- lunar
-- nord -- nord
-- catppuccin -- catppuccin, catppuccin-latte, catppuccin-frappe, catppuccin-macchiato, catppuccin-mocha
-- dracula -- dracula
-- nightfox, dayfox, dawnfox, duskfox, nordfox, terafox, carbonfox
m.colorscheme = "gruvbox-baby" m.colorscheme = "gruvbox-baby"
-- custom transparent mode -- custom transparent mode
-- only support -- only support
@ -68,6 +67,7 @@ m.colorscheme = "gruvbox-baby"
-- catppuccin -- catppuccin
-- nord -- nord
-- dracula -- dracula
-- nightfox
-- 0 =off 1= on -- 0 =off 1= on
m.transparent_mode = 0 m.transparent_mode = 0
return m return m

View file

@ -7,6 +7,11 @@ local lunar = false
local material = false local material = false
local onedark = false local onedark = false
local catppuccin = false local catppuccin = false
local nightfox = false
local sonokai_style = "default"
local material_style = "oceanic"
local onedark_style = "dark"
_G.switch = function(param, case_table) _G.switch = function(param, case_table)
local case = case_table[param] local case = case_table[param]
@ -45,15 +50,91 @@ if data_exists then
["sonokai"] = function() ["sonokai"] = function()
gruvbox = false gruvbox = false
sonokai = true 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, end,
["material"] = function() ["material"] = function()
gruvbox = false gruvbox = false
material = true material = true
end, end,
["material_deepocean"] = function()
gruvbox = false
material = true
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() ["onedark"] = function()
gruvbox = false gruvbox = false
onedark = true onedark = true
end, 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,
["lunar"] = function() ["lunar"] = function()
gruvbox = false gruvbox = false
lunar = true lunar = true
@ -66,10 +147,54 @@ if data_exists then
gruvbox = false gruvbox = false
catppuccin = true catppuccin = true
end, end,
["catppuccin-latte"] = function()
gruvbox = false
catppuccin = true
end,
["catppuccin-frappe"] = function()
gruvbox = false
catppuccin = true
end,
["catppuccin-macchiato"] = function()
gruvbox = false
catppuccin = true
end,
["catppuccin-mocha"] = function()
gruvbox = false
catppuccin = true
end,
["dracula"] = function() ["dracula"] = function()
gruvbox = false gruvbox = false
dracula = true dracula = true
end, end,
["nightfox"] = function()
gruvbox = false
nightfox = true
end,
["dayfox"] = function()
gruvbox = false
nightfox = true
end,
["dawnfox"] = function()
gruvbox = false
nightfox = true
end,
["duskfox"] = function()
gruvbox = false
nightfox = true
end,
["nordfox"] = function()
gruvbox = false
nightfox = true
end,
["terafox"] = function()
gruvbox = false
nightfox = true
end,
["carbonfox"] = function()
gruvbox = false
nightfox = true
end,
["gruvbox-baby"] = function() ["gruvbox-baby"] = function()
gruvbox = true gruvbox = true
end, end,
@ -119,13 +244,19 @@ return {
require("nord").set() require("nord").set()
end, end,
}, },
{ "sainnhe/sonokai", enabled = sonokai }, {
"sainnhe/sonokai",
enabled = sonokai,
config = function()
vim.g.sonokai_style = sonokai_style
end,
},
{ "lunarvim/lunar.nvim", enabled = lunar }, { "lunarvim/lunar.nvim", enabled = lunar },
{ {
"marko-cerovac/material.nvim", "marko-cerovac/material.nvim",
enabled = material, enabled = material,
config = function() config = function()
vim.g.material_style = "palenight" vim.g.material_style = material_style
require("material").setup({ require("material").setup({
lualine_style = "stealth", lualine_style = "stealth",
disable = { disable = {
@ -141,7 +272,7 @@ return {
config = function() config = function()
-- Lua -- Lua
require("onedark").setup({ require("onedark").setup({
style = "darker", style = onedark_style,
transparent = transparent, transparent = transparent,
lualine = { lualine = {
transparent = transparent, transparent = transparent,
@ -158,4 +289,15 @@ return {
require("user.catppuccin") require("user.catppuccin")
end, end,
}, },
{
"EdenEast/nightfox.nvim",
enabled = nightfox,
config = function()
require("nightfox").setup({
options = {
transparent = transparent,
},
})
end,
},
} }

View file

@ -1,4 +1,9 @@
local colorscheme = "gruvbox-baby" local colorscheme = "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 data_exists, custom_ui = pcall(require, "custom.ui") local data_exists, custom_ui = pcall(require, "custom.ui")
if data_exists then if data_exists then
if type(custom_ui) == "table" then if type(custom_ui) == "table" then
@ -17,6 +22,25 @@ if data_exists then
end end
end end
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
end
local status_ok, _ = pcall(vim.cmd, "colorscheme " .. colorscheme) local status_ok, _ = pcall(vim.cmd, "colorscheme " .. colorscheme)
if not status_ok then if not status_ok then
local ok, _ = pcall(vim.cmd, "colorscheme " .. "gruvbox-baby") local ok, _ = pcall(vim.cmd, "colorscheme " .. "gruvbox-baby")