Improve papis workflow with enhanced functions and aliases
- Convert pafile and pafinder aliases to shell functions with better parameter handling - Make pafile query parameter optional for interactive document selection - Add patag function for hash-separated multi-tag addition (e.g., patag "tag1#tag2" query) - Add paopen alias for quick document opening - Update README to document all papis workflow shortcuts and functions - Fix deprecated zsh initExtra to initContent 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
parent
f9e8eff265
commit
048804048f
2 changed files with 40 additions and 3 deletions
|
|
@ -102,5 +102,32 @@
|
|||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
# Papis tag function - add multiple tags using hash-separated format
|
||||
patag() {
|
||||
if [ $# -ne 2 ]; then
|
||||
echo "Usage: patag \"tag1#tag2#tag3\" <query>"
|
||||
echo "Example: patag \"materials#ai4science\" amorphous"
|
||||
echo "Example: patag \"quantum#computing\" \"author:einstein\""
|
||||
return 1
|
||||
fi
|
||||
|
||||
local tags_string="$1"
|
||||
local query="$2"
|
||||
|
||||
# Split tags by # and build --add arguments
|
||||
local add_args=""
|
||||
IFS='#' read -ra tags <<< "$tags_string"
|
||||
for tag in "${tags[@]}"; do
|
||||
# Trim whitespace and add to arguments
|
||||
tag=$(echo "$tag" | xargs)
|
||||
if [ -n "$tag" ]; then
|
||||
add_args="$add_args --add \"$tag\""
|
||||
fi
|
||||
done
|
||||
|
||||
# Execute the papis tag command
|
||||
eval "papis tag $add_args \"$query\""
|
||||
}
|
||||
'';
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue