voldikss / vim-floaterm

:computer: Terminal manager for (neo)vim
MIT License
2.5k stars 80 forks source link

Question - How to send contents of a buffer to via Floaterm send? #294

Closed dky closed 3 years ago

dky commented 3 years ago

Hello, currently exploring floaterm it's awesome! Thank you for the work on this! I'm currently trying to send the contents of my entire buffer into a floaterm but failing.

Ex:

au FileType python nmap <F8> :echo system('python "' . expand('%') . '"')<cr>

This allows me to spawn a terminal with python and just send the contents of the buffer via F8. Ideally I'd like to do the same with floaterm.

I've tried :FloatermSend python % But that just opens a python repl. I've done some digging and also found a thread mentioning :%FloatermSend python which also doesn't work. Any ideas on if this is possible?

strboul commented 3 years ago
:FloatermNew python
:FloatermSend

works quite okay in my system.

You can also have a look at my dotfiles, for the floaterm configuration, which I use it as a REPL.

dky commented 3 years ago

Thanks for this example! Taking a look at your floaterm config right now. I will take some time and play around with it!