qvacua / vimr

VimR — Neovim GUI for macOS in Swift
https://twitter.com/VimRefined
MIT License
6.62k stars 218 forks source link

Enabling clipboard instructions #945

Open fairanswers opened 2 years ago

fairanswers commented 2 years ago

I re-installed vimr and now I can't figure out how to copy/paste out of it on a mac.

I've searched 3 different times, but other than 'make sure it's supported at compile time' which I don't know how to do, I can't figure it out.

Any clues are appreciated. Joe

bronzehedwick commented 2 years ago

If I understand that you're trying to copy some text in Vim, then paste it elsewhere in the OS, this is not a Vimr specific issue, nor really an issue, just a gap in understanding.

First, Neovim and hence Vimr are always compiled with all features, so system copy/paste is supported in your instance.

Second, and more to your question, Vim uses a system of multiple registers to store deleted/copied text, the system clipboard being stored in the * or + register. So if you wanted to copy the word your cursor was under to later paste somewhere else in the OS, you would do "*yw. See :help registers.

If you prefer more "standard" copy/paste behavior seen in other editors, where the un-prefixed yank commands use the system clipboard, consider mapping the unnamed register to the system register. See :help clipboard.

Hope that helps.

fairanswers commented 2 years ago

@bronzehedwick I really appreciate this help.

this is not a Vimr specific issue, nor really an issue, just a gap in understanding. I'm certain you're right. It's me, I just can't find where I'm wrong.

Neovim and hence Vimr are always compiled with all features, so system copy/paste is supported in your instance. Thanks! That's one factor out of the way.

The problem is, in the version of VimR I installed last year the copy/paste works like you'd think (both with the "*y and cmd-c). I had to upgrade to Monterey and reinstall vimr, but the new version won't copy (but will paste).

If I "yy and "p both in the same vimr window, I get the line I yanked. If I copy something elsewhere and "*p into vimr, the new line pastes.

But if I "*yy in vimr and try to paste in a terminal OR a different vimr window, the clipboard has the old value.

I just confirmed on my account the ~/.vimrc and ~/.vim/vimrc.vim are both blank, if that helps.

bronzehedwick commented 2 years ago

@fairanswers What is the contents of your ~/.config/nvim/init.vim? Neovim (and hence Vimr) have switched to XDG directories for configuration, so that's where the program will look. See :help xdg or the link above.

Also, check the output of :checkhealth and see if there's an error related to the clipboard integration.

Another line of troubleshooting: see if using "+yy results in the correct behavior.

For what its worth, I cannot replicate this problem on Vimr Version 0.39.0 (20220416.182927) locally.

Hope that helps!

fairanswers commented 2 years ago

~/.config/nvim/init.vim just has this line

set runtimepath=~/.vim,~/.vim/pack/tpope/start/fireplace,~/.vim/pack/plugins/start/vimwiki,/usr/share/vim/vimfiles,/usr/share/vim/vim82,/usr/share/vim/vimfiles/after,~/.vim/after

And :checkhealth returns E5009: Invalid 'runtimepath'

But if I change it to set runtimepath=/usr/share/vim/vim82

which does exist, I get the same error.

Thx, Joe

bronzehedwick commented 2 years ago

I'd remove/comment out the runtimepath bit, since it's pointing to Vim8, and who knows what that could cause.