# Basic Settings
# set ratios 1:2:3
set hidden true
set drawbox true
set icons true
set ignorecase true
set previewer "~/.config/lf/preview"
set cleaner "~/.config/lf/cleaner"

# Custom Functions

# Set Wallpapper
cmd setwallpaper ${{
	cp "$f" ~/.local/share/wallpaper.png && feh --bg-scale --no-fehbg "$f"
}}


# Archive bindings
cmd unarchive ${{
  case "$f" in
      *.zip) unzip "$f" ;;
      *.tar.gz) tar -xzvf "$f" ;;
      *.tar.bz2) tar -xjvf "$f" ;;
      *.tar) tar -xvf "$f" ;;
      *) echo "Unsupported format" ;;
  esac
}}

# cmds/functions
cmd mkdir $mkdir -p "$(echo $* | tr ' ' '\ ')"
cmd mkfile $touch "$(echo $* | tr ' ' '\ ')"

cmd moveto ${{
	clear; tput cup $(($(tput lines)/3)); tput bold
	set -f
	clear; echo "Move to where?"
	dest="$(sed -e 's/\s*#.*//' -e '/^$/d' -e 's/^\S*\s*//' ${XDG_CONFIG_HOME:-$HOME/.config}/shell/bm-dirs | sk | sed 's|~|$HOME|')" &&
	for x in $fx; do
		eval mv -iv \"$x\" \"$dest\"
	done &&
	notify-send "File(s) moved." "File(s) moved to $dest."
}}

cmd copyto ${{
	clear; tput cup $(($(tput lines)/3)); tput bold
	set -f
	clear; echo "Copy to where?"
	dest="$(sed -e 's/\s*#.*//' -e '/^$/d' -e 's/^\S*\s*//' ${XDG_CONFIG_HOME:-$HOME/.config}/shell/bm-dirs | sk | sed 's|~|$HOME|')" &&
	for x in $fx; do
		eval cp -ivr \"$x\" \"$dest\"
	done &&
	notify-send "File(s) copied." "File(s) copies to $dest."
}}

# Bindings
# Remove some defaults
map m
map o
map n
map "'"
map '"'
map d
map c
map p
#map c $vscodium "$f"

map au unarchive

# Basic Functions
map . set hidden!
map <c-h> set hidden!
map <enter> shell
map <enter> open
map <c-f> $lf -remote "send $id select '$(sk)'"
map <f-2> rename
map <c-n> push :mkdir<space>
map DD delete
map dd cut
map mv moveto
map cp copyto
map P paste
map mf push :mkfile<space>
map md push :mkdir<space>
map <c-l> clear
map bg setwallpaper


# Movement
map gd cd ~/Downloads
map gD cd ~/Dropbox
map gp cd ~/Pictures
map gc cd ~/.config
map gr cd ~/repos
map gv cd ~/Videos
map gs cd ~/repos/Pyhton/School
map go cd ~/Documents
map gl cd ~/.local
