akinsho / akinsho/toggleterm.nvim
[Feature idea]: Context-based toggling
- 主要语言
- Lua
- 星标
- 5.6k
- 派生
- 206
- PR 合并指标
- 30 天内没有已合并 PR
描述
Hi there! I've been using this plugin for quite a while (it finally got me off of tmux!), and wanted to ask for your opinion on this idea for a new configuration option + set of external utility functions. Currently, when using `:ToggleTerm` without a count, it defaults to "smart-toggling", which has the effect of opening the first unhidden terminal if none are open, and closing open terminals one by one otherwise. However, being a frequent user of `:tcd [directory]`, I would find it more useful for terminals to be opened on a per-tab basis, rather than per-session, and there are probably `:lcd [directory]` users out there who would like to have this effect per-window.
~~So, I'm proposing that we add a new config option `toggle_strategy` that can be set to `"first"`, `"by_tab"`, or `"by_window"` that lets the user select their preference. And we could expose the utility functions that work under the hood to find the correct terminal to toggle (based on context) so it is easy for the user to define additional commands if they want to toggle sometimes by tab, sometimes by window, sometimes globally, etc.~~ Edit: change of plans, see #290.
Of course, this is possible already with some amount of configuration work by the user, but I think explicitly supporting this could make things much easier on their end. And we can take the opportunity to generalize/unify some of the logic in the current implementation.
贡献指南
这个仓库没有索引到贡献指南
评估
这个 Issue 还没有评估数据。