0

I'm running Ubuntu 18.04 with i3wm. Vim and vim-gtk3 packages are installed.

If I'm in a regular terminal and I start editing a file in vim. I can yank text to the + register as expected. However, if I am browsing the filesystem with ranger, and I use ranger to open a file in vim, I cannot use the + register. If I try typing "+yy to yank a line, I get an error bell when I press +. The same goes for the * register.

As far as I can tell, everything else is the same about vim. I can't figure out why just the clipboard registers won't function in this specific case.

1
  • Welcome to Vi and Vim! Check output of :version when you start Vim both ways. Do both of them include +clipboard among the features? You might have two separate Vim binaries and you're getting one or the other depending on how you start it. Please edit the question to report on your additional findings.
    – filbranden
    Commented May 9, 2020 at 13:09

2 Answers 2

1

Guessing here, as I don't have a Ubuntu to verify (anymore).

I assume that you have two different Vims installed on your machine. This is not unusual (try ls -l /bin/vim.*).

Open Vim from the command line and then execute the command :version in it. This will print version information and a list of features. The feature list will contain the string +clipboard, so clipboard is supported.

Now start Vim from inside ranger and also run :version. This time you will find -clipboard in the feature list. This means no clipboard support.

If my assumptions are true, you need to configure ranger to use the right version of Vim. This question has answers (also none is accepted).

0

You are using default vim (default with many *nix installations), which does not allow system clipboard manipulation. Install either gVim or Neovim (I suggest the latter); these applications come with default clipboard management ability. Then, you can copy and paste from system clipboard, etc.

You can check this by opening your terminal and typing vim --version. If it states - clipboard, you have the default installation that you will need to remove and reinstall the others mentioned above.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.