Skip to content

Instantly share code, notes, and snippets.

@tsukkee
Created July 22, 2008 19:03
Show Gist options
  • Save tsukkee/1207 to your computer and use it in GitHub Desktop.
Save tsukkee/1207 to your computer and use it in GitHub Desktop.
" reference
" http://subtech.g.hatena.ne.jp/cho45/20061010/1160459376
" http://vim.wikia.com/wiki/Mac_OS_X_clipboard_sharing
"
" need 'set enc=utf-8' and
" below shell environment variable for UTF-8 characters
" export __CF_USER_TEXT_ENCODING='0x1F5:0x08000100:14'
"
" Vim(Mac)
if has('mac') && !has('gui')
nnoremap <silent> <Space>y :.w !pbcopy<CR><CR>
vnoremap <silent> <Space>y :w !pbcopy<CR><CR>
nnoremap <silent> <Space>p :r !pbpaste<CR>
vnoremap <silent> <Space>p :r !pbpaste<CR>
" GVim(Mac & Win)
else
noremap <Space>y "+y
noremap <Space>p "+p
endif
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment