Replies: 2 comments 1 reply
-
This should do what you want {
"folke/snacks.nvim",
opts = {
styles = {
terminal = {
keys = {
term_quit = {
"<C-q>",
function(self)
local alt_win = vim.fn.win_getid(vim.fn.winnr("#"))
self:hide()
vim.schedule(function()
if alt_win and vim.api.nvim_win_is_valid(alt_win) then
vim.api.nvim_set_current_win(alt_win)
end
end)
end,
mode = "t",
desc = "Close terminal and focus last window",
},
},
},
},
},
} Test it out. I chose |
Beta Was this translation helpful? Give feedback.
1 reply
-
fyi, snacks windows now automatically go back to the last window |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hello.
While working in some window, when I open a terminal split, and close it, the window that gets focused is not the one I toggled the terminal from. If there are at least two windows, toggling behaves like this in one of them.
This doesn't happen with floating terminals, I've switched to floating terms for now.
Is there a way to configure this behavior?
Thanks.
By toggling, I mean just calling
require("snacks").terminal()
twice in a row.Beta Was this translation helpful? Give feedback.
All reactions