Skip to content

Commit

Permalink
simplify the suggested menu command
Browse files Browse the repository at this point in the history
  • Loading branch information
majamin committed Oct 16, 2021
1 parent b6da0a2 commit 9fdc41e
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions README.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@ TODO
Bonus
-----

You can alias a simple command like this one in zsh:
You can alias a simple command like this one to get a nice menu that prints out the command:

alias oneliner='print -z $(grep "(\*)" -rw oneliners.txt | fzf -e | sed "s/: \{1,\}/\n/" | tail -1 | sed "s/^\`//;s/\`$//")'

Which will give you a `fzf` menu and then print the command directly into the shell for editing or execution.
alias oneliner='print -z $(grep "^(\*)" oneliners.txt | fzf -e | grep -oP "(?<=: \`).*(?=\`$)")'
(requirements: zsh is your shell, GNU grep, fzf)

0 comments on commit 9fdc41e

Please sign in to comment.