ZSH: adds aws key regex to currenWordCompletions

master
Jonathan Hodgson 3 years ago
parent 7240fbc402
commit 98a1d5177a
  1. 6
      shells/zsh/includes/currentwordcompletion.zsh
  2. 19
      shells/zsh/includes/navi.zsh

@ -20,7 +20,11 @@ regexSelect(){
echo -ne "URLs\t"
echo -n 'https?://[^\"\\'"'"'> ]+'
echo -ne "\tRequires extended regex -E in grep"
echo -e "\tRequires extended regex -E in grep"
echo -ne "AWS Keys\t"
echo -n '([^A-Z0-9]|^)(AKIA|A3T|AGPA|AIDA|AROA|AIPA|ANPA|ANVA|ASIA)[A-Z0-9]{12,}'
echo -e "\tRequires extended regex -E in grep"
) | column -t -s $'\t' | fzf --preview-window top:1 --preview 'echo {3}' --delimiter ' +' --header-lines 1 --with-nth 1,2 | awk -F ' +' '{print "\"" $2 "\""}'
}

@ -0,0 +1,19 @@
#!/usr/bin/env zsh
#_call_navi() {
# local selected
# if [ -n "$LBUFFER" ]; then
# if selected="$(printf "%s" "$(navi --print --fzf-overrides '--no-select-1' --query "${LBUFFER}" </dev/tty)")"; then
# LBUFFER="$selected"
# fi
# else
# if selected="$(printf "%s" "$(navi --print </dev/tty)")"; then
# LBUFFER="$selected"
# fi
# fi
# zle redisplay
#}
#
#zle -N _call_navi
#
#bindkey '^n' _call_navi
Loading…
Cancel
Save