Can't copy-paste from one terminal to another using vim
I opened two text files with vim(different two konsole window).
Selecting some texts from one vim window yanked(y) then tried pasting(p) to other vim window.It doesn't work. Code:
E353:Nothing in register " What's the way to paste texts from one vim window to another? Slakcware 13+kde |
1 Attachment(s)
Hi,
1. On the source terminal, I use my mouse to select the block & right-click and select copy. 2. Then on the destination terminal, I right-click and select paste. |
No option if i do right click.
|
All you need to do is highlight the text with you mouse that you want to copy. It is automatically copied. Then in the window you want to paste into, go into insert mode, and then click your middle mouse button while pointing into that window.
HTH Forrest p.s. Just to add, "yy" yanks and "p" pastes. |
Quote:
But if they are different two vim windows then it doesn't work. |
It works with any window be it vim or any other app. You do need to go into insert mode first (by pressing 'i' in the target window). Try again. This is how X windows has worked for as long as I've used it (since late 1980's). Highlighting any text automatically copies it to the X window buffer. Clicking the middle mouse button pastes it to the window under the mouse pointer.
HTH Forrest |
Here's another thread about it. Basically it is controlled by an option in '/usr/share/vim/vimrc' or '~/.vimrc' or can be switched during runtime in vi with: ':set mouse=a' and ':set mouse=r'
I uninstalled elvis to which vi symlink points by default in slackware, and using vim middleclick pasteing works as expected after having set 'set mouse=r' in configuration file. |
Thanks veeall.
:set mouse=r and it works fine. |
This is solved.
|
The mouse options screws with the way you do somethings. But! if you remember to use shift + highlight or shift + click then it will work. I believe gpm needs to be enabled.
this is because vim is compiled without x clipboard support on slackware. Obviously this does not affect gvim |
For this and other nifty features relating to X, I symlink vim to gvim
|
You know I have this same issue for slackware --current, but not using 'vim' (as I don't use vi/vim/gvim - my brain don't work that way) ; I have this issue with nano using xterm.
Example: step 1: have an xterm open step 2: then highlight text (it should now be in clipboard/klipper) step 3: nano somefile.txt step 4: press mousewheel down, or use shift-insert to paste the text and what get's pasted is stuff that I had used 'control + c' key on earlier. It's driving me batty! |
All times are GMT -5. The time now is 02:30 PM. |