aboutsummaryrefslogtreecommitdiff
path: root/.config/lf/lfrc
blob: 3d0ca824a502a869b7eaed02d959af50bc4e4ea3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
set ifs "\n"
set sixel true
set cleaner ~/.config/lf/cleaner
set previewer ~/.config/lf/scope

cmd open ${{
  case $(file --mime-type "$(readlink -f $f)" -b) in
    text/*|application/json|inode/x-empty|application/x-subrip) $EDITOR $fx;;
    video/*) setsid -f mpv $f -quiet >/dev/null 2>&1 ;;
    *) for f in $fx; do setsid -f $OPENER $f >/dev/null 2>&1; done;;
  esac
}}

cmd delete ${{
	clear; tput cup $(($(tput lines)/3)); tput bold
	set -f
	printf "%s\n\t" "$fx"
	printf "delete?[y/N]"
	read ans
	[ $ans = "y" ] && rm -rf -- $fx
}}

map D delete