diff options
Diffstat (limited to 'shell/completion.zsh')
| -rw-r--r-- | shell/completion.zsh | 26 |
1 files changed, 25 insertions, 1 deletions
diff --git a/shell/completion.zsh b/shell/completion.zsh index 9979933e..1199ac54 100644 --- a/shell/completion.zsh +++ b/shell/completion.zsh @@ -290,8 +290,32 @@ _fzf_complete_unalias() { } _fzf_complete_kill() { + local transformer + transformer=' + if [[ $FZF_KEY =~ ctrl|alt|shift ]] && [[ -n $FZF_NTH ]]; then + nths=( $(tr , " " <<< "$FZF_NTH") ) + new_nths=() + found=0 + for nth in ${nths[@]}; do + if [[ $nth = $FZF_CLICK_HEADER_NTH ]]; then + found=1 + else + new_nths+=($nth) + fi + done + [[ $found = 0 ]] && new_nths+=($FZF_CLICK_HEADER_NTH) + new_nths=$(echo ${new_nths[@]} | tr " " ,) + echo "change-nth($new_nths)+change-prompt($new_nths> )" + else + if [[ $FZF_NTH = $FZF_CLICK_HEADER_NTH ]]; then + echo "change-nth()+change-prompt(> )" + else + echo "change-nth($FZF_CLICK_HEADER_NTH)+change-prompt($FZF_CLICK_HEADER_WORD> )" + fi + fi + ' _fzf_complete -m --header-lines=1 --no-preview --wrap --color fg:dim,nth:regular \ - --bind 'click-header:transform:echo "change-nth($FZF_CLICK_HEADER_NTH)+change-prompt($FZF_CLICK_HEADER_WORD> )"' -- "$@" < <( + --bind "click-header:transform:$transformer" -- "$@" < <( command ps -eo user,pid,ppid,start,time,command 2> /dev/null || command ps -eo user,pid,ppid,time,args 2> /dev/null || # For BusyBox command ps --everyone --full --windows # For cygwin |
