Виджет для завершения процессов

This commit is contained in:
Andrei Astafev 2022-12-23 16:44:39 +03:00
parent 8364968e2f
commit 3819c3ee74

View File

@ -21,10 +21,28 @@ if command -v fzf > /dev/null 2>&1; then
fi fi
#}}} #}}}
#ZSH_FZF_PASTE_KEY=enter ZSH_FZF_PASTE_KEY=enter
#ZSH_FZF_EXEC_KEY=ctrl-r ZSH_FZF_EXEC_KEY=ctrl-r
#zinit wait'0' lucid light-mode depth'1' for \ fzf-kill-proc-by-list() {
# atload"bindkey '^H' fzf-history; \ local cmd=$([ "$UID" != '0' ] && echo "ps -f -u $UID" || echo 'ps -ef')
# bindkey '^Z' fzf-kill-proc-by-list" \ local res=$(${=cmd} \
# amaya382/zsh-fzf-widgets | FZF_DEFAULT_OPTS="${FZF_DEFAULT_OPTS}
--no-sort
--reverse
--bind=\"${ZSH_FZF_PASTE_KEY}:execute@echo kill -9 \$(echo {} | awk '{print \$2}')@+abort\"
--bind=\"${ZSH_FZF_EXEC_KEY}:execute@kill -9 \$(echo {} | awk '{print \$2}')@+abort\"
" $(__fzfcmd))
if [[ -n "$res" ]]; then
LBUFFER=${LBUFFER}$res
zle redisplay
else
zle reset-prompt
fi
}
if command -v fzf > /dev/null 2>&1; then
zle -N fzf-kill-proc-by-list
bindkey '^Z' fzf-kill-proc-by-list
fi