Skip to content

Instantly share code, notes, and snippets.

@tjluoma
Created October 3, 2014 14:48
Show Gist options
  • Select an option

  • Save tjluoma/06a454787c57fb260481 to your computer and use it in GitHub Desktop.

Select an option

Save tjluoma/06a454787c57fb260481 to your computer and use it in GitHub Desktop.
This is one of those easy things I wish I had done a long time ago: it takes whatever is on the pasteboard, removes any ‘\’ at EOL, changes any tabs or newlines into spaces, and then makes sure that the output does not have more than one consecutive space (to make it nice and even). I invoke this via Keyboard Maestro.
pbpaste | sed 's#\\$##g' | tr -s '\012|\t' ' ' | tr -s ' ' ' '
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment