|
|
@@ -147,6 +147,21 @@ if [ -x /usr/bin/fzf ]; then
|
|
|
}
|
|
|
zle -N fzf-git-commit-sha-widget
|
|
|
bindkey '^G' fzf-git-commit-sha-widget
|
|
|
+
|
|
|
+ __fzf_pid() {
|
|
|
+ setopt localoptions pipefail no_aliases 2> /dev/null
|
|
|
+ ps axo pid,start,user,command |
|
|
|
+ FZF_DEFAULT_OPTS="--height ${FZF_TMUX_HEIGHT:-40%} --reverse ${FZF_DEFAULT_OPTS-}" $(__fzfcmd) -m "$@" |
|
|
|
+ cut -c -6 | xargs
|
|
|
+ }
|
|
|
+ fzf-pid-widget() {
|
|
|
+ LBUFFER="${LBUFFER}$(__fzf_pid)"
|
|
|
+ local ret=$?
|
|
|
+ zle reset-prompt
|
|
|
+ return $ret
|
|
|
+ }
|
|
|
+ zle -N fzf-pid-widget
|
|
|
+ bindkey '^O' fzf-pid-widget
|
|
|
fi
|
|
|
|
|
|
stty stop undef
|