feat: yazi, clean wezterm

This commit is contained in:
2025-04-12 15:38:25 +02:00
parent ab69b02641
commit 72e7700efb
30 changed files with 4361 additions and 28 deletions

View File

@ -55,11 +55,47 @@ return {
action = act.SplitHorizontal({ domain = "CurrentPaneDomain" }),
},
-- session manager
{ key = "s", mods = "LEADER", action = act({ EmitEvent = "save_session" }) },
{ key = "l", mods = "LEADER", action = act({ EmitEvent = "load_session" }) },
{ key = "r", mods = "LEADER", action = act({ EmitEvent = "restore_session" }) },
-- Rename current workspace
{
key = "$",
mods = "LEADER|SHIFT",
action = act.PromptInputLine({
description = "Enter new workspace name",
action = wezterm.action_callback(function(window, pane, line)
if line then
wezterm.mux.rename_workspace(wezterm.mux.get_active_workspace(), line)
end
end),
}),
},
-- Prompt for a name to use for a new workspace and switch to it.
{
key = "w",
mods = "LEADER|SHIFT",
action = act.PromptInputLine({
description = wezterm.format({
{ Attribute = { Intensity = "Bold" } },
{ Foreground = { AnsiColor = "Fuchsia" } },
{ Text = "Enter name for new workspace" },
}),
action = wezterm.action_callback(function(window, pane, line)
-- line will be `nil` if they hit escape without entering anything
-- An empty string if they just hit enter
-- Or the actual line of text they wrote
if line then
window:perform_action(
act.SwitchToWorkspace({
name = line,
}),
pane
)
end
end),
}),
},
},
key_tables = {
resize_pane = {
{ key = "LeftArrow", action = act.AdjustPaneSize({ "Left", 5 }) },

View File

@ -1,27 +1,8 @@
local wezterm = require("wezterm")
local mappings = require("modules.mappings")
local session_manager = require("wezterm-session-manager/session-manager")
local hyperlinks = require("modules.hyperlinks")
-- Show which key table is active in the status area
wezterm.on("update-right-status", function(window, pane)
local name = window:active_key_table()
if name then
name = "TABLE: " .. name
end
window:set_right_status(name or "")
end)
wezterm.on("save_session", function(window)
session_manager.save_state(window)
end)
wezterm.on("load_session", function(window)
session_manager.load_state(window)
end)
wezterm.on("restore_session", function(window)
session_manager.restore_state(window)
end)
return {
local config = {
default_cursor_style = "BlinkingBlock",
color_scheme = "Catppuccin Mocha",
colors = {
@ -31,7 +12,7 @@ return {
},
-- font
font = wezterm.font("JetBrains Mono", { weight = "Medium" }),
font_size = 10,
font_size = 12,
line_height = 1.0,
window_background_opacity = 0.8,
-- tab bar
@ -46,8 +27,9 @@ return {
bottom = 7,
},
window_decorations = "RESIZE",
window_close_confirmation = "NeverPrompt",
inactive_pane_hsb = {
brightness = 0.7,
brightness = 0.5,
},
send_composed_key_when_left_alt_is_pressed = false,
send_composed_key_when_right_alt_is_pressed = true,
@ -55,4 +37,18 @@ return {
leader = mappings.leader,
keys = mappings.keys,
key_tables = mappings.key_tables,
hyperlink_rules = hyperlinks,
}
-- sessions.apply_to_config(config) -- optional, this adds default keybindings
-- Show which key table is active in the status area
wezterm.on("update-right-status", function(window, pane)
local name = window:active_key_table()
if name then
name = "TABLE: " .. name
end
window:set_right_status(name or "")
end)
return config