-
-
Notifications
You must be signed in to change notification settings - Fork 9
Utils.Class.Config
sravioli edited this page Oct 27, 2024
·
2 revisions
This class allows you to create a new Wezterm configuration object.
-- this repo wezterm.lua
local Config = require("utils.class.config"):new()
require "events.update-status"
require "events.format-tab-title"
require "events.new-tab-button-click"
require "events.augment-command-palette"
return Config:add("config"):add "mappings"
Creates a new class instance. If
wezterm.config_builder()
is available it will use it and then enable strict mode to promote warning messages to error ones.
-
instance
[Utils.Class.Config
] - newly created class instance.
local Config = require("utils.class.config")
local config = Config:new()
Extends the class instance with the given table. You can provide either a string
(Lua require()
path) or a table.
-
spec
[string
|table
] - Luarequire()
path to a table or a table.
Returns:
-
self
[Utils.Class.Config
] - updated class instance with the new options.
Example:
local Config = require("utils.class.config")
local config = Config:new()
config:add("module.name") -- Adds configuration from a module
config:add({
font_size = 14,
color_scheme = "Dracula"
}) -- Adds configuration directly from a table
This module is licensed under the GNU General Public License v3.0. For more information, refer to the license.