]> Freerunner's - dotfiles.git/commitdiff
lf: clear marked files with ',' like selections in kakoune
authorAndre Ramnitz <tux.rising@gmail.com>
Mon, 28 Apr 2025 10:59:44 +0000 (12:59 +0200)
committerAndre Ramnitz <tux.rising@gmail.com>
Mon, 28 Apr 2025 10:59:44 +0000 (12:59 +0200)
dot-config/lf/lfrc

index 413ca395f182011c19e2a2e5612b7b38d048ed83..448b5a5b08ca797b8ae81d670f1db1f000c1de3a 100644 (file)
@@ -92,7 +92,7 @@ cmd add-file-and-edit %{{
 
 # set terminal title to current working directory
 cmd on-cd &{{
-       printf "\033]0; $PWD\007" > /dev/tty
+       printf "\033]0;  | $PWD\007" > /dev/tty
 }}
 
 # extract the current file with the right command
@@ -385,6 +385,13 @@ cmd selected-to-new-folder ${{
        mv -- $fx "$newd"
 }}
 
+# clipboard interaction
+cmd yank-file $printf '%s' "$f" | wl-copy
+cmd yank-paths $printf '%s' "$fx" | wl-copy
+cmd yank-dirname &printf '%s' "$PWD" | wl-copy
+cmd yank-basename &basename -a -- $fx | head -c-1 | wl-copy
+cmd yank-basename-without-extension &basename -a -- $fx | sed -E 's/\.[^.]+$//' | head -c-1 | wl-copy
+
 # ------------------------------------ commands:
 # helpers
 cmd open-with-gui &$@ $fx # opens asynchronously, intended for GUI applications
@@ -437,7 +444,6 @@ map aw :apply-wallpaper
 # c = change
 map cd push :cd<space>
 map cw : rename
-map cy yank-file $printf '%s' "$f" | wl-copy -p -n
 map cm chmod
 
 # d = delete
@@ -511,6 +517,13 @@ map xo $mimeopen --ask $f
 map xs $$f
 map xa !$f
 
+# Y = Yank into clipboard
+map Yf : yank-file
+map Yp : yank-paths
+map Yd : yank-dirname
+map Yb : yank-basename
+map YB : yank-basename-without-extension
+
 # z = ???
 zp = set info perm:user:group
 
@@ -525,6 +538,7 @@ map <a-f> filter
 
 # various commands
 map <enter> open
+map , clear
 map <esc> unselect
 map ~ toggle_preview
 map C edit-config