Open nkhlmn opened 7 months ago
I was able to figure out how to do this with action_callback
. E.g.
{
key = 'o',
mods = 'LEADER|CTRL',
action = action_callback(function(win, pane)
local tab = win:active_tab()
for _, p in ipairs(tab:panes()) do
if p:pane_id() ~= pane:pane_id() then
p:activate()
win:perform_action(action.CloseCurrentPane { confirm = false }, p)
end
end
end),
},
It would be nice to have this as an available action though. Happy to submit a PR for that if you feel that is a reasonable thing to add.
I'd rather wait and see if many others request this feature before adding it into the core; I think scripting your own solution is a reasonable outcome in the meantime.
I'd rather wait and see if many others request this feature before adding it into the core; I think scripting your own solution is a reasonable outcome in the meantime.
Hello, I really want this shortcut to be integrated. Also, can you add a shortcut to close all tabs except the current one? Thank you for your project.
I too was surprised this isn't available and would vote for it to be in the core
I too was surprised this isn't available and would vote for it to be in the core
I've sorted out this problem by setting up a configuration.
+1 for making it as standard action
Is your feature request related to a problem? Please describe. I would like to close all panes except for the currently active one with a keybinding
Describe the solution you'd like Ideally, a new
KeyAssignment
function that can be used in a keybindingDescribe alternatives you've considered I've looked into using
action_callback
and I see how you can get a list of panes for a tab and the currently active one, but it's not clear to me how to close them.Additional context