News for hackers. Stuff that matters.
Re:ZSH Aliases by williamdclt on Tuesday May 26, 2020 @08:17AM (#23310164)
I use global aliases a lot, especially for pipes I use often. my main ones:

- alias -g G="| grep " (`cat test.txt G some_words`) - alias -g CC="| pbcopy " (`cat test.txt CC`) - alias -g "?"="| fzf " (`ls -l ?`) - alias -g X="| xargs " (`ls -l X rm`), probably my favorite (makes xargs kinda look like a pipe) - alias -g Y="| yank "

They compose well, too.

- Pick some file to delete from `git status`: `git status Y X rm`

Re:ZSH Aliases by rgrau on Tuesday May 26, 2020 @08:27AM (#23310241)
I also love them global aliases! To push them even further (like the xargs one), I have those aliases to allow me to do quick iterations in 'streaming' fashion:

    alias -g FORI='| while read i ; do '
    alias -g IROF='; done '
Re:ZSH Aliases by joeraut on Thursday May 28, 2020 @04:17AM (#23334816)
Which "yank" package are you using? I came across one [0], which copies the file selected to the clipboard instead of outputting it to stdout. I managed to get it to print to stdout, though:

  alias -g Y="| yank -- cat "
[0] https://github.com/mptre/yank
Re:ZSH Aliases by williamdclt on Saturday May 30, 2020 @10:55AM (#23361609)
that's the one, from the readme: "If stdout is not a terminal the selected field will be written to stdout and exit without invoking the yank command"

Could be clearer, basically it means that if it's part of a pipe, it's going to print to stdout instead of copying to the clipboard