dotfiles.nix/config/wezterm/wezterm.lua

93 lines
3 KiB
Lua
Raw Normal View History

2023-04-05 23:20:07 +08:00
-- Pull in the wezterm API
local wezterm = require 'wezterm'
local act = wezterm.action
-- This table will hold the configuration.
local config = {}
-- In newer versions of wezterm, use the config_builder which will
-- help provide clearer error messages
if wezterm.config_builder then
config = wezterm.config_builder()
end
2023-04-18 02:20:50 +08:00
-- Do not check for or show window with update information
config.check_for_updates = false
config.show_update_window = false
-- Set our default shell to hilbish
config.default_prog = { 'hilbish' }
2023-04-05 23:20:07 +08:00
-- Font
2023-04-09 23:05:07 +08:00
config.font = wezterm.font 'Fira Code'
2023-04-05 23:20:07 +08:00
config.font_size = 10.0
-- Color scheme
config.color_scheme = 'gruvbox_material_dark_hard'
2023-04-18 02:20:50 +08:00
-- Padding
config.window_padding = {
left = 20,
right = 20,
top = 20,
bottom = 0,
}
2023-04-05 23:20:07 +08:00
-- Tab bar appearance
2023-04-18 02:20:50 +08:00
config.use_fancy_tab_bar = false
config.enable_tab_bar = true
2023-04-05 23:20:07 +08:00
config.hide_tab_bar_if_only_one_tab = false
2023-04-18 02:20:50 +08:00
config.tab_bar_at_bottom = true
config.tab_max_width = 24
2023-04-05 23:20:07 +08:00
-- Colors
config.colors = {
tab_bar = {
background = '#1d2021',
2023-04-20 00:48:38 +08:00
-- style tabs
active_tab = { bg_color = '#1d2021', fg_color = '#d4be98', intensity = 'Normal', italic = false, },
inactive_tab = { bg_color = '#1d2021', fg_color = '#7c6f64', intensity = 'Half', italic = false, },
inactive_tab_hover = { bg_color = '#1d2021', fg_color = '#7c6f64', intensity = 'Half', italic = false, },
new_tab = { bg_color = '#1d2021', fg_color = '#7c6f64', intensity = 'Half', italic = false, },
new_tab_hover = { bg_color = '#1d2021', fg_color = '#7c6f64', intensity = 'Half', italic = false, },
2023-04-05 23:20:07 +08:00
}
}
-- Key Assignments
config.disable_default_key_bindings = true
2023-04-20 00:48:38 +08:00
config.keys = {}
2023-04-18 02:20:50 +08:00
2023-04-20 00:48:38 +08:00
for i = 1, 8 do
-- CTRL+ALT + number to activate that tab
2023-04-05 23:20:07 +08:00
table.insert(config.keys, {
key = tostring(i),
2023-04-20 00:48:38 +08:00
mods = 'CTRL|ALT',
2023-04-05 23:20:07 +08:00
action = act.ActivateTab(i - 1),
})
end
2023-04-20 00:48:38 +08:00
config.keys = {
-- Tabs
{ key = 't', mods = 'ALT', action = act.SpawnTab 'CurrentPaneDomain', },
{ key = 'w', mods = "ALT|CTRL", action = act.CloseCurrentTab { confirm = false }, },
-- Panes
{ key = 'v', mods = 'ALT', action = act.SplitVertical { domain = 'CurrentPaneDomain' }, },
{ key = 'h', mods = 'ALT', action = act.SplitHorizontal { domain = 'CurrentPaneDomain' }, },
{ key = 'x', mods = "ALT", action = act.CloseCurrentPane { confirm = false }, },
-- Navigation
{ key = 'LeftArrow', mods = 'ALT', action = act.ActivateTabRelative(-1) },
{ key = 'RightArrow', mods = 'ALT', action = act.ActivateTabRelative(1) },
{ key = 'DownArrow', mods = 'ALT', action = act.ActivatePaneDirection 'Next', },
{ key = 'UpArrow', mods = 'ALT', action = act.ActivatePaneDirection 'Prev', },
-- Copy Mode / Clipboard
{ key = 'X', mods = 'CTRL', action = act.ActivateCopyMode, },
{ key = 'C', mods = 'CTRL', action = act.CopyTo 'ClipboardAndPrimarySelection', },
{ key = 'V', mods = 'CTRL', action = act.PasteFrom 'Clipboard', },
}
2023-04-05 23:20:07 +08:00
return config