diff --git a/lazy-lock.json b/lazy-lock.json index f3717b0..75c7a75 100644 --- a/lazy-lock.json +++ b/lazy-lock.json @@ -24,7 +24,7 @@ "lualine.nvim": { "branch": "master", "commit": "e99d733e0213ceb8f548ae6551b04ae32e590c80" }, "mason-lspconfig.nvim": { "branch": "main", "commit": "e4badf7984f7a5f0ac7dc10657dbedbd99a82f94" }, "mason-null-ls.nvim": { "branch": "main", "commit": "29ce60f9a16fef3de682a9365ef635f24ae92bf9" }, - "mason.nvim": { "branch": "main", "commit": "51228a60d1a5017030429ba38f018ff27a460c76" }, + "mason.nvim": { "branch": "main", "commit": "2237ebfecf70de911b0e2174128217b3fd6744b4" }, "mini.animate": { "branch": "main", "commit": "b0c717ed5513b5f23e7c48615449c7dc9fabd05b" }, "mini.indentscope": { "branch": "main", "commit": "7998edc970610c05598c7aea3d21ece8dd87ed52" }, "neoscroll.nvim": { "branch": "master", "commit": "d7601c26c8a183fa8994ed339e70c2d841253e93" }, diff --git a/lua/core/config.lua b/lua/core/config.lua new file mode 100644 index 0000000..6d11708 --- /dev/null +++ b/lua/core/config.lua @@ -0,0 +1,38 @@ +local config + +-- shim vim for kitty and other generators +vim = vim or { g = {}, o = {} } + +local function opt(key, default) + key = "pcode_" .. key + if vim.g[key] == nil then + return default + end + -- if vim.g[key] == 0 then + -- return false + -- end + return vim.g[key] +end + +config = { + colorscheme = opt("colorscheme", "gruvbox-baby"), + transparent_mode = opt("transparent_mode", 0), + progress = opt("progress", 2), + lualine_style = opt("lualine_style", 0), + status_icon = opt("status_icon", 0), + custom_lualine = opt("custom_lualine", false), + component_separators = opt("component_separators", { left = " ", right = " " }), + section_separators = opt("section_separators", { left = " ", right = " " }), + dashboard1 = opt("dashboard1", nil), + dashboard2 = opt("dashboard2", nil), + footer = opt("footer", nil), + model = opt("model", 1), + format_on_save = opt("format_on_save", 1), + lsp_installer = opt("lsp_installer", {}), + register_lsp = opt("register_lsp", {}), + unregister_lsp = opt("unregister_lsp", {}), + null_ls_sources = opt("null_ls_sources", {}), + whichkey = opt("whichkey", {}), +} + +return config diff --git a/lua/core/init.lua b/lua/core/init.lua index d77c1ad..8442793 100644 --- a/lua/core/init.lua +++ b/lua/core/init.lua @@ -1,3 +1,5 @@ +require("custom.default") +require("custom.dashboard") require("config.lazy") require("user.colorscheme") require("user.keymaps") diff --git a/lua/custom/dashboard.lua b/lua/custom/dashboard.lua index 3fa0473..8de55f4 100644 --- a/lua/custom/dashboard.lua +++ b/lua/custom/dashboard.lua @@ -1,10 +1,8 @@ -local M = {} - -- Untuk Ubah Dashboard -- 1. Buka remark dash board dibawah -- 2. Ubah dashboard sesuai keinginan dan kebutuhan --- M.dashboard1 = { +-- vim.g.pcode_dashboard1 = { -- [[ _ __ __ ]], -- [[ ___ ___ (____ / /__ _______ ___/ ___ ]], -- [[ / _ / _ \ / / _ \/ '_/ / __/ _ / _ / -_) ]], @@ -12,7 +10,7 @@ local M = {} -- [[ /_/ |___/ ]], -- } --- M.dashboard2 = { +-- vim.g.pcode_dashboard2 = { -- [[ __ ]], -- [[ ___ ___ ___ __ __ /\_\ ___ ___ ]], -- [[ / _ `\ / __`\ / __`\/\ \/\ \\/\ \ / __` __`\ ]], @@ -20,8 +18,6 @@ local M = {} -- [[\ \_\ \_\ \____\ \____/\ \___/ \ \_\ \_\ \_\ \_\]], -- [[ \/_/\/_/\/____/\/___/ \/__/ \/_/\/_/\/_/\/_/]], -- } --- M.footer = "PCode" +-- vim.g.pcode_footer = "PCode" -M.model = 1 -- isi dengan 1 atau 2 untuk model dashboard - -return M +vim.g.pcode_model = 2 -- isi dengan 1 atau 2 untuk model dashboard diff --git a/lua/custom/default.lua b/lua/custom/default.lua new file mode 100644 index 0000000..a9c1f9c --- /dev/null +++ b/lua/custom/default.lua @@ -0,0 +1,115 @@ +-- custom colorscheme +-- colorscheme ready : +-- tokyonight, tokyonight-night, tokyonight-storm, tokyonight-day, tokyonight-moon +-- gruvbox-baby (default) +-- sonokai, sonokai_atlantis, +-- sonokai_andromeda,sonokai_shusia,sonokai_maia,sonokai_espresso +-- material, material_deepocean, material_palenight, material_lighter, material_darker +-- onedark, onedark_darker, onedark_cool, onedark_deep,onedark_warm, +-- onedark_warmer, onedark_light +-- lunar +-- nord +-- catppuccin, catppuccin-latte, catppuccin-frappe, catppuccin-macchiato, catppuccin-mocha +-- dracula +-- nightfox, dayfox, dawnfox, duskfox, nordfox, terafox, carbonfox +vim.g.pcode_colorscheme = "gruvbox-baby" +-- custom transparent mode +-- only support +-- gruvbox-baby, +-- tokyonight, +-- sonokai, +-- material +-- onedark +-- catppuccin +-- nord +-- dracula +-- nightfox +-- 0 =off 1= on +vim.g.pcode_transparent_mode = 0 +-- 0 disable progress +-- 1 lualine lsp progress +-- 2 fidget progress +vim.g.pcode_progress = 1 +-- style +-- 0 = default +-- 1 = { left = "", right = "" }, +-- 2 = { left = " ", right = " " }, +-- 3 = { left = "", right = "" }, +vim.g.pcode_lualine_style = 0 +-- style status icon +-- 0 = default +-- 1 = vim icon " " +-- 2 = vim icon " " +vim.g.pcode_status_icon = 0 +-- start custom lualine style +-- contoh style +-- { +-- { left = "│", right = "│" }, +-- { left = " ", right = " " }, +-- }, +-- { +-- { left = " ", right = " " }, +-- { left = " ", right = "" }, +-- }, +-- { +-- { left = " ", right = " " }, +-- { left = "", right = "" }, +-- }, +-- { +-- { left = "", right = "" }, +-- { left = "", right = "" }, +-- }, +-- { +-- { left = " ", right = " " }, +-- { left = "", right = "" }, +-- }, +-- } +vim.g.pcode_custom_lualine = false +vim.g.pcode_component_separators = { left = " ", right = " " } +vim.g.pcode_section_separators = { left = "", right = " " } +-- 0 ( format jalan) 1 (fromat off) +vim.g.pcode_format_on_save = 1 +-- ini hanya untuk lsp yg tidak support masson +-- untuk referesi support language kunjungi link dibawah +-- https://github.com/neovim/nvim-lspconfig/blob/master/doc/server_configurations.md +vim.g.pcode_lsp_installer = { + "yamlls", + -- tambahkan di bawah sini setelah melakukan :masoninstall +} +-- untuk referesi support language kunjungi link dibawah +-- https://github.com/neovim/nvim-lspconfig/blob/master/doc/server_configurations.md +vim.g.pcode_register_lsp = { + "yamlls", + "intelephense", + "marksman", + "csharp_ls", + "clangd", + "dartls", + "kotlin_language_server", + -- tambahkan di bawah sini setelah melakukan :masoninstall +} +vim.g.pcode_unregister_lsp = { + "jdtls", -- tambahkan di bawah ini +} + +-- https://github.com/jose-elias-alvarez/null-ls.nvim/blob/main/doc/BUILTINS.md +local formatting = {} +local diagnostics = {} +vim.g.pcode_null_ls_sources = { + formatting.stylua, -- tambahkan di bawah sini + diagnostics.flake8, -- tambahkan di bawah sini +} + +-- https://github.com/folke/which-key.nvim +vim.g.pcode_whichkey = { + -- contoh penambahan + -- ["k"] = { + -- name = "Example", + -- k = { 'lua print("Testing")', "Example" }, + -- }, + ["r"] = { + name = "Run", + j = { "Jaq float", "Run With Jaq" }, + }, + ["o"] = { "SymbolsOutline", "Symbol Outline" }, +} diff --git a/lua/custom/format_onsave.lua b/lua/custom/format_onsave.lua deleted file mode 100644 index 085c4ef..0000000 --- a/lua/custom/format_onsave.lua +++ /dev/null @@ -1,5 +0,0 @@ -local M = { - disable = 0, -- 0 ( format jalan) 1 (fromat off) -} - -return M diff --git a/lua/custom/lsp_installer.lua b/lua/custom/lsp_installer.lua deleted file mode 100644 index b62203f..0000000 --- a/lua/custom/lsp_installer.lua +++ /dev/null @@ -1,10 +0,0 @@ --- ini hanya untuk lsp yg tidak support masson --- untuk referesi support language kunjungi link dibawah --- https://github.com/neovim/nvim-lspconfig/blob/master/doc/server_configurations.md -local m = { - lspinstall = { - "yamlls", - -- tambahkan di bawah sini setelah melakukan :masoninstall - }, -} -return m diff --git a/lua/custom/null-ls.lua b/lua/custom/null-ls.lua deleted file mode 100644 index 206fcd5..0000000 --- a/lua/custom/null-ls.lua +++ /dev/null @@ -1,10 +0,0 @@ -local null_ls = require("null-ls") -local formatting = null_ls.builtins.formatting -local diagnostics = null_ls.builtins.diagnostics -local m = { - sources = { - formatting.stylua, -- tambahkan di bawah sini - diagnostics.flake8, -- tambahkan di bawah sini - }, -} -return m diff --git a/lua/custom/register_lsp.lua b/lua/custom/register_lsp.lua deleted file mode 100644 index a7e416d..0000000 --- a/lua/custom/register_lsp.lua +++ /dev/null @@ -1,18 +0,0 @@ --- untuk referesi support language kunjungi link dibawah --- https://github.com/neovim/nvim-lspconfig/blob/master/doc/server_configurations.md -local m = { - lspreg = { - "yamlls", - "intelephense", - "marksman", - "csharp_ls", - "clangd", - "dartls", - "kotlin_language_server", - -- tambahkan di bawah sini setelah melakukan :masoninstall - }, - skipreg = { - "jdtls", -- tambahkan di bawah ini - }, -} -return m diff --git a/lua/custom/ui.lua b/lua/custom/ui.lua deleted file mode 100644 index 0598a47..0000000 --- a/lua/custom/ui.lua +++ /dev/null @@ -1,73 +0,0 @@ -local m = {} --- 0 disable progress --- 1 lualine lsp progress --- 2 fidget progress -m.progress = 1 --- style --- 0 = default --- 1 = { left = "", right = "" }, --- 2 = { left = " ", right = " " }, --- 3 = { left = "", right = "" }, -m.lualine_style = 0 --- style status icon --- 0 = default --- 1 = vim icon " " --- 2 = vim icon " " -m.status_icon = 0 --- start custom lualine style --- contoh style --- { --- { left = "│", right = "│" }, --- { left = " ", right = " " }, --- }, --- { --- { left = " ", right = " " }, --- { left = " ", right = "" }, --- }, --- { --- { left = " ", right = " " }, --- { left = "", right = "" }, --- }, --- { --- { left = "", right = "" }, --- { left = "", right = "" }, --- }, --- { --- { left = " ", right = " " }, --- { left = "", right = "" }, --- }, --- } -m.custom_lualine = false -m.component_separators = { left = " ", right = " " } -m.section_separators = { left = "", right = " " } --- end custom lualine style - --- custom colorscheme --- colorscheme ready : --- tokyonight, tokyonight-night, tokyonight-storm, tokyonight-day, tokyonight-moon --- gruvbox-baby (default) --- sonokai, sonokai_atlantis, --- sonokai_andromeda,sonokai_shusia,sonokai_maia,sonokai_espresso --- material, material_deepocean, material_palenight, material_lighter, material_darker --- onedark, onedark_darker, onedark_cool, onedark_deep,onedark_warm, --- onedark_warmer, onedark_light --- lunar --- nord --- catppuccin, catppuccin-latte, catppuccin-frappe, catppuccin-macchiato, catppuccin-mocha --- dracula --- nightfox, dayfox, dawnfox, duskfox, nordfox, terafox, carbonfox -m.colorscheme = "gruvbox-baby" --- custom transparent mode --- only support --- gruvbox-baby, --- tokyonight, --- sonokai, --- material --- onedark --- catppuccin --- nord --- dracula --- nightfox --- 0 =off 1= on -m.transparent_mode = 0 -return m diff --git a/lua/custom/whichkey.lua b/lua/custom/whichkey.lua deleted file mode 100644 index c331246..0000000 --- a/lua/custom/whichkey.lua +++ /dev/null @@ -1,12 +0,0 @@ -return { - -- contoh penambahan - -- ["k"] = { - -- name = "Example", - -- k = { 'lua print("Testing")', "Example" }, - -- }, - ["r"] = { - name = "Run", - j = { "Jaq float", "Run With Jaq" }, - }, - ["o"] = { "SymbolsOutline", "Symbol Outline" }, -} diff --git a/lua/plugins/colorscheme.lua b/lua/plugins/colorscheme.lua index b635911..925d718 100644 --- a/lua/plugins/colorscheme.lua +++ b/lua/plugins/colorscheme.lua @@ -22,10 +22,10 @@ _G.switch = function(param, case_table) return def and def() or nil end -local data_exists, custom_ui = pcall(require, "custom.ui") +local data_exists, config = pcall(require, "core.config") if data_exists then - if type(custom_ui) == "table" then - local color = custom_ui.colorscheme + if config.colorscheme ~= nil then + local color = config.colorscheme switch(color, { ["tokyonight"] = function() gruvbox = false @@ -206,7 +206,7 @@ if data_exists then end local transparent = false -local transparent_mode = custom_ui.transparent_mode +local transparent_mode = config.transparent_mode if transparent_mode ~= nil then if transparent_mode == 1 then transparent = true diff --git a/lua/plugins/lspprogress.lua b/lua/plugins/lspprogress.lua index 4028528..9411e87 100644 --- a/lua/plugins/lspprogress.lua +++ b/lua/plugins/lspprogress.lua @@ -1,6 +1,6 @@ local fidget = true local lualine = false -local data_exists, custom_ui = pcall(require, "custom.ui") +local data_exists, custom_ui = pcall(require, "core.config") if data_exists then if type(custom_ui) == "table" then if custom_ui.progress == 1 then diff --git a/lua/user/alpha.lua b/lua/user/alpha.lua index dd97e93..7eb78f9 100644 --- a/lua/user/alpha.lua +++ b/lua/user/alpha.lua @@ -1,16 +1,14 @@ -local data_exists, custom_dasboard = pcall(require, "custom.dashboard") +local data_exists, custom_dasboard = pcall(require, "core.config") if data_exists then - if type(custom_dasboard) == "table" then - local model = custom_dasboard.model - if model ~= nil then - if model == 1 then - require("user.startify") - else - require("user.dashboard") - end - else + local model = custom_dasboard.model + if model ~= nil then + if model == 1 then require("user.startify") + else + require("user.dashboard") end + else + require("user.startify") end else require("user.startify") diff --git a/lua/user/colorscheme.lua b/lua/user/colorscheme.lua index 6b4af9f..3f09ce2 100644 --- a/lua/user/colorscheme.lua +++ b/lua/user/colorscheme.lua @@ -4,21 +4,18 @@ local lst_style = 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, config = pcall(require, "core.config") if data_exists then - if type(custom_ui) == "table" then - local color = custom_ui.colorscheme - if color ~= nil then - colorscheme = color - else - colorscheme = "gruvbox-baby" - end - local transparent_mode = custom_ui.transparent_mode - 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 config.colorscheme ~= nil then + colorscheme = config.colorscheme + else + colorscheme = "gruvbox-baby" + end + local transparent_mode = config.transparent_mode + if transparent_mode ~= nil then + if transparent_mode == 1 then + vim.g.gruvbox_baby_transparent_mode = 1 + vim.g.sonokai_transparent_background = 2 end end end diff --git a/lua/user/dashboard.lua b/lua/user/dashboard.lua index 8a88afd..d7c6074 100644 --- a/lua/user/dashboard.lua +++ b/lua/user/dashboard.lua @@ -14,13 +14,11 @@ local board = { [[|_| |__/ ]], } -local data_exists, custom_dasboard = pcall(require, "custom.dashboard") +local data_exists, custom_dasboard = pcall(require, "core.config") if data_exists then - if type(custom_dasboard) == "table" then - local data_board = custom_dasboard.dashboard2 - if data_board ~= nil then - board = data_board - end + local data_board = custom_dasboard.dashboard2 + if data_board ~= nil then + board = data_board end end @@ -40,11 +38,9 @@ dashboard.section.buttons.val = { local function footer() local footer_text = "Pojok Code" if data_exists then - if type(custom_dasboard) == "table" then - local data_txt = custom_dasboard.footer - if data_txt ~= nil then - footer_text = data_txt - end + local data_txt = custom_dasboard.footer + if data_txt ~= nil then + footer_text = data_txt end end diff --git a/lua/user/format_onsave.lua b/lua/user/format_onsave.lua index a048bdb..c8aca34 100644 --- a/lua/user/format_onsave.lua +++ b/lua/user/format_onsave.lua @@ -1,9 +1,9 @@ local run = 0 -local data_exists, frmt = pcall(require, "custom.format_onsave") +local data_exists, frmt = pcall(require, "core.config") if not data_exists then run = 1 end -if frmt.disable == 0 then +if frmt.format_on_save == 1 then run = 1 end diff --git a/lua/user/lsp/config.lua b/lua/user/lsp/config.lua index 3239a23..7dc53e5 100644 --- a/lua/user/lsp/config.lua +++ b/lua/user/lsp/config.lua @@ -9,14 +9,13 @@ local lspconfig = require("lspconfig") -- local servers = { "jdtls", "yamlls" } local servers = {} -local data_exists, custom_lsp = pcall(require, "custom.lsp_installer") +local data_exists, custom_lsp = pcall(require, "core.config") if data_exists then - for _, client in pairs(custom_lsp.lspinstall) do + for _, client in pairs(custom_lsp.lsp_installer) do table.insert(servers, client) end end - lsp_installer.setup({ ensure_installed = servers, }) diff --git a/lua/user/lsp/mason.lua b/lua/user/lsp/mason.lua index 7948a51..2a741e9 100644 --- a/lua/user/lsp/mason.lua +++ b/lua/user/lsp/mason.lua @@ -17,17 +17,17 @@ local function idxOf(array, value) return nil end -local data_exists, custom_lsp = pcall(require, "custom.register_lsp") +local data_exists, custom_lsp = pcall(require, "core.config") if data_exists then - for _, client in pairs(custom_lsp.lspreg) do + for _, client in pairs(custom_lsp.register_lsp) do table.insert(servers, client) end end -local data_ok, unregis = pcall(require, "custom.register_lsp") +local data_ok, unregis = pcall(require, "core.config") if data_ok then - if unregis.skip_reg ~= nil then - for _, unreg in pairs(custom_lsp.skip_reg) do + if unregis.unregister_lsp ~= nil then + for _, unreg in pairs(custom_lsp.unregister_lsp) do local my_index = idxOf(servers, unreg) table.remove(servers, my_index) end diff --git a/lua/user/lsp/null-ls.lua b/lua/user/lsp/null-ls.lua index e969c84..61298ba 100644 --- a/lua/user/lsp/null-ls.lua +++ b/lua/user/lsp/null-ls.lua @@ -12,19 +12,19 @@ local augroup = vim.api.nvim_create_augroup("LspFormatting", {}) local sources = {} -local data_exists, data = pcall(require, "custom.null-ls") +local data_exists, data = pcall(require, "core.config") if data_exists then - for _, cfg in pairs(data.sources) do + for _, cfg in pairs(data.null_ls_sources) do table.insert(sources, cfg) end end local run = 0 -local data_exists, frmt = pcall(require, "custom.format_onsave") -if not data_exists then +local ok, frmt = pcall(require, "core.config") +if not ok then run = 1 end -if frmt.disable == 0 then +if frmt.format_on_save == 1 then run = 1 end diff --git a/lua/user/lualine.lua b/lua/user/lualine.lua index 7f9d901..655846d 100644 --- a/lua/user/lualine.lua +++ b/lua/user/lualine.lua @@ -53,40 +53,38 @@ local section_separators = { left = "", right = "" } local icon_mode = "" local sts_mode = 0 -local data_exists, custom_ui = pcall(require, "custom.ui") +local data_exists, custom_ui = pcall(require, "core.config") if data_exists then - if type(custom_ui) == "table" then - local ui_style = custom_ui.lualine_style - if ui_style ~= nil then - if custom_ui.lualine_style == 1 then - component_separators = { left = "", right = "" } - section_separators = { left = "", right = "" } - elseif custom_ui.lualine_style == 2 then - component_separators = { left = "", right = "" } - section_separators = { left = " ", right = " " } - elseif custom_ui.lualine_style == 3 then - component_separators = { left = "", right = "" } - section_separators = { left = "", right = "" } - end + local ui_style = custom_ui.lualine_style + if ui_style ~= nil then + if custom_ui.lualine_style == 1 then + component_separators = { left = "", right = "" } + section_separators = { left = "", right = "" } + elseif custom_ui.lualine_style == 2 then + component_separators = { left = "", right = "" } + section_separators = { left = " ", right = " " } + elseif custom_ui.lualine_style == 3 then + component_separators = { left = "", right = "" } + section_separators = { left = "", right = "" } end - local ui_icon = custom_ui.status_icon - if ui_icon ~= nil then - if custom_ui.status_icon == 1 then - icon_mode = " " - sts_mode = 1 - elseif custom_ui.status_icon == 2 then - icon_mode = " " - sts_mode = 1 - end + end + local ui_icon = custom_ui.status_icon + if ui_icon ~= nil then + if custom_ui.status_icon == 1 then + icon_mode = " " + sts_mode = 1 + elseif custom_ui.status_icon == 2 then + icon_mode = " " + sts_mode = 1 end - local custom_style = custom_ui.custom_lualine - if custom_style ~= nil and custom_style == true then - local comp = custom_ui.component_separators - local section = custom_ui.section_separators - if comp ~= nil and section ~= nil then - component_separators = comp - section_separators = section - end + end + local custom_style = custom_ui.custom_lualine + if custom_style ~= nil and custom_style == true then + local comp = custom_ui.component_separators + local section = custom_ui.section_separators + if comp ~= nil and section ~= nil then + component_separators = comp + section_separators = section end end end diff --git a/lua/user/startify.lua b/lua/user/startify.lua index 972a593..b247369 100644 --- a/lua/user/startify.lua +++ b/lua/user/startify.lua @@ -9,13 +9,11 @@ dash_model = { [[ /_/ |___/ ]], } -local data_exists, custom_dasboard = pcall(require, "custom.dashboard") +local data_exists, custom_dasboard = pcall(require, "core.config") if data_exists then - if type(custom_dasboard) == "table" then - local board = custom_dasboard.dashboard1 - if board ~= nil then - dash_model = board - end + local board = custom_dasboard.dashboard1 + if board ~= nil then + dash_model = board end end startify.section.header.val = dash_model @@ -44,11 +42,9 @@ startify.section.bottom_buttons.val = { local footer_text = "Pojok Code" if data_exists then - if type(custom_dasboard) == "table" then - local data_txt = custom_dasboard.footer - if data_txt ~= nil then - footer_text = data_txt - end + local data_txt = custom_dasboard.footer + if data_txt ~= nil then + footer_text = data_txt end end startify.section.footer.val = { diff --git a/lua/user/tokyonight.lua b/lua/user/tokyonight.lua index 7b5c017..59af1a2 100644 --- a/lua/user/tokyonight.lua +++ b/lua/user/tokyonight.lua @@ -4,14 +4,12 @@ if not status_ok then end local transp = false local sidebar = "dark" -local data_exists, custom_ui = pcall(require, "custom.ui") +local data_exists, config = pcall(require, "core.config") if data_exists then - if type(custom_ui) == "table" then - local tras = custom_ui.transparent_mode - if tras ~= nil and tras == 1 then - transp = true - sidebar = "transparent" - end + local tras = config.transparent_mode + if tras == 1 then + transp = true + sidebar = "transparent" end end tokyonight.setup({ diff --git a/lua/user/whichkey.lua b/lua/user/whichkey.lua index 9115c3a..2bb581a 100644 --- a/lua/user/whichkey.lua +++ b/lua/user/whichkey.lua @@ -395,11 +395,9 @@ local mappings = { } local wkey = {} -local data_exists, key = pcall(require, "custom.whichkey") +local data_exists, key = pcall(require, "core.config") if data_exists then - if type(key) == "table" then - wkey = key - end + wkey = key.whichkey end which_key.setup(setup)