Skip to content

Instantly share code, notes, and snippets.

@phx
Created June 13, 2013 22:52
Show Gist options
  • Select an option

  • Save phx/5778095 to your computer and use it in GitHub Desktop.

Select an option

Save phx/5778095 to your computer and use it in GitHub Desktop.
(osx version) when copied to ~/.bashrc or ~/.bash_profile, will create 'Ctrl + ]' keyboard shortcut, allowing *current* (not necessarily last) terminal command to be copied to the gui clipboard via pbpaste.
#!/bin/bash
bind '"\C-]":"\C-e\C-u pbcopy <<"EOF"\n\C-y\nEOF\n"'
# i might try:
# $ echo 'bind \'"\C-]":"\C-e\C-u pbcopy <<"EOF"\n\C-y\nEOF\n"\'' >> ~/.bash_profile
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment