parent
750dcc0edd
commit
4ee8ff327f
|
@ -1,14 +1,5 @@
|
||||||
local wezterm = require "wezterm"
|
local wezterm = require "wezterm"
|
||||||
|
|
||||||
-- Choose theme based on system
|
|
||||||
function theme_for_appearance(appearance)
|
|
||||||
if appearance:find "Dark" then
|
|
||||||
return "Catppuccin Mocha"
|
|
||||||
else
|
|
||||||
return "Catppuccin Latte"
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
-- Update right status with "mode"
|
-- Update right status with "mode"
|
||||||
wezterm.on('update-right-status', function(window, pane)
|
wezterm.on('update-right-status', function(window, pane)
|
||||||
local name = window:active_key_table()
|
local name = window:active_key_table()
|
||||||
|
@ -32,26 +23,25 @@ wezterm.on('toggle-opacity', function(window, pane)
|
||||||
end)
|
end)
|
||||||
|
|
||||||
-- config
|
-- config
|
||||||
return {
|
local cfg = wezterm.config_builder()
|
||||||
default_prog = { "nu", "--config", "~/.config/nushell/config.nu", "--env-config", "~/.config/nushell/env.nu" },
|
cfg.default_prog = { "nu", "--config", "~/.config/nushell/config.nu", "--env-config", "~/.config/nushell/env.nu" }
|
||||||
color_scheme = theme_for_appearance(wezterm.gui.get_appearance()),
|
cfg.window_close_confirmation = 'NeverPrompt'
|
||||||
window_close_confirmation = 'NeverPrompt',
|
cfg.window_background_opacity = opacity
|
||||||
window_background_opacity = opacity,
|
cfg.window_decorations = "RESIZE"
|
||||||
window_decorations = "RESIZE",
|
cfg.leader = {
|
||||||
leader = {
|
|
||||||
key = "Space",
|
key = "Space",
|
||||||
mods = "CTRL",
|
mods = "CTRL",
|
||||||
timeout_milliseconds = math.maxinteger,
|
timeout_milliseconds = math.maxinteger,
|
||||||
},
|
}
|
||||||
keys = {
|
cfg.keys = {
|
||||||
{ key = "p", mods = "LEADER", action = wezterm.action.ActivateKeyTable({ name = "pane_mode", one_shot = false }) },
|
{ key = "p", mods = "LEADER", action = wezterm.action.ActivateKeyTable({ name = "pane_mode", one_shot = false }) },
|
||||||
{ key = "h", mods = "SHIFT|CTRL|ALT", action = wezterm.action.SplitHorizontal({ domain = "CurrentPaneDomain" }) },
|
{ key = "h", mods = "SHIFT|CTRL|ALT", action = wezterm.action.SplitHorizontal({ domain = "CurrentPaneDomain" }) },
|
||||||
{ key = "v", mods = "SHIFT|CTRL|ALT", action = wezterm.action.SplitVertical({ domain = "CurrentPaneDomain" }) },
|
{ key = "v", mods = "SHIFT|CTRL|ALT", action = wezterm.action.SplitVertical({ domain = "CurrentPaneDomain" }) },
|
||||||
{ key = "c", mods = "SHIFT|CTRL|ALT", action = wezterm.action.CloseCurrentPane({ confirm = false }) },
|
{ key = "c", mods = "SHIFT|CTRL|ALT", action = wezterm.action.CloseCurrentPane({ confirm = false }) },
|
||||||
{ key = "s", mods = "SHIFT|CTRL|ALT", action = wezterm.action.PaneSelect({ alphabet = "1234567890", mode = "SwapWithActive" }) },
|
{ key = "s", mods = "SHIFT|CTRL|ALT", action = wezterm.action.PaneSelect({ alphabet = "1234567890", mode = "SwapWithActive" }) },
|
||||||
|
|
||||||
{ key = "o", mods = "SHIFT|CTRL|ALT", action = wezterm.action.EmitEvent("toggle-opacity") },
|
{ key = "o", mods = "SHIFT|CTRL|ALT", action = wezterm.action.EmitEvent("toggle-opacity") },
|
||||||
|
{ key = "LeftArrow", mods = "SHIFT|CTRL", action = wezterm.action.ActivateTabRelative(-1) },
|
||||||
|
{ key = "RightArrow", mods = "SHIFT|CTRL", action = wezterm.action.ActivateTabRelative(1) },
|
||||||
{ key = "1", mods = "LEADER", action = wezterm.action.ActivateTab(0) },
|
{ key = "1", mods = "LEADER", action = wezterm.action.ActivateTab(0) },
|
||||||
{ key = "2", mods = "LEADER", action = wezterm.action.ActivateTab(1) },
|
{ key = "2", mods = "LEADER", action = wezterm.action.ActivateTab(1) },
|
||||||
{ key = "3", mods = "LEADER", action = wezterm.action.ActivateTab(2) },
|
{ key = "3", mods = "LEADER", action = wezterm.action.ActivateTab(2) },
|
||||||
|
@ -62,8 +52,8 @@ return {
|
||||||
{ key = "8", mods = "LEADER", action = wezterm.action.ActivateTab(7) },
|
{ key = "8", mods = "LEADER", action = wezterm.action.ActivateTab(7) },
|
||||||
{ key = "9", mods = "LEADER", action = wezterm.action.ActivateTab(8) },
|
{ key = "9", mods = "LEADER", action = wezterm.action.ActivateTab(8) },
|
||||||
{ key = "0", mods = "LEADER", action = wezterm.action.ActivateTab(-1) },
|
{ key = "0", mods = "LEADER", action = wezterm.action.ActivateTab(-1) },
|
||||||
},
|
}
|
||||||
key_tables = {
|
cfg.key_tables = {
|
||||||
pane_mode = {
|
pane_mode = {
|
||||||
{ key = "h", action = wezterm.action.SplitHorizontal({ domain = "CurrentPaneDomain" }) },
|
{ key = "h", action = wezterm.action.SplitHorizontal({ domain = "CurrentPaneDomain" }) },
|
||||||
{ key = "v", action = wezterm.action.SplitVertical({ domain = "CurrentPaneDomain" }) },
|
{ key = "v", action = wezterm.action.SplitVertical({ domain = "CurrentPaneDomain" }) },
|
||||||
|
@ -80,7 +70,21 @@ return {
|
||||||
{ key = "DownArrow", mods = "SHIFT", action = wezterm.action.AdjustPaneSize({ "Down", 1 }) },
|
{ key = "DownArrow", mods = "SHIFT", action = wezterm.action.AdjustPaneSize({ "Down", 1 }) },
|
||||||
{ key = "Escape", action = "PopKeyTable" },
|
{ key = "Escape", action = "PopKeyTable" },
|
||||||
},
|
},
|
||||||
},
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
-- Plugins
|
||||||
|
wezterm.plugin.require("https://github.com/catppuccin/wezterm").apply_to_config(cfg, {
|
||||||
|
sync = true,
|
||||||
|
sync_flavors = {
|
||||||
|
light = "latte",
|
||||||
|
dark = "mocha",
|
||||||
|
}
|
||||||
|
})
|
||||||
|
wezterm.plugin.require("https://github.com/nekowinston/wezterm-bar").apply_to_config(cfg, {
|
||||||
|
clock = {
|
||||||
|
enabled = false,
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
return cfg
|
||||||
|
|
||||||
|
|
Reference in New Issue