How can I check if a terminal exist before I create one

I have this remap on my init.vim nnoremap <leader>t :bel 10sp term://zsh<CR>
it creates a terminal buffer at the bottom of the window. but often I end up creating many terminal buffers that become hard to manage. How can I check if a terminal is created and switch to if it already exists?

1 Like

dude this is an amazng mapping that i never thought of!!! thanks!
i dunno how to answer your question tho :stuck_out_tongue:

use a plugin like GitHub - akinsho/nvim-toggleterm.lua: A neovim lua plugin to help easily manage multiple terminal windows

1 Like

haha… you welcome. I am happy you find it useful.

Thank you, I will check it out