Shell: Add 'pel' function for fzf-ing pacman packaged files
parent
559033de94
commit
87a9301899
|
@ -8,6 +8,7 @@ if [ "zsh" = "$SHELL_CURRENT" ]; then
|
|||
compdef _gs pdfresize
|
||||
compdef _pcc pacfiles
|
||||
compdef _pcc pacsize
|
||||
compdef _pcc pel
|
||||
compdef _pcc pql
|
||||
compdef _tex ltx
|
||||
compdef _path_commands typex
|
||||
|
|
|
@ -215,6 +215,20 @@ xmultioff () {
|
|||
## Pacman functions
|
||||
|
||||
if command -v pacman >/dev/null 2>&1; then
|
||||
if command -v fzf >/dev/null 2>&1; then
|
||||
pel() {
|
||||
local result count
|
||||
count=$#
|
||||
while IFS= read -r i; do
|
||||
set "$@" "$i"
|
||||
done <<EOF
|
||||
$(pacman -Qlq "$@" | grep -v "/$" | fzf)
|
||||
EOF
|
||||
shift $count
|
||||
[ -n "$1" ] && $EDITOR "$@"
|
||||
}
|
||||
fi
|
||||
|
||||
## Get detailed file list for the specified packages, omitting folders.
|
||||
pql () {
|
||||
pacman -Ql "$@" | grep -v "/$"
|
||||
|
|
Loading…
Reference in New Issue