Revise papis alias

This commit is contained in:
Yan Lin 2025-07-29 21:59:01 +02:00
parent 687d5b52cc
commit e97279e5a4
2 changed files with 23 additions and 9 deletions

View file

@ -463,15 +463,18 @@ papis list --format '{doc[author]} - {doc[title]} ({doc[year]})'
**Workflow Aliases:**
```bash
# Bibliography formatting
papis-info # List documents with formatted template
papis-info "machine learning" # Search and format specific documents
pals # List documents with formatted template
pals "machine learning" # Search and format specific documents
# File operations
papis-add-file filename.pdf [query] # Add file from ~/Downloads/ to existing entry
papis-add-url [url] [query] # Add file from URL to existing entry
pafile filename.pdf [query] # Add file from ~/Downloads/ to existing entry
paurl [url] [query] # Add file from URL to existing entry
# Directory access
papis-finder [query] # Open document directory in Finder
# Directory access (shell function)
pafinder # Open first document directory in Finder
pafinder "query" # Open first matching document directory
pafinder author:einstein # Open first Einstein paper directory
pafinder --sort year smith # Open newest Smith paper directory
```
**Configuration location**: `modules/papis.nix` with embedded configuration

View file

@ -54,8 +54,19 @@
# File operations
pafile = "papis addto -f ~/Downloads/";
paurl = "papis addto -u";
# Finder integration
pafinder = "open -R $(papis list)";
};
# Shell functions for papis workflow
programs.zsh.initExtra = ''
# Papis finder function - open document directory in Finder with query support
pafinder() {
local result=$(papis list "$@" | head -1)
if [ -n "$result" ]; then
open -R "$result"
else
echo "No documents found"
return 1
fi
}
'';
}