kassio / neoterm

Wrapper of some vim/neovim's :terminal functions.
Other
1.32k stars 117 forks source link

[Question] Toggle neoterm open when using <Plug>(neoterm-repl-send)? #312

Open typoon opened 3 years ago

typoon commented 3 years ago

Hi,

If you close the REPL buffer (using either :q or :Tclose) and then use the mapping that calls <Plug>(neoterm-repl-send) or <Plug>(neoterm-repl-send-line) the buffer with the REPL doesn't automatically reopen. Is there any way of doing that?

Thanks for the help!

typoon commented 3 years ago

I somewhat solved this in the following way:

func! SendCodeOpenNeoterm(type)
  call neoterm#repl#opfunc(a:type)
  exe ":Topen"
endfunc

nmap gx :set opfunc=SendCodeOpenNeoterm<CR>g@

It feels somewhat wrong to me though, since I have to access internal functions of the plugin. Any better suggestions for it?