style: tidy up configuration and remove unnecessary comments

This commit is contained in:
2024-10-21 05:48:19 -04:00
parent b22d371263
commit 7ea66629e9
6 changed files with 74 additions and 4 deletions
+1 -1
View File
@@ -31,7 +31,7 @@ local opts = {
audible_bell = "SystemBeep",
-- Terminal Variable
term = "wezterm",
-- term = "wezterm",
--Honor kitty protocol inputs
enable_kitty_keyboard = true,
+11 -2
View File
@@ -7,13 +7,22 @@ local M = {}
local wezterm = WEZTERM
local types = require("types")
-- Set the leader icon
wezterm.on("update-status", function(window, _)
-- Update status event
wezterm.on("update-status", function(window, pane)
-- Set the leader icon
if window:leader_is_active() then
types.leader.icon = types.leader.on
else
types.leader.icon = types.leader.off
end
-- Set the TERM
local tty = pane:get_tty_name()
if tty then
CONFIG.term = "wezterm"
else
CONFIG.term = "xterm-256color"
end
end)
---@function Function to render the leader icon
+45
View File
@@ -0,0 +1,45 @@
-- ╭─────────────────────────────────────────────────────────╮
-- │ Menus │
-- ╰─────────────────────────────────────────────────────────╯
local wezterm = WEZTERM
local launch_menu = {}
if wezterm.target_triple == "x86_64-pc-windows-msvc" then
table.insert(launch_menu, {
label = "PowerShell",
args = { "powershell.exe", "-NoLogo" },
})
-- Find installed visual studio version(s) and add their compilation
-- environment command prompts to the menu
for _, vsvers in ipairs(wezterm.glob("Microsoft Visual Studio/20*", "C:/Program Files (x86)")) do
local year = vsvers:gsub("Microsoft Visual Studio/", "")
table.insert(launch_menu, {
label = "x64 Native Tools VS " .. year,
args = {
"cmd.exe",
"/k",
"C:/Program Files (x86)/" .. vsvers .. "/BuildTools/VC/Auxiliary/Build/vcvars64.bat",
},
})
end
end
-- Set up btop launcher
if wezterm.target_triple ~= "x86_64-pc-windows-msvc" then
table.insert(launch_menu, {
label = "btop",
args = { "btop" },
})
end
-- Set up btop launcher split using wezterm cli
if wezterm.target_triple ~= "x86_64-pc-windows-msvc" then
table.insert(launch_menu, {
label = "btop split",
args = { "wezterm", "cli", "split-pane", "--", "btop" },
})
end
return launch_menu
+11
View File
@@ -0,0 +1,11 @@
-- ╭─────────────────────────────────────────────────────────╮
-- │ Sessionizer │
-- ╰─────────────────────────────────────────────────────────╯
local wezterm = WEZTERM
local config = CONFIG
SESSIONIZER = wezterm.plugin.require("https://github.com/mikkasendke/sessionizer.wezterm")
if SESSIONIZER then
SESSIONIZER.apply_to_config(config)
end
+1
View File
@@ -9,6 +9,7 @@ local plugins = {
"resurrect",
"smart_splits",
"tabline",
-- "sessionizer",
--"plugin_mgr",
}
+5 -1
View File
@@ -11,7 +11,7 @@
-- https://github.com/wez/wezterm/
-- Load WezTerm module
WEZTERM = require("wezterm")
WEZTERM = require("wezterm") --[[@as Wezterm]]
-- Load Config Builder
CONFIG = WEZTERM.config_builder()
@@ -35,10 +35,14 @@ require("plugs")
-- Encrypt Sessions
require("encryption")
-- Load Menus
CONFIG.launch_menu = require("menus")
--------- Update Plugins ----------
---Running this may cause slowdowns
-----------------------------------
-- WEZTERM.plugin.update_all() ----
-- print(WEZTERM.plugin.list())
-----------------------------------
-- Return configuration