akinsho / akinsho/toggleterm.nvim
[Feature idea]: Context-based toggling
- Ngôn ngữ chính
- Lua
- Star
- 5.6k
- Fork
- 206
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Mô tả
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.
Hướng dẫn đóng góp
Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này
Đánh giá
Issue này chưa được đánh giá.