adjust papis alias

This commit is contained in:
Yan Lin 2025-10-24 10:31:42 +02:00
parent cbb8459622
commit d365d1ca4f

View file

@ -8,8 +8,7 @@
[settings]
default-library = main
editor = nvim
opentool = ${if pkgs.stdenv.isDarwin then "open" else "xdg-open"}
file-browser = ${if pkgs.stdenv.isDarwin then "open" else "xdg-open"}
opentool = ${if pkgs.stdenv.isDarwin then "open -a Preview" else "evince"}
# Document management
ref-format = {doc[author]}{doc[year]}
@ -95,30 +94,6 @@
# Shell functions for papis workflow
programs.zsh.initContent = ''
# Papis finder function - open document directory with query support
${lib.optionalString pkgs.stdenv.isDarwin ''
pafinder() {
local result=$(papis list "$@" | head -1)
if [ -n "$result" ]; then
open -R "$result"
else
echo "No documents found"
return 1
fi
}
''}
${lib.optionalString (!pkgs.stdenv.isDarwin) ''
pafinder() {
local result=$(papis list "$@" | head -1)
if [ -n "$result" ]; then
xdg-open "$(dirname "$result")"
else
echo "No documents found"
return 1
fi
}
''}
# Papis add file function - add file to existing document with proper parameter handling
pafile() {
if [ $# -lt 1 ]; then