akinsho / akinsho/toggleterm.nvim

[Feature] Allow multiple terminals opened in different tabpages

Aperta
#452 16 commenti 0 reazioni 0 assegnatari Vedi su GitHub
Lingua principale
Lua
Stelle
5.6k
Fork
206
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

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,
})
```

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.