I am using vim 7.3 on the Ubuntu 12.04 terminal.
When editing a file in vim, I could select some text in visual mode and then use "+y
to yank it into the system clipboard. I could then paste the text into ANOTHER Ubuntu terminal (using shift-ctrl-v
).
However, if I could have access to only one Ubuntu terminal, I must temporarily leave vim by using :shell
to go to the Ubuntu command prompt. After that I find that the yanked text no longer exists in the system clipboard and I could not paste it into the command prompt.
Is there any way that I could retain the yanked text in the system clipboard after using :shell
(using keyboard only) ? Thanks for any suggestion.
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
vim
pane enter tmux's copy mode mode Ctrl+b[
tmux
clipboard with Alt+w
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With