user1086039
user1086039

Reputation: 193

OSX VIM clipboard support

Does anyone here know why on OSX, clipboard is not supported in VIM editor? and what is the impact of compile from source to replace the existing binary?

Thanks,

Upvotes: 3

Views: 912

Answers (4)

zhaoyou
zhaoyou

Reputation: 308

add it to .vimrc (OSX10.8.5 VIM7.3)

vmap "+y :w !pbcopy<CR><CR> 
nmap "+p :r !pbpaste<CR><CR>

Upvotes: 0

user1086039
user1086039

Reputation: 193

I think I've got an answer. Looking a my vim build, the clipboard module is not enabled. That's the reason why I try *p doesn't work for me.

So either I've to recompile VIM to enable clipboard support or MacVIM as alternative.

There is also another solution which is to use pbcopy/pbpaste. It's even better to map keystroke to this command line.

Dara kok

Upvotes: 1

darcyparker
darcyparker

Reputation: 1219

Try the * register. In insert mode, type Ctrl-R * Or in normal mode, type "*p to put something from the OS (global) clipboard. Similarly "*y to yank something to the global clipboard.

fake-clip.vim plugin is useful in many environments where the * register is not implemented. http://www.vim.org/scripts/script.php?script_id=2098

Upvotes: 0

kenny
kenny

Reputation: 3649

Try adding set cb=unnamed to your .vimrc.

Upvotes: 1

Related Questions