skywind3000 / vim-terminal-help

Small changes make vim/nvim's internal terminal great again !!
MIT License
246 stars 32 forks source link

Handle any open terminal window, rather than only the one this plugin opens #21

Open BlueDrink9 opened 4 years ago

BlueDrink9 commented 4 years ago

3 suggests using neoterm for REPL - which is a good idea. This plugin shouldn't do REPL. What I think it should do is be able to integrate with things that do, like neoterm or Nvim-R.

Can you please add a feature or options to allow the shortcut to hide/unhide already existing terminal windows, like neoterm windows?

For tabs with a single terminal window open, this should be simple. I am unsure what behavior should be for tabs with multiple terminal windows, or tabs with one window that is a terminal window.

BlueDrink9 commented 4 years ago

@skywind3000 is this feasible with the current setup?

jiz4oh commented 1 year ago

@skywind3000 could you consider this suggestion? it's very helpful

jiz4oh commented 1 year ago

Hi @BlueDrink9, you can try my fork, and add below configuration in your .vimrc

augroup vim-terminal-help-augroup
  autocmd!

  if has('nvim')
    autocmd TermOpen * let t:__terminal_bid__ = bufnr('')
  elseif exists('##TerminalWinOpen')
    autocmd TerminalWinOpen * let t:__terminal_bid__ = bufnr('')
  endif
augroup END

it's works fine for me. if anything works well, I will open a PR to contribute back the repo