A workaround could be use a terminal multiplexer like tmux for your remote ssh
sessions.
With tmux
you can open more panes (or splits) on the same connection, you can work with vim
in a pane (split) and the shell in the other.
With tmux you can copy text from a pane (split) to the other. With the standard shortcut Ctrl+b the workflow is this
- In the
vim
pane enter tmux's copy mode mode Ctrl+b[ - Highlight the text you want to copy with Ctrl+space
- When the selection is complete, copy the text to
tmux
clipboard with Alt+w - Swith to the console pane in tmux (with two panes would be something like Ctrl+b1
- Paste the text in the shell prompt with Ctrl+b]
You can see all the tmux shortcuts by browsing the manual or with Ctrl+b? while inside tmux.
There are some plugins like tslime, vimux and vim-slime that let you interact with a tmux
session while in vim
, like sending portions of text.