Closed w43322 closed 1 year ago
I thought this might introduce some complicated editor
related configurations, so I will take another approach.
After #168, it is possible to achieve this with a helper script.
like this:
editor:
command: /usr/local/bin/opener.sh
args: ['{{.AllFiles}}' ]
/usr/local/bin/opener.sh (not tested, may not work):
#!/bin/bash
if [ $# -gt 0 ]; then
for filepath in "$@"
do
file_extension="${filepath##*.}"
case "$file_extension" in
md)
code "$filepath" &
;;
*)
vim -n "$filepath" &
;;
esac
done
else
echo "No file paths provided"
exit 1
fi
that works
Users might want to use different programs to edit / view different file, e.g. it might not be very helpful to open a
.md
file with vim