4 ms·
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
by inanutshellus 3y 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'
- computerfriend 3y agoHere's the xclip way (almost the same actually). alias pbcopy="xclip -selection clipboard" alias pbpaste="xclip -selection clipboard -o"
- lordgrenville 3y agoI use this, and another Mac affordance I copy in Linux is alias open="xdg-open"
- lozf 3y agoThere's `wl-copy` and `wl-paste` for Wayland users too, via https://github.com/bugaevc/wl-clipboard https://github.com/bugaevc/wl-clipboard
- netr0ute 3y agoAnd `cb` which works cross-platform, via https://github.com/Slackadays/clipboard https://github.com/Slackadays/clipboard