switch to chezmoi
This commit is contained in:
parent
3c5d00dbf3
commit
a8b0acd4db
76 changed files with 27 additions and 531 deletions
15
dot_config/wezterm/functions.lua
Normal file
15
dot_config/wezterm/functions.lua
Normal file
|
@ -0,0 +1,15 @@
|
|||
local function get_os()
|
||||
local current_os = os.getenv('OS')
|
||||
if current_os then return current_os end
|
||||
return io.popen('uname -s', 'r'):read()
|
||||
end
|
||||
|
||||
local function set_by_os(values)
|
||||
local my_os = get_os()
|
||||
if values[my_os] then return values[my_os] end
|
||||
return values.others
|
||||
end
|
||||
|
||||
return {
|
||||
set_by_os = set_by_os
|
||||
}
|
39
dot_config/wezterm/keybinds.lua
Normal file
39
dot_config/wezterm/keybinds.lua
Normal file
|
@ -0,0 +1,39 @@
|
|||
local act = require('wezterm').action
|
||||
|
||||
local leader_key = { key = 'g', mods = 'CTRL', timeout_milliseconds = 1000 }
|
||||
local keybinds = {
|
||||
{ key = 'c', mods = 'META', action = act.CopyTo('Clipboard') },
|
||||
{ key = 'v', mods = 'META', action = act.PasteFrom('Clipboard') },
|
||||
-- overrides
|
||||
{ key = 'y', mods = 'LEADER', action = act.EmitEvent('override-fonts') },
|
||||
{ key = 't', mods = 'LEADER', action = act.EmitEvent('override-theme') },
|
||||
{ key = 'r', mods = 'LEADER', action = act.EmitEvent('override-reset') },
|
||||
-- misc
|
||||
{ key = 'f', mods = 'LEADER', action = act.ToggleFullScreen },
|
||||
-- tabs
|
||||
{ key = 'c', mods = 'LEADER', action = act.SpawnTab('DefaultDomain') },
|
||||
{ key = 'n', mods = 'LEADER', action = act.ActivateTabRelative( 1) },
|
||||
{ key = 'p', mods = 'LEADER', action = act.ActivateTabRelative(-1) },
|
||||
-- panes
|
||||
{ key = 's', mods = 'LEADER', action = act.SplitVertical { domain = 'CurrentPaneDomain' } },
|
||||
{ key = 'v', mods = 'LEADER', action = act.SplitHorizontal { domain = 'CurrentPaneDomain' } },
|
||||
{ key = 'h', mods = 'LEADER', action = act.ActivatePaneDirection('Left') },
|
||||
{ key = 'j', mods = 'LEADER', action = act.ActivatePaneDirection('Down') },
|
||||
{ key = 'k', mods = 'LEADER', action = act.ActivatePaneDirection('Up') },
|
||||
{ key = 'l', mods = 'LEADER', action = act.ActivatePaneDirection('Right') },
|
||||
{ key = 'u', mods = 'LEADER', action = act.RotatePanes('Clockwise') },
|
||||
{ key = 'i', mods = 'LEADER', action = act.RotatePanes('CounterClockwise') },
|
||||
{ key = 'Return', mods = 'LEADER', action = act.TogglePaneZoomState },
|
||||
{ key = 'Space', mods = 'LEADER', action = act.PaneSelect },
|
||||
}
|
||||
for i = 1, 9 do
|
||||
table.insert(
|
||||
keybinds,
|
||||
{ key = tostring(i), mods = 'LEADER', action = act.ActivateTab(i - 1) }
|
||||
)
|
||||
end
|
||||
|
||||
return {
|
||||
leader = leader_key,
|
||||
keybinds = keybinds
|
||||
}
|
65
dot_config/wezterm/overrides.lua
Normal file
65
dot_config/wezterm/overrides.lua
Normal file
|
@ -0,0 +1,65 @@
|
|||
local wt = require('wezterm')
|
||||
|
||||
local current = {}
|
||||
|
||||
-- colors
|
||||
local color_scheme = 'Solarized Light (Gogh)'
|
||||
local tab_fg = '#657b83'
|
||||
local tab_bg = '#eee8d5'
|
||||
local tab_bg_active = '#fdf6e3'
|
||||
local cursor_fg = '#fdf6e3'
|
||||
local cursor_bg = '#cb4b16'
|
||||
|
||||
-- fonts
|
||||
local fonts = wt.config_builder()
|
||||
fonts.font = wt.font('IBM Plex Mono')
|
||||
fonts.harfbuzz_features = {'ss03'}
|
||||
|
||||
-- theme
|
||||
local theme = wt.config_builder()
|
||||
theme.color_scheme = color_scheme
|
||||
theme.colors = {
|
||||
cursor_fg = cursor_fg,
|
||||
cursor_bg = cursor_bg,
|
||||
tab_bar = {
|
||||
background = tab_bg,
|
||||
active_tab = {
|
||||
fg_color = tab_fg,
|
||||
bg_color = tab_bg_active
|
||||
},
|
||||
inactive_tab = {
|
||||
fg_color = tab_fg,
|
||||
bg_color = tab_bg
|
||||
}
|
||||
}
|
||||
}
|
||||
theme.colors.tab_bar.inactive_tab_hover = theme.colors.tab_bar.inactive_tab
|
||||
theme.window_frame = {
|
||||
active_titlebar_bg = tab_bg,
|
||||
inactive_titlebar_bg = tab_bg
|
||||
}
|
||||
|
||||
local overrides = {
|
||||
fonts = fonts,
|
||||
theme = theme
|
||||
}
|
||||
|
||||
local function toggle_overrides(window, conf)
|
||||
for k, v in pairs(conf) do
|
||||
if current[k] == v then
|
||||
current[k] = nil
|
||||
else
|
||||
current[k] = v
|
||||
end
|
||||
end
|
||||
window:set_config_overrides(current)
|
||||
end
|
||||
|
||||
local function reset_overrides(window)
|
||||
window:set_config_overrides()
|
||||
current = {}
|
||||
end
|
||||
|
||||
wt.on('override-theme', function(window) toggle_overrides(window, overrides.theme) end)
|
||||
wt.on('override-fonts', function(window) toggle_overrides(window, overrides.fonts) end)
|
||||
wt.on('override-reset', reset_overrides)
|
72
dot_config/wezterm/wezterm.lua
Normal file
72
dot_config/wezterm/wezterm.lua
Normal file
|
@ -0,0 +1,72 @@
|
|||
local wt = require('wezterm')
|
||||
local kb = require('keybinds')
|
||||
local fn = require('functions')
|
||||
|
||||
-- colors
|
||||
local color_scheme = 'GruvboxDark'
|
||||
local tab_fg = '#ebdbb2'
|
||||
local tab_bg = '#504945'
|
||||
local tab_bg_active = '#282828'
|
||||
local cursor_fg = '#ebdbb2'
|
||||
local cursor_bg = '#d65d0e'
|
||||
|
||||
-- misc
|
||||
local cfg = wt.config_builder()
|
||||
cfg.leader = kb.leader
|
||||
cfg.keys = kb.keybinds
|
||||
cfg.audible_bell = 'Disabled'
|
||||
cfg.check_for_updates = false
|
||||
|
||||
-- fonts & text
|
||||
cfg.cursor_blink_rate = 0
|
||||
cfg.bold_brightens_ansi_colors = false
|
||||
cfg.font = wt.font('Cascadia Mono PL')
|
||||
cfg.harfbuzz_features = {"ss01", "ss19", "ss20"}
|
||||
cfg.font_size = fn.set_by_os{
|
||||
Darwin = 14,
|
||||
others = 10
|
||||
}
|
||||
|
||||
-- visuals
|
||||
cfg.native_macos_fullscreen_mode = false
|
||||
cfg.window_decorations = 'RESIZE'
|
||||
cfg.xcursor_theme = 'Adwaita'
|
||||
cfg.use_fancy_tab_bar = false
|
||||
cfg.hide_tab_bar_if_only_one_tab = false
|
||||
cfg.show_new_tab_button_in_tab_bar = false
|
||||
cfg.tab_max_width = 24
|
||||
cfg.window_padding = {
|
||||
left = '5pt',
|
||||
right = 0,
|
||||
top = '2pt',
|
||||
bottom = 0
|
||||
}
|
||||
|
||||
-- theming
|
||||
cfg.color_scheme = color_scheme
|
||||
cfg.colors = {
|
||||
cursor_fg = cursor_fg,
|
||||
cursor_bg = cursor_bg,
|
||||
tab_bar = {
|
||||
background = tab_bg,
|
||||
active_tab = {
|
||||
fg_color = tab_fg,
|
||||
bg_color = tab_bg_active
|
||||
},
|
||||
inactive_tab = {
|
||||
fg_color = tab_fg,
|
||||
bg_color = tab_bg
|
||||
}
|
||||
}
|
||||
}
|
||||
cfg.colors.tab_bar.inactive_tab_hover = cfg.colors.tab_bar.inactive_tab
|
||||
cfg.window_frame = {
|
||||
active_titlebar_bg = tab_bg,
|
||||
inactive_titlebar_bg = tab_bg
|
||||
}
|
||||
|
||||
-- callbacks
|
||||
wt.on('format-window-title', function() return 'WezTerm' end)
|
||||
require('overrides')
|
||||
|
||||
return cfg
|
Loading…
Add table
Add a link
Reference in a new issue