wezterm: hack to work like it used to in tmux

This commit is contained in:
Daniel Lundin 2021-04-01 19:31:44 +02:00
parent 8dc4873606
commit 8a9f86c1db
2 changed files with 39 additions and 13 deletions

View file

@ -1,11 +1,26 @@
local wezterm = require 'wezterm';
local editPanes = {};
local editMarker = ":nvim";
-- Window titles are a perfectly fine IPC mechanism 😁
wezterm.on("update-right-status", function(window, pane)
local title = pane:get_title();
local pid = pane:pane_id();
if editPanes[pid] ~= title and title:sub(-#editMarker) == editMarker then
editPanes[pid] = title;
window:perform_action(wezterm.action{ActivateTab=0}, pane);
end
end);
function font_with_fallback(name, params)
local names = {name, "Noto Color Emoji"}
return wezterm.font_with_fallback(names, params)
end
return {
-- automatically_reload_config = false,
font = font_with_fallback("Iosevka Term SS09 Light"),
font_rules = {
@ -47,22 +62,33 @@ return {
enable_scroll_bar = false,
window_decorations = "NONE",
scrollback_lines = 5000,
alternate_buffer_wheel_scroll_speed = 2,
check_for_updates = false,
status_update_interval = 100,
leader = { key="o", mods="CTRL", timeout_milliseconds=1000 },
keys = {
{key="C", mods="ALT|SHIFT", action="Copy"},
{key="V", mods="ALT|SHIFT", action="Paste"},
-- {key="1", mods="ALT", action=wezterm.action{ActivateTab=0}},
-- {key="2", mods="ALT", action=wezterm.action{ActivateTab=1}},
-- {key="3", mods="ALT", action=wezterm.action{ActivateTab=2}},
-- {key="4", mods="ALT", action=wezterm.action{ActivateTab=3}},
-- {key="5", mods="ALT", action=wezterm.action{ActivateTab=4}},
-- {key="6", mods="ALT", action=wezterm.action{ActivateTab=5}},
-- {key="7", mods="ALT", action=wezterm.action{ActivateTab=6}},
-- {key="8", mods="ALT", action=wezterm.action{ActivateTab=7}},
-- {key="9", mods="ALT", action=wezterm.action{ActivateTab=8}},
-- {key="0", mods="ALT", action=wezterm.action{ActivateTab=9}},
{key="c", mods="ALT|SHIFT", action="Copy"},
{key="v", mods="ALT|SHIFT", action="Paste"},
{key="n", mods="LEADER", action=wezterm.action{SpawnTab="CurrentPaneDomain"}},
{key="c", mods="LEADER", action=wezterm.action{SpawnTab="CurrentPaneDomain"}},
{key="k", mods="LEADER", action=wezterm.action{CloseCurrentTab={confirm=true}}},
{key="LeftArrow", mods="CTRL", action=wezterm.action{ActivateTabRelative=-1}},
{key="RightArrow", mods="CTRL", action=wezterm.action{ActivateTabRelative=1}},
{key="1", mods="ALT", action=wezterm.action{ActivateTab=0}},
{key="2", mods="ALT", action=wezterm.action{ActivateTab=1}},
{key="3", mods="ALT", action=wezterm.action{ActivateTab=2}},
{key="4", mods="ALT", action=wezterm.action{ActivateTab=3}},
{key="5", mods="ALT", action=wezterm.action{ActivateTab=4}},
{key="6", mods="ALT", action=wezterm.action{ActivateTab=5}},
{key="7", mods="ALT", action=wezterm.action{ActivateTab=6}},
{key="8", mods="ALT", action=wezterm.action{ActivateTab=7}},
{key="9", mods="ALT", action=wezterm.action{ActivateTab=8}},
{key="0", mods="ALT", action=wezterm.action{ActivateTab=9}},
},
colors = {

2
.zshrc
View file

@ -130,8 +130,8 @@ export NVIM_LISTEN_ADDRESS=/tmp/nvimsocket
e ()
{
tmux select-window -t1
nvr --remote $(readlink -f "$@")
echo -e "\x1b]2;$(date +%s):nvim\x1b\\"
}
## fzf