style: tidy up configuration and remove unnecessary comments
This commit is contained in:
+1
-1
@@ -31,7 +31,7 @@ local opts = {
|
|||||||
audible_bell = "SystemBeep",
|
audible_bell = "SystemBeep",
|
||||||
|
|
||||||
-- Terminal Variable
|
-- Terminal Variable
|
||||||
term = "wezterm",
|
-- term = "wezterm",
|
||||||
|
|
||||||
--Honor kitty protocol inputs
|
--Honor kitty protocol inputs
|
||||||
enable_kitty_keyboard = true,
|
enable_kitty_keyboard = true,
|
||||||
|
|||||||
@@ -7,13 +7,22 @@ local M = {}
|
|||||||
local wezterm = WEZTERM
|
local wezterm = WEZTERM
|
||||||
local types = require("types")
|
local types = require("types")
|
||||||
|
|
||||||
-- Set the leader icon
|
-- Update status event
|
||||||
wezterm.on("update-status", function(window, _)
|
wezterm.on("update-status", function(window, pane)
|
||||||
|
-- Set the leader icon
|
||||||
if window:leader_is_active() then
|
if window:leader_is_active() then
|
||||||
types.leader.icon = types.leader.on
|
types.leader.icon = types.leader.on
|
||||||
else
|
else
|
||||||
types.leader.icon = types.leader.off
|
types.leader.icon = types.leader.off
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- Set the TERM
|
||||||
|
local tty = pane:get_tty_name()
|
||||||
|
if tty then
|
||||||
|
CONFIG.term = "wezterm"
|
||||||
|
else
|
||||||
|
CONFIG.term = "xterm-256color"
|
||||||
|
end
|
||||||
end)
|
end)
|
||||||
|
|
||||||
---@function Function to render the leader icon
|
---@function Function to render the leader icon
|
||||||
|
|||||||
@@ -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
|
||||||
@@ -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
|
||||||
@@ -9,6 +9,7 @@ local plugins = {
|
|||||||
"resurrect",
|
"resurrect",
|
||||||
"smart_splits",
|
"smart_splits",
|
||||||
"tabline",
|
"tabline",
|
||||||
|
-- "sessionizer",
|
||||||
--"plugin_mgr",
|
--"plugin_mgr",
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+5
-1
@@ -11,7 +11,7 @@
|
|||||||
-- https://github.com/wez/wezterm/
|
-- https://github.com/wez/wezterm/
|
||||||
|
|
||||||
-- Load WezTerm module
|
-- Load WezTerm module
|
||||||
WEZTERM = require("wezterm")
|
WEZTERM = require("wezterm") --[[@as Wezterm]]
|
||||||
-- Load Config Builder
|
-- Load Config Builder
|
||||||
CONFIG = WEZTERM.config_builder()
|
CONFIG = WEZTERM.config_builder()
|
||||||
|
|
||||||
@@ -35,10 +35,14 @@ require("plugs")
|
|||||||
-- Encrypt Sessions
|
-- Encrypt Sessions
|
||||||
require("encryption")
|
require("encryption")
|
||||||
|
|
||||||
|
-- Load Menus
|
||||||
|
CONFIG.launch_menu = require("menus")
|
||||||
|
|
||||||
--------- Update Plugins ----------
|
--------- Update Plugins ----------
|
||||||
---Running this may cause slowdowns
|
---Running this may cause slowdowns
|
||||||
-----------------------------------
|
-----------------------------------
|
||||||
-- WEZTERM.plugin.update_all() ----
|
-- WEZTERM.plugin.update_all() ----
|
||||||
|
-- print(WEZTERM.plugin.list())
|
||||||
-----------------------------------
|
-----------------------------------
|
||||||
|
|
||||||
-- Return configuration
|
-- Return configuration
|
||||||
|
|||||||
Reference in New Issue
Block a user