mirror of
https://github.com/pojokcodeid/nvim-lazy.git
synced 2025-06-23 17:28:50 +02:00
migrate config form function to global variable
This commit is contained in:
parent
b6f0601d3d
commit
38d2c29a95
24 changed files with 248 additions and 245 deletions
38
lua/core/config.lua
Normal file
38
lua/core/config.lua
Normal file
|
@ -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
|
|
@ -1,3 +1,5 @@
|
|||
require("custom.default")
|
||||
require("custom.dashboard")
|
||||
require("config.lazy")
|
||||
require("user.colorscheme")
|
||||
require("user.keymaps")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue