clipboard snippets

How to implement copy-to-clipboard functionality that works with Flash 10

Tagged copy, clipboard, copy-to-clipboard, clippy, flash 10, flash  Languages 

Use mojombo's Clippy which can be downloaded from GitHub.

How to create a custom button

  • First create your button and save it as a PNG file.
  • Change library.xml to use your button.
  • Customize the code behind the button by modifying clippy.hx. You can, for example, remove the "Copy to clipboard" label.
  • Set the width and height of the button. You have to set it in almost all files (compile.hxml, library.xml, etc).
  • Compile the SWF file:
swfmill simple library.xml library.swf && haxe compile.hxml


There are no good alternatives that I know of. I tried ZeroClipboard and other solutions, but they were full of bugs and not customizable.

How to make Vim yank to the OSX clipboard

Tagged clipboard, osx, vim, yank  Languages bash, vim

Add this to .vimrc:

set clipboard=unnamed

If you use Tmux you probably need this:

$ brew install reattach-to-user-namespace

Note, do NOT use something like this because it doesn’t work perfectly:

function! ClipboardYank()
  call system('pbcopy', @@)
function! ClipboardPaste()
  let @@ = system('pbpaste')

vnoremap <silent> y y:call ClipboardYank()<cr>
vnoremap <silent> d d:call ClipboardYank()<cr>
nnoremap <silent> p :call ClipboardPaste()<cr>p