first commit

This commit is contained in:
taynpg 2025-04-06 20:44:32 +08:00
commit 6eabb9a12c
6 changed files with 112 additions and 0 deletions

5
.vscode/settings.json vendored Normal file
View File

@ -0,0 +1,5 @@
{
"editor.fontFamily": "'Operator Mono SSm Lig', 'Operator Mono SSm Lig', 'Operator Mono SSm Lig'",
"editor.fontLigatures": true,
"editor.fontWeight": "400",
}

3
README.md Normal file
View File

@ -0,0 +1,3 @@
# 说明
wezterm 配置。

19
keybind.lua Normal file
View File

@ -0,0 +1,19 @@
local keybind = {}
local wezterm = require("wezterm")
function keybind.setKey(config)
config.keys = {
{
key = 'F11',
mods = 'CTRL',
action = wezterm.action.ToggleFullScreen,
},
{
key = 'F10',
mods = 'CTRL',
action = wezterm.action.Hide,
},
}
end
return keybind

12
platform.lua Normal file
View File

@ -0,0 +1,12 @@
local platform = {}
local wezterm = require("wezterm")
function platform.getFontSize()
if wezterm.target_triple == "aarch64-apple-darwin" then
return 15
else
return 12
end
end
return platform

39
vsvar.lua Normal file
View File

@ -0,0 +1,39 @@
local vsvar = {}
local function exists(mpath)
local file = io.open(mpath, "r")
if file then
io.close(file)
return true
else
return false
end
end
function vsvar.get(config)
local vs2015_x64 = "C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/bin/amd64/vcvars64.bat"
if exists(vs2015_x64) then
table.insert(config, {
label = "vs2015_x64",
args = {
"cmd.exe",
"/k",
vs2015_x64,
},
})
end
local vs2022_x64 = "C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Auxiliary/Build/vcvars64.bat"
if exists(vs2022_x64) then
table.insert(config, {
label = "vs2022_x64",
args = {
"cmd.exe",
"/k",
vs2022_x64,
},
})
end
end
return vsvar

34
wezterm.lua Normal file
View File

@ -0,0 +1,34 @@
local wezterm = require("wezterm")
local vsvar = require("vsvar")
local platform = require("platform")
local keybind = require("keybind")
local config = {
audible_bell = "Disabled",
check_for_updates = false,
color_scheme = "Ubuntu",
inactive_pane_hsb = {
hue = 1.0,
saturation = 1.0,
brightness = 1.0,
},
window_decorations = "RESIZE",
}
config.font_size = platform.getFontSize()
config.launch_menu = {}
config.initial_rows = 30
config.initial_cols = 130
config.font = wezterm.font 'SauceCodePro NFM'
keybind.setKey(config)
if wezterm.target_triple == "x86_64-pc-windows-msvc" then
table.insert(config.launch_menu, {
label = "PowerShell",
args = { "powershell.exe", "-NoLogo" },
})
vsvar.get(config.launch_menu)
end
return config