From de36b7cb00717c23612157cfb031bb2bc4f575cd Mon Sep 17 00:00:00 2001 From: BZ Date: Sun, 24 Sep 2023 20:15:02 +0200 Subject: [PATCH] provide regexpr_dynamic_vim/tmux options, support neovide pstree detection --- init.lua | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/init.lua b/init.lua index c09efbf..9acbe6d 100644 --- a/init.lua +++ b/init.lua @@ -115,6 +115,9 @@ local function new(args) local dont_restore_mods = cfg.dont_restore_mods local debug = cfg.debug + local regexpr_dynamic_vim = "%- N?VIM$" + local regexpr_dynamic_tmux = "%- TMUX$" + local mods = mod_keysym and { mod_keysym } or generate_conversion_map() local wm_keys = { @@ -199,14 +202,14 @@ local function new(args) local c = client.focus local client_name = c and c.name or "" - if string.find(client_name, "%- N?VIM$") then + if string.find(client_name, regexpr_dynamic_vim) then local seq = get_key_sequence(wm_keys.mods, vim_keys.mods, navigate_vim, dir) run_fn(seq) if debug then debug(string.format("VIM(%s): %s", dir, dump_sequence(seq))) end return - elseif string.find(client_name, "%- TMUX$") then + elseif string.find(client_name, regexpr_dynamic_tmux) then local seq = get_key_sequence(wm_keys.mods, tmux_keys.mods, navigate_tmux, dir) run_fn(seq) if debug then @@ -234,6 +237,7 @@ local function new(args) elseif string.find(out, "[^.*\n]%-n?vim$") or string.find(out, "[^.*\n]%-n?vim%-") + or string.find(out, "^neovide%-%-%-nvim") or string.find(out, "^gvim$") or string.find(out, "^gvim%-") then