akinsho / akinsho/toggleterm.nvim

[Feature] Allow multiple terminals opened in different tabpages

未关闭
#452 16 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
主要语言
Lua
星标
5.6k
派生
206
PR 合并指标
30 天内没有已合并 PR

描述

Hi, thanks for making this awesome plugin, it makes nvim's builtin terminal much more ergonomic and user-friendly.

Sometimes I work on 2+ projects in neovim and keeps them in multiple tabs, and it would be nice to have multiple toggleterms opened in these tabs. Currently if I open a toggleterm in one tab, switch to another tab and call 'toggleterm.toggle_command()` again, toggleterm will close the terminal in the previous tabpage instead of opening a new one in the current tabpage.

I assume this might be a config issue and can be solved by passing proper opts to toggleterm? The following is my config if that's related:

```lua
local toggleterm = require('toggleterm')

toggleterm.setup({
open_mapping = '',
shade_terminals = false,
start_in_insert = false,
hide_numbers = true,
autochdir = false,
persist_size = false,
direction = 'horizontal',
float_opts = {
border = 'shadow',
width = function()
return math.floor(vim.go.columns * 0.7)
end,
height = function()
return math.floor(vim.go.lines * 0.7)
end,
winblend = 0,
},
size = function(term)
if term.direction == 'horizontal' then
return vim.go.lines * 0.3
elseif term.direction == 'vertical' then
return vim.go.columns * 0.35
end
end,
highlights = {
NormalFloat = { link = 'NormalFloat' },
FloatBorder = { link = 'FloatBorder' },
WinBarActive = { link = 'WinBar' },
WinBarInactive = { link = 'WinBarNC' },
MatchParen = { link = 'None' },
},
winbar = {
enabled = false,
},
on_open = function()
vim.cmd('silent! normal! 0')
end,
})
```

贡献指南

这个仓库没有索引到贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。