Comment by inanutshellus
3 years ago
I love this flow! Such a powerful and clean way to solve text issues.
# This will remove Windows double-spaced empty lines from your copy/paste buffer
alias winlines="sed '/^$/{$!{N;s/\n//;};}'"
# pbw = [P]aste [B]uffer to fix [W]indows line endings
alias pbw="pbpaste | winlines | pbcopy"
Also - if you want `pbpaste` and `pbcopy` on Linux...
# imitate MacOS's paste buffer copy/paste:
alias pbcopy='xsel --clipboard --input'
alias pbpaste='xsel --clipboard --output'
Here's the xclip way (almost the same actually).
I use this, and another Mac affordance I copy in Linux is
There's `wl-copy` and `wl-paste` for Wayland users too, via https://github.com/bugaevc/wl-clipboard
And `cb` which works cross-platform, via https://github.com/Slackadays/clipboard