]> Freerunner's - dotfiles.git/commitdiff
lf: update config, add rulerfile
authorAndre Ramnitz <andre.ramnitz@mail.de>
Sun, 25 Oct 2026 08:06:33 +0000 (09:06 +0100)
committerAndre Ramnitz <andre.ramnitz@mail.de>
Sun, 25 Oct 2026 08:07:06 +0000 (09:07 +0100)
dot-config/lf/lfrc
dot-config/lf/rulerfile [new file with mode: 0644]

index 76ae424..c41d69b 100644 (file)
@@ -14,10 +14,7 @@ set number true
 set relativenumber false
 set mergeindicators true
 set preload true
-
-
-# options
-set rulerfmt '%i/%t (%P)'
+set rulerfile ~/.config/lf/rulerfile
 
 # previews via https://github.com/NikitaIvanovV/ctpv?tab=readme-ov-file
 set sixel true
@@ -75,24 +72,18 @@ on-focus-gained
 map <delete> trash
 # map <delete> delete
 
-cmd add-dir ${{
-       printf "Directory name:"
-       read ans
-       mkdir $ans
-}}
-
-cmd add-file ${{
-       printf "File name:"
-       read ans
-       touch $ans
+cmd mkdir %{{
+    IFS=" "
+    file="$*"
+    mkdir -p -- "$file"
+    lf -remote "send $id cd \"$(printf '%s' "$file" | sed 's/\\/\\\\/g;s/"/\\"/g')\""
 }}
 
-cmd add-file-and-edit %{{
+cmd touch %{{
     IFS=" "
     file="$*"
     touch -- "$file"
-    file="$(printf '%s' "$file" | sed 's/\\/\\\\/g;s/"/\\"/g')"
-    lf -remote "send $id :select \"$file\"; \$\$EDITOR \"$file\""
+    lf -remote "send $id select \"$(printf '%s' "$file" | sed 's/\\/\\\\/g;s/"/\\"/g')\""
 }}
 
 # set terminal title to current working directory
@@ -195,8 +186,7 @@ cmd bulk-rename ${{
                        a="$(cat $index | sed "${counter}q;d")"
                        b="$(cat $index_edit | sed "${counter}q;d")"
                        counter=$(($counter+1))
-                       
-                       [ "$a" = "$b" ] && continue
+            [ "$a" = "$b" ] && continue
                        [ -e "$b" ] && echo "File exists: $b" && continue
                        mv "$a" "$b"
                done
@@ -206,9 +196,10 @@ cmd bulk-rename ${{
        rm $index $index_edit
 }}
 
-cmd on-select &{{
-    lf -remote "send $id set statfmt \"$(eza -ldo --color=always --smart-group --no-permissions "$f")\""
-}}
+# cmd on-select &{{
+#     # lf -remote "send $id set rulerfile \"$(eza -ldo --color=always --smart-group --no-permissions "$f")\""
+#     lf -remote "send $id set rulerfile rulerfile
+# }}
 
 cmd goto-file &{{
     if [ -n "$(find -mindepth 1 -maxdepth 1 -type d -print -quit)" ]; then
@@ -449,7 +440,7 @@ map ml mark-load
 # a = add/apply
 map ad add-dir
 map ae add-file-and-edit
-map aD add-dir-and-move-selection
+map adm add-dir-and-move-selection
 map af add-file
 map awc :apply-wallpaper-content
 map awe :apply-wallpaper-expressive
@@ -473,11 +464,11 @@ map dZ delete #zap
 
 # g = goto
 map Ga cd ~/Applications/
-map Gc cd /media/data/nextcloud/
+map Gc cd /etc/
 map Gd cd ~/dotfiles/
 map Gk cd /etc/portage/patches/sys-kernel/
 map Gl cd ~/.local/
-map Gn cd /media/data/nextcloud/Notizen/
+map Gn cd /media/multimedia/nextcloud/Notizen/
 map Gs cd ~/Bilder/Screenshots/
 map gd cd ~/Downloads/
 map gc cd ~/.config/
@@ -487,6 +478,7 @@ map gF goto-file
 map gl follow-link
 map gm cd /media/
 map gM cd /run/media/
+map gn cd /media/multimedia/nextcloud/
 map go :fzf_jump
 map gt cd ~/.local/share/Trash/
 map gw cd ~/Wallpapers
diff --git a/dot-config/lf/rulerfile b/dot-config/lf/rulerfile
new file mode 100644 (file)
index 0000000..a0f01c3
--- /dev/null
@@ -0,0 +1,21 @@
+{{with .Message -}}
+    {{. -}}
+{{else with .Stat -}}
+    {{.Permissions | printf "\033[36m%s\033[0m" -}}
+    {{with .LinkCount}} {{.}}{{end -}}
+    {{with .User}} {{.}}{{end -}}
+    {{with .Group}} {{.}}{{end -}}
+    {{.Size | humanize | printf " %5s" -}}
+    {{.ModTime | printf " %s" -}}
+    {{with .Target}} -> {{.}}{{end -}}
+{{end -}}
+{{.SPACER -}}
+{{with .Keys}}  {{.}}{{end -}}
+{{with .Progress}}  {{join . " "}}{{end -}}
+{{with .Copy}}  {{len . | printf "%s %d \033[0m" $.Options.copyfmt}}{{end -}}
+{{with .Cut}}  {{len . | printf "%s %d \033[0m" $.Options.cutfmt}}{{end -}}
+{{with .Select}}  {{len . | printf "%s %d \033[0m" $.Options.selectfmt}}{{end -}}
+{{with .Visual}}  {{len . | printf "%s %d \033[0m" $.Options.visualfmt}}{{end -}}
+{{with .Filter}}  {{join . " " | printf "\033[7;34m %s \033[0m"}}{{end -}}
+{{printf "  %d/%d" .Index .Total}}
+