Created
May 31, 2019 02:40
-
-
Save aont/089b5a335cbb75ee3a62c3dc16a0ff79 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # percol-cdr my custom | |
| setopt BASH_REMATCH | |
| function percol-cdr () { | |
| local selected_line="$( cdr -l | percol )" | |
| if [ -n "$selected_line" ]; then | |
| if [[ "$selected_line" =~ ^[0-9]+ ]]; then | |
| local selected_num=$BASH_REMATCH[1] | |
| cdr $selected_num > /dev/null | |
| else | |
| echo "unexpected error" 1>&2 | |
| fi | |
| fi | |
| } | |
| zle -N percol-cdr | |
| alias pcd=percol-cdr |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment