aboutsummaryrefslogtreecommitdiff
path: root/lf/dot-config
diff options
context:
space:
mode:
authorMohammad Reza Karimi <m.r.karimi.j@gmail.com>2025-12-16 13:27:11 -0500
committerMohammad Reza Karimi <m.r.karimi.j@gmail.com>2025-12-16 13:27:11 -0500
commit5a41da5881a11ba3fdc3890c342aa3b7eb53e0cf (patch)
tree92b7f7af29ed4a9dcc0eab33490c6225cce9b14a /lf/dot-config
parent856e361d56c201cbb1b1521c8b93b747163b1376 (diff)
add initial version (incomplete)
Diffstat (limited to 'lf/dot-config')
-rw-r--r--lf/dot-config/lf/icons77
-rw-r--r--lf/dot-config/lf/lfrc84
2 files changed, 161 insertions, 0 deletions
diff --git a/lf/dot-config/lf/icons b/lf/dot-config/lf/icons
new file mode 100644
index 0000000..aad068c
--- /dev/null
+++ b/lf/dot-config/lf/icons
@@ -0,0 +1,77 @@
+di 📁
+fi 📃
+tw 🤝
+ow 📂
+ln ⛓
+or ❌
+ex 🎯
+*.txt ✍
+*.mom ✍
+*.me ✍
+*.ms ✍
+*.avif 🖼
+*.png 🖼
+*.webp 🖼
+*.ico 🖼
+*.jpg 📸
+*.jpe 📸
+*.jpeg 📸
+*.gif 🖼
+*.svg 🗺
+*.tif 🖼
+*.tiff 🖼
+*.xcf 🖌
+*.html 🌎
+*.xml 📰
+*.gpg 🔒
+*.css 🎨
+*.pdf 📚
+*.djvu 📚
+*.epub 📚
+*.csv 📓
+*.xlsx 📓
+*.tex 📜
+*.md 📘
+*.r 📊
+*.R 📊
+*.rmd 📊
+*.Rmd 📊
+*.m 📊
+*.mp3 🎵
+*.opus 🎵
+*.ogg 🎵
+*.m4a 🎵
+*.flac 🎼
+*.wav 🎼
+*.mkv 🎥
+*.mp4 🎥
+*.webm 🎥
+*.mpeg 🎥
+*.avi 🎥
+*.mov 🎥
+*.mpg 🎥
+*.wmv 🎥
+*.m4b 🎥
+*.flv 🎥
+*.zip 📦
+*.rar 📦
+*.7z 📦
+*.tar 📦
+*.z64 🎮
+*.v64 🎮
+*.n64 🎮
+*.gba 🎮
+*.nes 🎮
+*.gdi 🎮
+*.1 ℹ
+*.nfo ℹ
+*.info ℹ
+*.log 📙
+*.iso 📀
+*.img 📀
+*.bib 🎓
+*.ged 👪
+*.part 💔
+*.torrent 🔽
+*.jar ♨
+*.java ♨
diff --git a/lf/dot-config/lf/lfrc b/lf/dot-config/lf/lfrc
new file mode 100644
index 0000000..226e1aa
--- /dev/null
+++ b/lf/dot-config/lf/lfrc
@@ -0,0 +1,84 @@
+# vim: ft=lf
+
+set shellopts '-eu'
+set ifs "\n"
+set autoquit true
+set icons
+set scrolloff 10
+set period 1
+set hiddenfiles ".*:*.aux:*.log:*.bbl:*.bcf:*.blg:*.run.xml"
+
+cmd open ${{
+ case $(file --mime-type "$(readlink -f "$f")" -b) in
+ text/* | application/json | inode/x-empty | application/x-subrip) $EDITOR "$fx" ;;
+ image/*) setsid -f app2unit -- imv -d $(rotdir "$f" | grep -i "\.\(png\|jpg\|jpeg\|gif\|webp\|avif\|tif\|ico\)\(_large\)*$") 2>/dev/null | while read -r file; do
+ [ -z "$file" ] && continue
+ lf -remote "send select \"$file\""
+ done & ;;
+ audio/* | video/x-ms-asf) setsid -f app2unit -- mpv --audio-display=no "$f" ;;
+ video/*) setsid -f app2unit -- mpv "$f" -quiet >/dev/null 2>&1 ;;
+ application/pgp-encrypted) $EDITOR "$fx" ;;
+ *) for f in $fx; do setsid -f app2unit-open "$f" >/dev/null 2>&1; done ;;
+ esac
+}}
+
+cmd mkdir $mkdir -p "$@"
+
+cmd extract ${{
+ clear; tput cup $(($(tput lines)/3)); tput bold
+ set -f
+ printf "%s\n\t" "$fx"
+ printf "extract?[y/N]"
+ read ans
+ [ $ans = "y" ] && {
+ case $fx in
+ *.tar.bz2) tar xjf $fx ;;
+ *.tar.gz) tar xzf $fx ;;
+ *.bz2) bunzip2 $fx ;;
+ *.rar) unrar e $fx ;;
+ *.gz) gunzip $fx ;;
+ *.tar) tar xf $fx ;;
+ *.tbz2) tar xjf $fx ;;
+ *.tgz) tar xzf $fx ;;
+ *.zip) unzip $fx ;;
+ *.Z) uncompress $fx ;;
+ *.7z) 7z x $fx ;;
+ *.tar.xz) tar xf $fx ;;
+ esac
+ }
+}}
+
+cmd quit-and-cd &{{
+ pwd > $LF_CD_FILE
+ lf -remote "send $id quit"
+}}
+
+cmd fzf_jump ${{
+ res="$(fd . | fzf --reverse --header='Jump to location')"
+ if [ -n "$res" ]; then
+ if [ -d "$res" ]; then
+ cmd="cd"
+ else
+ cmd="select"
+ fi
+ res="$(printf '%s' "$res" | sed 's/\\/\\\\/g;s/"/\\"/g')"
+ lf -remote "send $id $cmd \"$res\""
+ fi
+}}
+
+cmd dragon ${{
+ IFS="$(printf '\n\t')"; dragon-drop $fx
+}}
+
+map Y $printf "%s" "$fx" | wl-copy
+map <c-n> push :mkdir<space>""<left>
+map D delete
+map Q quit-and-cd
+map E :extract; reload
+map <c-f> :fzf_jump
+map o &mimeopen "$f"
+map O &mimeopen --ask "$f"
+map <c-s> dragon
+map W $setsid -f $TERMINAL >/dev/null 2>&1
+map <c-g> redraw
+map <c-l> unselect