commit 6eabb9a12c4cde246ed63afe4dd81de9b0e04684 Author: taynpg Date: Sun Apr 6 20:44:32 2025 +0800 first commit diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..a2b008b --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,5 @@ +{ + "editor.fontFamily": "'Operator Mono SSm Lig', 'Operator Mono SSm Lig', 'Operator Mono SSm Lig'", + "editor.fontLigatures": true, + "editor.fontWeight": "400", +} \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..d8c84dd --- /dev/null +++ b/README.md @@ -0,0 +1,3 @@ +# 说明 + +wezterm 配置。 \ No newline at end of file diff --git a/keybind.lua b/keybind.lua new file mode 100644 index 0000000..1ce0a95 --- /dev/null +++ b/keybind.lua @@ -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 diff --git a/platform.lua b/platform.lua new file mode 100644 index 0000000..91cdee0 --- /dev/null +++ b/platform.lua @@ -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 diff --git a/vsvar.lua b/vsvar.lua new file mode 100644 index 0000000..2948434 --- /dev/null +++ b/vsvar.lua @@ -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 diff --git a/wezterm.lua b/wezterm.lua new file mode 100644 index 0000000..7f2fa0e --- /dev/null +++ b/wezterm.lua @@ -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