Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Pasting in vim on tmux returns this error: E353: Nothing in register *

Tags:

vim

tmux

I have Vim inside Tmux. When I copy text using yy and paste. I get the following error E353: Nothing in register *.

This issue only happens when using Vim 7.4. However, when using Vim outside of Tmux, this issue does not occur.

On a sidenote, this does not happen when using Vim 7.3 (vim version installed by OSX 10.9), inside or outside of Tmux.

In .vimrc, I have:

set clipboard=unnamed

In .tmux.conf, I have:

set-option -g default-command "reattach-to-user-namespace -l bash"
like image 688
Samuel Avatar asked Sep 05 '14 11:09

Samuel


People also ask

How do I paste from clipboard in Vim?

When using Vim under Windows, the clipboard can be accessed with the following: In step 4, press Shift+Delete to cut or Ctrl+Insert to copy. In step 6, press Shift+Insert to paste.

Can you paste in vim?

Pasting in VimOnce you have selected text in Vim, no matter whether it is using the yank or the delete command, you can paste it in the wanted location. In Vim terminology, pasting is called putting and the function is utilized with the p command. Using this command pastes the selected text after the cursor.

How do I copy and paste in Neovim?

You can copy this sentence on this blog. Copy and Paste should now work in nvim if the above commands execute to what we've specified above. Let's go into nvim and try it. Just open up nvim and do a "+ you will see the contents of the system clipboard get pasted into the buffer.


1 Answers

In my case I just got it fixed by including on .tmux.conf the following configuration:

set -g default-command 'reattach-to-user-namespace $SHELL --login'
like image 135
maxcnunes Avatar answered Oct 11 '22 21:10

maxcnunes