Hacker News new | ask | show | jobs
by LauriL 4910 days ago
A useful article for at least intermediate VIM users.

Regarding the system clipboard register: in OS X 10.8 the `"+` register no longer works. Has anyone found a way to get it working again?

4 comments

It works fine for me. Seems like whatever install of Vim you have doesn't support the clipboard. Run "vim --version | grep clipboard" and see if you get a + or - for the clipboard.

If you want a quick fix for getting it working again, make sure /usr/local/bin is early on in your PATH and run "brew install macvim --override-system-vim"

I visually highlight and call pbcopy on OS X and xclip on ubuntu. It has the annoying side effect of deleting the text, but a simple u fixes that.

So, highlight in visual mode, go into command mode, and !pbcopy

If you use Vim within tmux (on Mac OSX) the clipboard can become 'detached'. To get it working again I use Chris Johnsen's excellent little command.

https://github.com/ChrisJohnsen/tmux-MacOSX-pasteboard

You can install using 'brew install reattach-to-user-namespace'

You need to config tmux:- set-option -g default-command "reattach-to-user-namespace -l zsh"

then set vim to use to use the unnamed clipboard by default.

My version didn't have it builtin so I use fake clip https://github.com/kana/vim-fakeclip