add an example open-file command to lfrc.example

Mentioned in #7.
This commit is contained in:
Gokcehan 2016-08-25 01:12:22 +03:00
parent ef4dd12e33
commit ffe2dc03f0

View File

@ -19,12 +19,20 @@ map <cr> read-shell
map x $"$f"
map X !"$f"
# you can either set your opener to 'mimeopen'
#set opener mimeopen
# or set dedicated keys for specific actions
# dedicated keys for file opener actions
map o &mimeopen "$f"
map m !mimeopen --ask "$f"
# `open-file` is called by `open` when current file is not a directory
# you may want to use either file extensions or mime types with `file`
# below uses an editor for text files and a file opener for the rest
cmd open-file ${{
case $(file --mime-type "$f" -b) in
text/*) IFS=':'; vim $fx;;
*) IFS=':'; for f in $fx; do xdg-open "$f" &> /dev/null & done;;
esac
}}
# rename current file without overwrite
cmd rename $[ -e "$1" ] || mv "$f" "$1"