summaryrefslogtreecommitdiff
path: root/config/lf
diff options
context:
space:
mode:
authorSuleyman Farajli <suleyman@farajli.net>2025-06-19 01:00:37 +0400
committerSuleyman Farajli <suleyman@farajli.net>2025-06-19 01:00:37 +0400
commita49d7a5867078a67efb00aa383a0b3693b76ba63 (patch)
tree3cd6ecc8b0a25fc1c10b34cbf3c446a80aa5b372 /config/lf
parent0c748624f05df480060be3c6c3a07ace310866d0 (diff)
refactor(lfrc): clean up config, improve trash cmd, and update keymaps
Diffstat (limited to 'config/lf')
-rw-r--r--config/lf/lfrc51
1 files changed, 24 insertions, 27 deletions
diff --git a/config/lf/lfrc b/config/lf/lfrc
index 1b50065..40b6272 100644
--- a/config/lf/lfrc
+++ b/config/lf/lfrc
@@ -1,51 +1,48 @@
-# Suleyman's gruvbox themed lf config at "https://git.farajli.net/slcf.git"
-
-# Due to the facts that ueberzug is no longer maintained and adds extra \
-# complexity it is not included in the config
+# Due to the fact that ueberzug is no longer maintained and
+# adds extra complexity, it is not included in the configuration."
# Options
set incsearch
-set scrolloff 4 #smooth scrolling
+set scrolloff 4 # Smooth scrolling
-# Key-maps
+# Bindings
map <enter> shell
map m push $mkdir<space>
map t push $touch<space>
map D trash
map <c-f> $lf -remote "send $id select \"$(fzf --reverse)\""
-map x $$f # execute current file (must be executable)
+map x $$f # Execute current file (must be executable)
map zb :{{ set sortby natural; set info size; set preview; set ratios 5:2; }}
map zz :{{ set preview; set ratios 1:2:3; }}
-# Directory change
-map <c-h> cd ~
+# Directory change keybinds (some overwrite default ones)
+# <c-h> and <c-k> might fail on some terminal emulators
+map <c-h> cd ~/
map <c-p> cd ~/proj
map <c-t> cd ~/tproj
-map <c-c> cd ~/.config
-map <c-r> cd /tmp
-map <c-u> cd /usr/local/bin
-map <c-m> cd ~/music
-map <c-b> cd ~/books
-
-# Colors
-set cursoractivefmt "\033[0;1;7m" #white
-# set cursoractivefmt "\033[32;1;7m" #yellowish green
-# set cursoractivefmt "\033[33;1;7m" #orange
-# set cursoractivefmt "\033[36;1;7m" #green
+map <c-k> cd /tmp
+map <c-w> cd ~/work
+# Theme
+set cursoractivefmt "\033[0;1;7m"
set cursorparentfmt "\033[0;1;7m"
set tagfmt "\033[32;1;7m"
set rulerfmt "\033[32;1;7m"
set promptfmt "\033[48;1;234m %w/%f"
-#FIXME: Doesn't overwrite some files
cmd trash ${{
- mkdir -p ~/.trash
- if [ -z "$fs" ]; then
- mv "$f" ~/.trash
- else
- IFS="$(printf '\n\t')"; mv $fs ~/.trash
- fi
+ set -f
+ mkdir -p ~/.trash
+ for entry in $fx; do
+ trash_path=~/.trash/$(basename -- "${entry}")
+ if [ -e "${trash_path}" ]; then
+ printf '%s exists\n' "${trash_path}" >&2
+ trash_path="${trash_path}_$(date +%s)_$RANDOM"
+ printf 'moving to %s\n' "${trash_path}" >&2
+ fi
+
+ mv -- "${entry}" "${trash_path}"
+ done
}}