update
This commit is contained in:
parent
7962d7bf93
commit
3eecc4853e
|
@ -11,39 +11,6 @@ if wezterm.config_builder then
|
||||||
config = wezterm.config_builder()
|
config = wezterm.config_builder()
|
||||||
end
|
end
|
||||||
|
|
||||||
local function isViProcess(pane)
|
|
||||||
-- get_foreground_process_name On Linux, macOS and Windows,
|
|
||||||
-- the process can be queried to determine this path. Other operating systems
|
|
||||||
-- (notably, FreeBSD and other unix systems) are not currently supported
|
|
||||||
return pane:get_foreground_process_name():find('n?vim') ~= nil
|
|
||||||
-- return pane:get_title():find("n?vim") ~= nil
|
|
||||||
end
|
|
||||||
|
|
||||||
local function conditionalActivatePane(window, pane, pane_direction, vim_direction)
|
|
||||||
if isViProcess(pane) then
|
|
||||||
window:perform_action(
|
|
||||||
-- This should match the keybinds you set in Neovim.
|
|
||||||
act.SendKey({ key = vim_direction, mods = 'ALT' }),
|
|
||||||
pane
|
|
||||||
)
|
|
||||||
else
|
|
||||||
window:perform_action(act.ActivatePaneDirection(pane_direction), pane)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
wezterm.on('ActivatePaneDirection-right', function(window, pane)
|
|
||||||
conditionalActivatePane(window, pane, 'Right', 'l')
|
|
||||||
end)
|
|
||||||
wezterm.on('ActivatePaneDirection-left', function(window, pane)
|
|
||||||
conditionalActivatePane(window, pane, 'Left', 'h')
|
|
||||||
end)
|
|
||||||
wezterm.on('ActivatePaneDirection-up', function(window, pane)
|
|
||||||
conditionalActivatePane(window, pane, 'Up', 'k')
|
|
||||||
end)
|
|
||||||
wezterm.on('ActivatePaneDirection-down', function(window, pane)
|
|
||||||
conditionalActivatePane(window, pane, 'Down', 'j')
|
|
||||||
end)
|
|
||||||
|
|
||||||
-- Do not check for or show window with update information
|
-- Do not check for or show window with update information
|
||||||
config.check_for_updates = false
|
config.check_for_updates = false
|
||||||
config.show_update_window = false
|
config.show_update_window = false
|
||||||
|
@ -77,58 +44,49 @@ config.tab_max_width = 24
|
||||||
config.colors = {
|
config.colors = {
|
||||||
tab_bar = {
|
tab_bar = {
|
||||||
background = '#1d2021',
|
background = '#1d2021',
|
||||||
|
-- style tabs
|
||||||
active_tab = {
|
active_tab = { bg_color = '#1d2021', fg_color = '#d4be98', intensity = 'Normal', italic = false, },
|
||||||
bg_color = '#1d2021',
|
inactive_tab = { bg_color = '#1d2021', fg_color = '#7c6f64', intensity = 'Half', italic = false, },
|
||||||
fg_color = '#d4be98',
|
inactive_tab_hover = { bg_color = '#1d2021', fg_color = '#7c6f64', intensity = 'Half', italic = false, },
|
||||||
intensity = 'Normal',
|
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, },
|
||||||
|
|
||||||
inactive_tab = {
|
|
||||||
bg_color = '#1d2021',
|
|
||||||
fg_color = '#7c6f64',
|
|
||||||
intensity = 'Half',
|
|
||||||
},
|
|
||||||
|
|
||||||
new_tab = {
|
|
||||||
bg_color = '#1d2021',
|
|
||||||
fg_color = '#7c6f64',
|
|
||||||
intensity = 'Half',
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
-- Key Assignments
|
-- Key Assignments
|
||||||
config.disable_default_key_bindings = true
|
config.disable_default_key_bindings = true
|
||||||
config.keys = {
|
config.keys = {}
|
||||||
-- Tabs
|
|
||||||
{ key = 't', mods = 'ALT', action = act.SpawnTab 'CurrentPaneDomain' },
|
|
||||||
{ key = 'w', mods = "ALT|CTRL", action = act.CloseCurrentTab { confirm = false } },
|
|
||||||
|
|
||||||
-- Panes
|
for i = 1, 8 do
|
||||||
{ key = 'v', mods = 'ALT', action = act.SplitVertical { domain = 'CurrentPaneDomain' } },
|
-- CTRL+ALT + number to activate that tab
|
||||||
{ 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.EmitEvent('ActivatePaneDirection-left' ) },
|
|
||||||
{ key = 'DownArrow', mods = 'ALT', action = act.EmitEvent('ActivatePaneDirection-down' ) },
|
|
||||||
{ key = 'UpArrow', mods = 'ALT', action = act.EmitEvent('ActivatePaneDirection-up' ) },
|
|
||||||
{ key = 'RightArrow', mods = 'ALT', action = act.EmitEvent('ActivatePaneDirection-right') },
|
|
||||||
|
|
||||||
-- Clipboard
|
|
||||||
{ key = 'X', mods = 'CTRL', action = act.ActivateCopyMode },
|
|
||||||
{ key = 'C', mods = 'CTRL', action = act.CopyTo 'ClipboardAndPrimarySelection' },
|
|
||||||
{ key = 'V', mods = 'CTRL', action = act.PasteFrom 'Clipboard' },
|
|
||||||
}
|
|
||||||
|
|
||||||
-- Bind tabs to number keys
|
|
||||||
for i = 1, 5 do
|
|
||||||
table.insert(config.keys, {
|
table.insert(config.keys, {
|
||||||
key = tostring(i),
|
key = tostring(i),
|
||||||
mods = 'ALT',
|
mods = 'CTRL|ALT',
|
||||||
action = act.ActivateTab(i - 1),
|
action = act.ActivateTab(i - 1),
|
||||||
})
|
})
|
||||||
end
|
end
|
||||||
|
|
||||||
|
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', },
|
||||||
|
}
|
||||||
|
|
||||||
return config
|
return config
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue