Skip to content

Conversation

@tanloong
Copy link

@tanloong tanloong commented Jan 3, 2024

This adds a skip_toggle option to allow users skip specific terminals when toggling. A use case is when using the file explorer lf.nvim which is based on toggleterm.nvim. A common scenario on my side is that there are two hidden terminals, an Lf terminal and a Shell terminal, where I hope the Shell terminal always shows up on ToggleTerm, even though it is not the last toggled one.

With the skip_toggle this behavior can be achieved:

toggleterm.setup({
    open_mapping = [[<m-=>]],
    skip_toggle = function(t)
        return t and t.cmd and vim.startswith(t.cmd, "lf ")
    end,
}
simplescreenrecorder-2024-01-03_22.21.51.mp4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant