init repo

This commit is contained in:
System administrator 2024-12-25 10:59:37 +08:00
commit 9a525dadfc
39 changed files with 2709 additions and 0 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.9 MiB

View file

@ -0,0 +1,33 @@
local wezterm = require("wezterm")
---@class Config
---@filed options table
local Config = {}
---Init Config
---@return Config
function Config:init()
local o = {}
self = setmetatable(o, { __index = Config })
self.options = {}
return o
end
---Append to `Config.options`
---@param new_options table new options to append
---@return Config
function Config:append(new_options)
for key, val in pairs(new_options) do
if self.options[key] ~= nil then
wezterm.log_warn("Duplicate config option detected: ", {
old = self.options[key],
new = new_options[key],
})
else
self.options[key] = val
end
end
return self
end
return Config

View file

@ -0,0 +1,7 @@
return {
---Check whether the current os is windows
---@return boolean whether the current os is windows
is_windows = function()
return require("wezterm").target_triple:find("windows") ~= nil
end,
}

View file

@ -0,0 +1,22 @@
return {
family = [[FiraCode Nerd Font]],
assume_emoji_presentation = false,
style = [[Normal]],
harfbuzz_features = {
"calt=1",
"clig=1",
"liga=1",
"cv01",
"cv02",
"cv06",
"zero",
"onum",
"cv17",
"ss05",
"ss03",
"cv16",
"cv31",
"cv29",
"cv30",
},
}

View file

@ -0,0 +1,4 @@
return {
family = [[Noto Color Emiji]],
assume_emoji_presentation = true,
}

View file

@ -0,0 +1,4 @@
return {
family = [[Noto Sans CJK SC]],
assume_emoji_presentation = false,
}

View file

@ -0,0 +1,4 @@
return {
family = [[Segoe UI Emoji]],
assume_emoji_presentation = true,
}

View file

@ -0,0 +1,5 @@
return {
family = [[VictorMono Nerd Font]],
assume_emoji_presentation = false,
style = "Italic",
}

View file

@ -0,0 +1,17 @@
local wezterm = require("wezterm")
local M = {
-- front_end = 'WebGpu',
webgpu_power_preference = "HighPerformance",
}
for _, gpu in ipairs(wezterm.gui.enumerate_gpus()) do
if gpu.backend == "Vulkan" and gpu.device_type == "DiscreteGpu" then
M.webgpu_preferred_adapter = gpu
break
elseif gpu.backend == "Vulkan" and M.webgpu_preferred_adapter == nil then
M.webgpu_preferred_adapter = gpu
end
end
return M

View file

@ -0,0 +1,28 @@
local wezterm = require("wezterm")
return {
automatically_reload_config = true,
cell_width = 1.0,
audible_bell = "Disabled",
tab_bar_at_bottom = true,
use_fancy_tab_bar = false,
hide_tab_bar_if_only_one_tab = true,
window_decorations = "RESIZE|TITLE",
underline_thickness = 3.0,
enable_scroll_bar = true,
color_scheme = "MaterialOcean",
window_background_image = wezterm.config_dir .. [[/background/background.png]],
window_background_image_hsb = {
brightness = 0.02,
hue = 1.0,
saturation = 1.0,
},
window_padding = {
left = "0.5cell",
right = 0,
top = "0cell",
bottom = "0cell",
},
window_background_opacity = 0.9,
text_background_opacity = 0.6,
}

View file

@ -0,0 +1,5 @@
if require("fn").is_windows() then
return require("options.os.windows")
else
return require("options.os.other_os")
end

View file

@ -0,0 +1,30 @@
local wezterm = require("wezterm")
local fonts = {
require("fonts.firacode_nerd_font"),
require("fonts.noto_sans_cjk_sc"),
require("fonts.noto_color_emoji"),
}
return {
term = "wezterm",
font_size = 14.0,
animation_fps = 1,
max_fps = 1,
font = wezterm.font_with_fallback(fonts),
font_rules = {
{
italic = true,
font = wezterm.font_with_fallback({
require("fonts.victor_mono_nerd_font"),
}),
},
{
italic = false,
font = wezterm.font_with_fallback({
require("fonts.firacode_nerd_font"),
require("fonts.noto_sans_cjk_sc"),
}),
},
},
}

View file

@ -0,0 +1,31 @@
local wezterm = require("wezterm")
local fonts = {
require("fonts.firacode_nerd_font"),
require("fonts.segoe_ui_emoji"),
}
return {
font_size = 16.0,
animation_fps = 144,
max_fps = 144,
default_prog = {
[[pwsh]],
},
font = wezterm.font_with_fallback(fonts),
font_rules = {
{
italic = true,
font = wezterm.font_with_fallback({
require("fonts.victor_mono_nerd_font"),
}),
},
{
italic = false,
font = wezterm.font_with_fallback({
require("fonts.firacode_nerd_font"),
require("fonts.noto_sans_cjk_sc"),
}),
},
},
}

View file

@ -0,0 +1,6 @@
indent_type = "Spaces"
indent_width = 2
column_width = 120
[sort_requires]
enabled = true

View file

@ -0,0 +1,5 @@
return require("config")
:init()
:append(require("options.base"))
:append(require("options.backend"))
:append(require("options.os")).options